summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-10-29 16:36:43 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-10-29 20:26:38 +0100
commit798d21e2a1b8bc48b6bb5e1b3cf0cba0e5882a59 (patch)
tree7ccbaf434bc41e64676eae46aa9dae8520687c77 /starmath
parentee7d7fa79eae4979ed45f757430664b333faad1f (diff)
tdf#157965: UNO methods are expected to return sizes in mm/100
Commit 9e92a17cb6e03beedeeca40bfc8524c2623d31eb made sm to always use twips; before, it used mm/100 except in LOK. That change broke the size values returned from XRenderable::getRenderer: instead of mm/100, the resulting values were in twips, but handled as mm/100. Set the printer's map mode to use mm/100s explicitly. Also use mm/100s in the call to SvxPaperInfo::GetDefaultPaperSize. Change-Id: Id7cf40d4bc19c92dc54ca03d81f25ba1f6bf25b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158622 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/unomodel.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx
index 73f1c4b17715..829c57de820f 100644
--- a/starmath/source/unomodel.cxx
+++ b/starmath/source/unomodel.cxx
@@ -960,12 +960,16 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SmModel::getRenderer(
SmPrinterAccess aPrinterAccess( *pDocSh );
Size aPrtPaperSize;
if (Printer *pPrinter = aPrinterAccess.GetPrinter())
+ {
+ // tdf#157965: UNO methods are expected to return sizes in mm/100
+ pPrinter->SetMapMode(MapMode(MapUnit::Map100thMM)); // reset in SmPrinterAccess dtor
aPrtPaperSize = pPrinter->GetPaperSize();
+ }
// if paper size is 0 (usually if no 'real' printer is found),
// guess the paper size
if (aPrtPaperSize.IsEmpty())
- aPrtPaperSize = SvxPaperInfo::GetDefaultPaperSize(SmMapUnit());
+ aPrtPaperSize = SvxPaperInfo::GetDefaultPaperSize(MapUnit::Map100thMM);
awt::Size aPageSize( aPrtPaperSize.Width(), aPrtPaperSize.Height() );
uno::Sequence< beans::PropertyValue > aRenderer(1);