This is a "tree" that we have had in our house for a long time. It started withering around a year ago and I couldn't figure out what it was. When it flowers(which it doesn't anymore) the blooms look like little white grape vines. The only guess I had was the money tree, but unlike the Moneytree, the base is skinny and tall, and not spiraled. IT seemed to react well to being sprayed daily with water.
This is Aucuba japonica (common name spotted laurel) - whether it's a named variety or not is hard to say. This plant is often grown outdoors in shady areas, where it can reach a height and spread of up to 10 feet, but is sometimes used as a houseplant. Your description of the flowers, though, doesn't really fit, though it's possible that what you're actually describing are unripe berries - there is an image in this link of this plant in flower, please check it looks similar to what you remember https://www.burncoose.co.uk/site/plants.cfm?pl_id=406.
Because it's actually a large shrub, over time in a pot indoors it gets very leggy, as yours has done. The pot is not visible in your picture, and I do wonder whether it might need a larger pot, but without sight of it, its hard to say. What it does need is cutting back hard, to about 4/6 inches in height - turn it out of its pot and check if the roots are coiled round and round, and if they are, give it a larger pot one or two sizes bigger, using fresh potting soil around it when repotting. Water in well and allow to drain down freely afterwards. Feeding fortnightly with a proprietary houseplant food such as Baby Bio is a good idea after cutting back, and ongoing until mid summer. Don't feed during autumn and winter, but start the regime again the following spring.
Female varieties of this plant produce red berries, but these are not usually produced indoors - if you have pets, note the plant is mildly toxic if ingested, so don't allow them to chew on it. Further information on growing as a houseplant here https://www.guide-to-houseplants.com/aucuba-japonica.html
In response to the photo you supplied of what you remember the flowers to be like, this plant might instead be one of the crotons, Codiaeum variegatum, possibly the variety 'punctatum aureum'. There is an image of this plant in this link http://www.plantsrescue.com/tag/croton/ but you need to scroll down to the bottom to see it - its one of the thumbnail images. if it is that, the link also contains care instructions which differ significantly in terms of the temperature and humidity required compared to Aucuba. You can still cut it right back though, and repot as advised previously.