diff options
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/emojiviewitem.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/control/thumbnailviewitem.cxx | 11 | ||||
-rw-r--r-- | sfx2/source/doc/SfxRedactionHelper.cxx | 8 |
3 files changed, 9 insertions, 16 deletions
diff --git a/sfx2/source/control/emojiviewitem.cxx b/sfx2/source/control/emojiviewitem.cxx index f9394ea9435c..ff90325dd4bc 100644 --- a/sfx2/source/control/emojiviewitem.cxx +++ b/sfx2/source/control/emojiviewitem.cxx @@ -42,11 +42,11 @@ void EmojiViewItem::calculateItemsPosition (const tools::Long /*nThumbnailHeight css::lang::Locale() ); Size aRectSize = maDrawArea.GetSize(); - Point aPos = maDrawArea.TopLeft(); + Point aPos = maDrawArea.TopCenter(); // Calculate text position - aPos.setY( maDrawArea.getY() + (aRectSize.Height() - aTextDev.getTextHeight())/3 ); - aPos.setX( maDrawArea.Left() + (aRectSize.Width() - aTextDev.getTextWidth(maTitle,0,nMaxTextLength))/2 ); + aPos.Move(-aTextDev.getTextWidth(maTitle, 0, nMaxTextLength) / 2, + (aRectSize.Height() - aTextDev.getTextHeight()) / 3); maTextPos = aPos; } diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx index e5ed6e3cb7f4..80a1da50a01c 100644 --- a/sfx2/source/control/thumbnailviewitem.cxx +++ b/sfx2/source/control/thumbnailviewitem.cxx @@ -125,19 +125,14 @@ void ThumbnailViewItem::calculateItemsPosition (const tools::Long nThumbnailHeig pAttrs->aFontSize.getX(), pAttrs->aFontSize.getY(), css::lang::Locale() ); - Size aRectSize = maDrawArea.GetSize(); Size aImageSize = maPreview1.GetSizePixel(); // Calculate thumbnail position - Point aPos = maDrawArea.TopLeft(); - aPos.setX( maDrawArea.getX() + (aRectSize.Width()-aImageSize.Width())/2 ); - aPos.setY( maDrawArea.getY() + nPadding + (nThumbnailHeight-aImageSize.Height())/2 ); - maPrev1Pos = aPos; + const Point aPos = maDrawArea.TopCenter(); + maPrev1Pos = aPos + Point(-aImageSize.Width() / 2, nPadding + (nThumbnailHeight - aImageSize.Height()) / 2); // Calculate text position - aPos.setY( maDrawArea.getY() + nThumbnailHeight + nPadding * 2 ); - aPos.setX( maDrawArea.Left() + (aRectSize.Width() - aTextDev.getTextWidth(maTitle,0,nMaxTextLength))/2 ); - maTextPos = aPos; + maTextPos = aPos + Point(-aTextDev.getTextWidth(maTitle, 0, nMaxTextLength) / 2, nThumbnailHeight + nPadding * 2); } void ThumbnailViewItem::Paint (drawinglayer::processor2d::BaseProcessor2D *pProcessor, diff --git a/sfx2/source/doc/SfxRedactionHelper.cxx b/sfx2/source/doc/SfxRedactionHelper.cxx index ca82fc484767..ca2006534207 100644 --- a/sfx2/source/doc/SfxRedactionHelper.cxx +++ b/sfx2/source/doc/SfxRedactionHelper.cxx @@ -154,8 +154,7 @@ tools::Rectangle ImplCalcActionBounds(const MetaAction& rAct, const OutputDevice { tools::Rectangle aBoundRect1( const_cast<OutputDevice&>(rOut).ImplGetTextBoundRect(*pSalLayout1)); - aActionBounds.SetLeft(rOut.PixelToLogic(aBoundRect1).getX() - + rOut.PixelToLogic(aBoundRect1).getWidth()); + aActionBounds.SetLeft(rOut.PixelToLogic(aBoundRect1).Right()); } } } @@ -456,8 +455,7 @@ void SfxRedactionHelper::searchInMetaFile(const RedactionTarget& rRedactionTarge // Calculate the difference between current wrong value and value should it be. // Add the difference to current value. // Then increase 10% of the new value to make it look better. - aNewRect.SetTop(aNewRect.getY() + (aNewRect.getHeight() - aLastFontHeight) - - aLastFontHeight / 10); + aNewRect.SetTop(aNewRect.Bottom() - aLastFontHeight - aLastFontHeight / 10); aRedactionRectangles.push_back(aNewRect); } @@ -502,7 +500,7 @@ void SfxRedactionHelper::addRedactionRectToPage( "LineStyle", css::uno::makeAny(css::drawing::LineStyle::LineStyle_NONE)); xRectShape->setSize(awt::Size(aNewRectangle.GetWidth(), aNewRectangle.GetHeight())); - xRectShape->setPosition(awt::Point(aNewRectangle.getX(), aNewRectangle.getY())); + xRectShape->setPosition(awt::Point(aNewRectangle.Left(), aNewRectangle.Top())); xPage->add(xRectShape); } |