[Libreoffice-commits] core.git: sc/source
Dennis Francis (via logerrit)
logerrit at kemper.freedesktop.org
Sun Jul 5 09:01:56 UTC 2020
sc/source/ui/docshell/docsh4.cxx | 33 ++++++++++++++++++++++-----------
1 file changed, 22 insertions(+), 11 deletions(-)
New commits:
commit ef740ac1291c1e7a04c45c727e18ce28b196c812
Author: Dennis Francis <dennis.francis at collabora.com>
AuthorDate: Mon May 25 23:53:21 2020 +0530
Commit: Dennis Francis <dennis.francis at collabora.com>
CommitDate: Sun Jul 5 11:01:20 2020 +0200
lokit: scPrintTwipsMsgs: LOK_CALLBACK_COMMENT
Allow print twips coordinates in LOK_CALLBACK_COMMENT
Change-Id: I052dacb311c651c49d61fd9937951fa5b81b32d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97967
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Dennis Francis <dennis.francis at collabora.com>
(cherry picked from commit dd64235e326feb94c7530f7ee408545e4945d5df)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97978
Tested-by: Jenkins
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index c021ee40da3d..6e369608998e 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -2497,17 +2497,28 @@ void ScDocShell::LOKCommentNotify(LOKCommentNotificationType nType, const ScDocu
ScViewData* pViewData = GetViewData();
if (pViewData && pViewData->GetActiveWin())
{
- Point aScrPos = pViewData->GetScrPos(rPos.Col(), rPos.Row(), pViewData->GetActivePart(), true);
- long nSizeXPix;
- long nSizeYPix;
- pViewData->GetMergeSizePixel(rPos.Col(), rPos.Row(), nSizeXPix, nSizeYPix);
-
- const double fPPTX = pViewData->GetPPTX();
- const double fPPTY = pViewData->GetPPTY();
- tools::Rectangle aRect(Point(aScrPos.getX() / fPPTX, aScrPos.getY() / fPPTY),
- Size(nSizeXPix / fPPTX, nSizeYPix / fPPTY));
-
- aAnnotation.put("cellPos", aRect.toString());
+ bool bInPrintTwips = comphelper::LibreOfficeKit::isCompatFlagSet(
+ comphelper::LibreOfficeKit::Compat::scPrintTwipsMsgs);
+ OString aRectString;
+ if (bInPrintTwips)
+ {
+ Point aTopLeft = pViewData->GetPrintTwipsPos(rPos.Col(), rPos.Row());
+ long nSizeX, nSizeY;
+ pViewData->GetMergeSizePrintTwips(rPos.Col(), rPos.Row(), nSizeX, nSizeY);
+ aRectString = tools::Rectangle(aTopLeft, Size(nSizeX, nSizeY)).toString();
+ }
+ else
+ {
+ Point aTopLeft = pViewData->GetScrPos(rPos.Col(), rPos.Row(),
+ pViewData->GetActivePart(), true);
+ long nSizeXPix, nSizeYPix;
+ pViewData->GetMergeSizePixel(rPos.Col(), rPos.Row(), nSizeXPix, nSizeYPix);
+ const double fPPTX = pViewData->GetPPTX();
+ const double fPPTY = pViewData->GetPPTY();
+ aRectString = tools::Rectangle(Point(aTopLeft.getX() / fPPTX, aTopLeft.getY() / fPPTY),
+ Size(nSizeXPix / fPPTX, nSizeYPix / fPPTY)).toString();
+ }
+ aAnnotation.put("cellPos", aRectString);
}
}
More information about the Libreoffice-commits
mailing list