diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-23 12:17:29 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-30 09:23:38 +0200 |
commit | a074ebf230b1feef3ca1bf1ef074b140d4bbe962 (patch) | |
tree | 4bd9239fdd02e989b592d6773aa9ea663c19d90f /editeng | |
parent | f7e23565ed958ef649e3f3ca143691c0471113f1 (diff) |
editeng tiled rendering: fix selection overlay in Impress
The map mode is twips in Writer, that's why it worked there. For
Impress, we need a conversion to always have twips output.
Change-Id: I53c64b961180b6ff9b4ee75e3c5aa775416e7ae7
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 7ac0acc0721f..8866f994dd0a 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -324,6 +324,7 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou if (isTiledRendering()) { + bool bMm100ToTwip = pOutWin->GetMapMode().GetMapUnit() == MAP_100TH_MM; OString sRectangle; // If we are not in selection mode, then the exported selection should be empty. if (pEditEngine->pImpEditEngine->IsInSelectionMode()) @@ -335,19 +336,25 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, vcl::Region* pRegion, Ou { Rectangle& rStart = aRectangles.front(); Rectangle aStart = Rectangle(rStart.Left(), rStart.Top(), rStart.Left() + 1, rStart.Bottom()); + if (bMm100ToTwip) + aStart = OutputDevice::LogicToLogic(aStart, MAP_100TH_MM, MAP_TWIP); libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION_START, aStart.toString().getStr()); Rectangle& rEnd = aRectangles.back(); Rectangle aEnd = Rectangle(rEnd.Right() - 1, rEnd.Top(), rEnd.Right(), rEnd.Bottom()); + if (bMm100ToTwip) + aEnd = OutputDevice::LogicToLogic(aEnd, MAP_100TH_MM, MAP_TWIP); libreOfficeKitCallback(LOK_CALLBACK_TEXT_SELECTION_END, aEnd.toString().getStr()); } std::stringstream ss; for (size_t i = 0; i < aRectangles.size(); ++i) { - const Rectangle& rRectangle = aRectangles[i]; + Rectangle& rRectangle = aRectangles[i]; if (i) ss << "; "; + if (bMm100ToTwip) + rRectangle = OutputDevice::LogicToLogic(rRectangle, MAP_100TH_MM, MAP_TWIP); ss << rRectangle.toString().getStr(); } sRectangle = ss.str().c_str(); |