diff options
Diffstat (limited to 'sc/source/filter/oox/worksheethelper.cxx')
-rw-r--r-- | sc/source/filter/oox/worksheethelper.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx index 3dfbf8a3b663..d74f344b1f02 100644 --- a/sc/source/filter/oox/worksheethelper.cxx +++ b/sc/source/filter/oox/worksheethelper.cxx @@ -1172,9 +1172,9 @@ namespace { sal_Int32 getColumnWidth(UnitConverter& rConverter, double nWidth) { double nCoeff = rConverter.getCoefficient(UNIT_DIGIT); - VirtualDevice aDev; + ScopedVclPtrInstance<VirtualDevice> aDev; - long nPixel = aDev.LogicToPixel(Point(nCoeff, 0), MapMode(MAP_100TH_MM)).getX(); + long nPixel = aDev->LogicToPixel(Point(nCoeff, 0), MapMode(MAP_100TH_MM)).getX(); // the 1.047 has been experimentally chosen based on measurements witha screen ruler @@ -1182,7 +1182,7 @@ sal_Int32 getColumnWidth(UnitConverter& rConverter, double nWidth) // algorithm from OOXML spec part1: 18.3.1.13 sal_Int32 nColWidthPixel= std::floor(((256*nWidth + std::floor(128.0/nPixel))/256.0)*nPixel) * 1.047; - return aDev.PixelToLogic(Point(nColWidthPixel, 0), MapMode(MAP_100TH_MM)).getX(); + return aDev->PixelToLogic(Point(nColWidthPixel, 0), MapMode(MAP_100TH_MM)).getX(); } } |