summaryrefslogtreecommitdiff
path: root/svx/source/tbxctrls
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-03-30 20:27:55 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-03-31 06:27:11 +0000
commita5a571307fb3306b74ab46b085cde6388270a770 (patch)
tree66d4ce12bb5236c50ab6a5d253bc8c6d8b5d292d /svx/source/tbxctrls
parent17d821af6bb9df93569836a92f6bed975587fc6c (diff)
tdf#82580 tools: rename Rectangle to tools::Rectangle
Mostly generated using make check COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=clang-rename-wrapper RENAME_ARGS="-qualified-name=Rectangle -new-name=tools::Rectangle" Except some modules have their own foo::tools namespace, so there have to use ::tools::Rectangle. This commit just moves the class from the global namespace, it does not update pre/postwin.h yet. Change-Id: I42b2de3c6f769fcf28cfe086f98eb31e42a305f2 Reviewed-on: https://gerrit.libreoffice.org/35923 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'svx/source/tbxctrls')
-rw-r--r--svx/source/tbxctrls/SvxPresetListBox.cxx2
-rw-r--r--svx/source/tbxctrls/fontworkgallery.cxx6
-rw-r--r--svx/source/tbxctrls/grafctrl.cxx2
-rw-r--r--svx/source/tbxctrls/layctrl.cxx34
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx20
-rw-r--r--svx/source/tbxctrls/tbxcolorupdate.cxx6
6 files changed, 35 insertions, 35 deletions
diff --git a/svx/source/tbxctrls/SvxPresetListBox.cxx b/svx/source/tbxctrls/SvxPresetListBox.cxx
index 89f96da17ec7..0bda5d1831b4 100644
--- a/svx/source/tbxctrls/SvxPresetListBox.cxx
+++ b/svx/source/tbxctrls/SvxPresetListBox.cxx
@@ -67,7 +67,7 @@ void SvxPresetListBox::Command( const CommandEvent& rEvent )
pMenuWindow->GetPopupModeFlags() | FloatWinPopupFlags::NoMouseUpClose);
}
pMenu->SetSelectHdl( LINK(this, SvxPresetListBox, OnMenuItemSelected) );
- pMenu->Execute(this,Rectangle(aPos,Size(1,1)),PopupMenuFlags::ExecuteDown);
+ pMenu->Execute(this,tools::Rectangle(aPos,Size(1,1)),PopupMenuFlags::ExecuteDown);
}
}
break;
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index 2d34ace6eef1..9b93bc22d008 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -203,12 +203,12 @@ void FontWorkGalleryDialog::insertSelectedFontwork()
OutputDevice* pOutDev = mpSdrView->GetFirstOutputDevice();
if( pOutDev )
{
- Rectangle aObjRect( pNewObject->GetLogicRect() );
- Rectangle aVisArea = pOutDev->PixelToLogic(Rectangle(Point(0,0), pOutDev->GetOutputSizePixel()));
+ tools::Rectangle aObjRect( pNewObject->GetLogicRect() );
+ tools::Rectangle aVisArea = pOutDev->PixelToLogic(tools::Rectangle(Point(0,0), pOutDev->GetOutputSizePixel()));
Point aPagePos = aVisArea.Center();
aPagePos.X() -= aObjRect.GetWidth() / 2;
aPagePos.Y() -= aObjRect.GetHeight() / 2;
- Rectangle aNewObjectRectangle(aPagePos, aObjRect.GetSize());
+ tools::Rectangle aNewObjectRectangle(aPagePos, aObjRect.GetSize());
SdrPageView* pPV = mpSdrView->GetSdrPageView();
pNewObject->SetLogicRect(aNewObjectRectangle);
diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index 9a8e4e419ab5..a66609ec79af 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -741,7 +741,7 @@ void SvxGrafAttrHelper::ExecuteGrafAttr( SfxRequest& rReq, SdrView& rView )
Size aNewGrfSize( OutputDevice::LogicToLogic( rGrfSize, aMapTwip, aMap100 ) );
Size aOldGrfSize( pObj->GetLogicRect().GetSize() );
- Rectangle aNewRect( aNewOrigin, aNewGrfSize );
+ tools::Rectangle aNewRect( aNewOrigin, aNewGrfSize );
Point aOffset( (aNewGrfSize.Width() - aOldGrfSize.Width()) >> 1,
(aNewGrfSize.Height() - aOldGrfSize.Height()) >> 1 );
diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx
index f552a4864a4a..ee5e69f2fc3f 100644
--- a/svx/source/tbxctrls/layctrl.cxx
+++ b/svx/source/tbxctrls/layctrl.cxx
@@ -81,7 +81,7 @@ public:
void KeyInput( const KeyEvent& rKEvt ) override;
virtual void MouseMove( const MouseEvent& rMEvt ) override;
virtual void MouseButtonUp( const MouseEvent& rMEvt ) override;
- virtual void Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& ) override;
+ virtual void Paint( vcl::RenderContext& /*rRenderContext*/, const tools::Rectangle& ) override;
virtual void PopupModeEnd() override;
private:
@@ -242,7 +242,7 @@ void TableWindow::MouseButtonUp( const MouseEvent& rMEvt )
}
-void TableWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
+void TableWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
const long nSelectionWidth = mnTablePosX + nCol * mnTableCellWidth;
const long nSelectionHeight = mnTablePosY + nLine * mnTableCellHeight;
@@ -250,15 +250,15 @@ void TableWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
// the non-selected parts of the table
rRenderContext.SetLineColor(aLineColor);
rRenderContext.SetFillColor(aFillColor);
- rRenderContext.DrawRect(Rectangle(nSelectionWidth, mnTablePosY, mnTableWidth, nSelectionHeight));
- rRenderContext.DrawRect(Rectangle(mnTablePosX, nSelectionHeight, nSelectionWidth, mnTableHeight));
- rRenderContext.DrawRect(Rectangle(nSelectionWidth, nSelectionHeight, mnTableWidth, mnTableHeight));
+ rRenderContext.DrawRect(tools::Rectangle(nSelectionWidth, mnTablePosY, mnTableWidth, nSelectionHeight));
+ rRenderContext.DrawRect(tools::Rectangle(mnTablePosX, nSelectionHeight, nSelectionWidth, mnTableHeight));
+ rRenderContext.DrawRect(tools::Rectangle(nSelectionWidth, nSelectionHeight, mnTableWidth, mnTableHeight));
// the selection
if (nCol > 0 && nLine > 0)
{
rRenderContext.SetFillColor(aHighlightFillColor);
- rRenderContext.DrawRect(Rectangle(mnTablePosX, mnTablePosY, nSelectionWidth, nSelectionHeight));
+ rRenderContext.DrawRect(tools::Rectangle(mnTablePosX, mnTablePosY, nSelectionWidth, nSelectionHeight));
}
// lines inside of the table
@@ -302,7 +302,7 @@ void TableWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
rRenderContext.SetLineColor(aLineColor);
rRenderContext.SetFillColor(aBackgroundColor);
- rRenderContext.DrawRect(Rectangle(nTextX - 2 * nTipBorder,
+ rRenderContext.DrawRect(tools::Rectangle(nTextX - 2 * nTipBorder,
nTextY - 2 * nTipBorder,
nTextX + aTextSize.Width() + nTipBorder,
nTextY + aTextSize.Height() + nTipBorder));
@@ -345,7 +345,7 @@ void TableWindow::Update( long nNewCol, long nNewLine )
{
nCol = nNewCol;
nLine = nNewLine;
- Invalidate(Rectangle(mnTablePosX, mnTablePosY, mnTableWidth, mnTableHeight));
+ Invalidate(tools::Rectangle(mnTablePosX, mnTablePosY, mnTableWidth, mnTableHeight));
}
}
@@ -401,7 +401,7 @@ public:
virtual void MouseMove( const MouseEvent& rMEvt ) override;
virtual void MouseButtonDown( const MouseEvent& rMEvt ) override;
virtual void MouseButtonUp( const MouseEvent& rMEvt ) override;
- virtual void Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& ) override;
+ virtual void Paint( vcl::RenderContext& /*rRenderContext*/, const tools::Rectangle& ) override;
virtual void PopupModeEnd() override;
};
@@ -489,7 +489,7 @@ void ColumnsWindow::UpdateSize_Impl( long nNewCol )
if ( nNewCol > nWidth )
nNewCol = nWidth;
- Invalidate( Rectangle( 0, aWinSize.Height()-nTextHeight+2,
+ Invalidate( tools::Rectangle( 0, aWinSize.Height()-nTextHeight+2,
aWinSize.Width(), aWinSize.Height() ) );
SetOutputSizePixel( Size( nMX*nWidth-1, aWinSize.Height() ) );
}
@@ -497,7 +497,7 @@ void ColumnsWindow::UpdateSize_Impl( long nNewCol )
if ( nNewCol != nCol )
{
- Invalidate( Rectangle( 0, aWinSize.Height()-nTextHeight+2,
+ Invalidate( tools::Rectangle( 0, aWinSize.Height()-nTextHeight+2,
aWinSize.Width(), aWinSize.Height() ) );
long nMinCol = 0, nMaxCol = 0;
@@ -513,7 +513,7 @@ void ColumnsWindow::UpdateSize_Impl( long nNewCol )
nMaxCol = nNewCol;
}
- Invalidate( Rectangle( nMinCol*nMX-1, 0,
+ Invalidate( tools::Rectangle( nMinCol*nMX-1, 0,
nMaxCol*nMX+1, aWinSize.Height()-nTextHeight+2 ) );
nCol = nNewCol;
}
@@ -591,7 +591,7 @@ void ColumnsWindow::MouseButtonUp( const MouseEvent& rMEvt )
}
-void ColumnsWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
+void ColumnsWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
{
long i;
long nLineWidth;
@@ -610,7 +610,7 @@ void ColumnsWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
rRenderContext.SetFillColor(aFillColor);
}
- rRenderContext.DrawRect(Rectangle(i * nMX - 1, -1, i * nMX + nMX, aSize.Height() - nTextHeight + 1));
+ rRenderContext.DrawRect(tools::Rectangle(i * nMX - 1, -1, i * nMX + nMX, aSize.Height() - nTextHeight + 1));
long j = 4;
while (j < aSize.Height() - nTextHeight - 4)
@@ -635,19 +635,19 @@ void ColumnsWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangle&)
Size aTextSize(rRenderContext.GetTextWidth(aText), rRenderContext.GetTextHeight());
rRenderContext.DrawText(Point((aSize.Width() - aTextSize.Width()) / 2, aSize.Height() - nTextHeight + 2), aText);
- rRenderContext.DrawRect(Rectangle(0,
+ rRenderContext.DrawRect(tools::Rectangle(0,
aSize.Height() - nTextHeight + 2,
(aSize.Width() - aTextSize.Width()) / 2 - 1,
aSize.Height()));
- rRenderContext.DrawRect(Rectangle((aSize.Width() - aTextSize.Width()) / 2 + aTextSize.Width(),
+ rRenderContext.DrawRect(tools::Rectangle((aSize.Width() - aTextSize.Width()) / 2 + aTextSize.Width(),
aSize.Height() - nTextHeight + 2,
aSize.Width(),
aSize.Height()));
rRenderContext.SetLineColor(aLineColor);
rRenderContext.SetFillColor();
- rRenderContext.DrawRect(Rectangle( 0, 0, aSize.Width() - 1, aSize.Height() - nTextHeight + 1));
+ rRenderContext.DrawRect(tools::Rectangle( 0, 0, aSize.Width() - 1, aSize.Height() - nTextHeight + 1));
}
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index a4725bc0d533..c70d184c2810 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -174,8 +174,8 @@ private:
void ReleaseFocus();
static Color TestColorsVisible(const Color &FontCol, const Color &BackCol);
static void UserDrawEntry(const UserDrawEvent& rUDEvt, const OUString &rStyleName);
- void SetupEntry(vcl::RenderContext& rRenderContext, vcl::Window* pParent, sal_Int32 nItem, const Rectangle& rRect, const OUString& rStyleName, bool bIsNotSelected);
- static bool AdjustFontForItemHeight(OutputDevice* pDevice, Rectangle& rTextRect, long nHeight);
+ void SetupEntry(vcl::RenderContext& rRenderContext, vcl::Window* pParent, sal_Int32 nItem, const tools::Rectangle& rRect, const OUString& rStyleName, bool bIsNotSelected);
+ static bool AdjustFontForItemHeight(OutputDevice* pDevice, tools::Rectangle& rTextRect, long nHeight);
void SetOptimalSize();
DECL_LINK( MenuSelectHdl, Menu *, bool );
};
@@ -603,7 +603,7 @@ void SvxStyleBox_Impl::StateChanged( StateChangedType nStateChange )
}
}
-bool SvxStyleBox_Impl::AdjustFontForItemHeight(OutputDevice* pDevice, Rectangle& rTextRect, long nHeight)
+bool SvxStyleBox_Impl::AdjustFontForItemHeight(OutputDevice* pDevice, tools::Rectangle& rTextRect, long nHeight)
{
if (rTextRect.Bottom() > nHeight)
{
@@ -637,7 +637,7 @@ void SvxStyleBox_Impl::UserDrawEntry(const UserDrawEvent& rUDEvt, const OUString
// italics is present
const int nLeftDistance = 8;
- Rectangle aTextRect;
+ tools::Rectangle aTextRect;
pDevice->GetTextBoundRect(aTextRect, rStyleName);
Point aPos( rUDEvt.GetRect().TopLeft() );
@@ -649,7 +649,7 @@ void SvxStyleBox_Impl::UserDrawEntry(const UserDrawEvent& rUDEvt, const OUString
pDevice->DrawText(aPos, rStyleName);
}
-void SvxStyleBox_Impl::SetupEntry(vcl::RenderContext& rRenderContext, vcl::Window* pParent, sal_Int32 nItem, const Rectangle& rRect, const OUString& rStyleName, bool bIsNotSelected)
+void SvxStyleBox_Impl::SetupEntry(vcl::RenderContext& rRenderContext, vcl::Window* pParent, sal_Int32 nItem, const tools::Rectangle& rRect, const OUString& rStyleName, bool bIsNotSelected)
{
unsigned int nId = rRect.GetHeight() != 0 ? (rRect.getY() / rRect.GetHeight()) : MAX_STYLES_ENTRIES;
if (nItem == 0 || nItem == GetEntryCount() - 1)
@@ -813,7 +813,7 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt )
vcl::RenderContext *pDevice = rUDEvt.GetRenderContext();
pDevice->Push(PushFlags::FILLCOLOR | PushFlags::FONT | PushFlags::TEXTCOLOR);
- const Rectangle& rRect(rUDEvt.GetRect());
+ const tools::Rectangle& rRect(rUDEvt.GetRect());
bool bIsNotSelected = rUDEvt.GetItemId() != GetSelectEntryPos();
SetupEntry(*pDevice, rUDEvt.GetWindow(), nItem, rRect, aStyleName, bIsNotSelected);
@@ -836,7 +836,7 @@ IMPL_LINK(SvxStyleBox_Impl, CalcOptimalExtraUserWidth, VclWindowEvent&, event, v
for (sal_Int32 i = 0; i < nEntryCount; ++i)
{
OUString sStyleName(GetEntry(i));
- Rectangle aTextRectForDefaultFont;
+ tools::Rectangle aTextRectForDefaultFont;
GetTextBoundRect(aTextRectForDefaultFont, sStyleName);
const long nWidth = aTextRectForDefaultFont.GetWidth();
@@ -850,8 +850,8 @@ IMPL_LINK(SvxStyleBox_Impl, CalcOptimalExtraUserWidth, VclWindowEvent&, event, v
OUString sStyleName(GetEntry(i));
Push(PushFlags::FILLCOLOR | PushFlags::FONT | PushFlags::TEXTCOLOR);
- SetupEntry(*this /*FIXME rendercontext*/, this, i, Rectangle(0, 0, RECT_MAX, ITEM_HEIGHT), sStyleName, true);
- Rectangle aTextRectForActualFont;
+ SetupEntry(*this /*FIXME rendercontext*/, this, i, tools::Rectangle(0, 0, RECT_MAX, ITEM_HEIGHT), sStyleName, true);
+ tools::Rectangle aTextRectForActualFont;
GetTextBoundRect(aTextRectForActualFont, sStyleName);
if (AdjustFontForItemHeight(this, aTextRectForActualFont, ITEM_HEIGHT))
{
@@ -3262,7 +3262,7 @@ void SvxColorListBox::ShowPreview(const NamedColor &rColor)
VclPtr<VirtualDevice> xDevice = VclPtr<VirtualDevice>::Create();
xDevice->SetOutputSize(aImageSize);
- const Rectangle aRect(Point(0, 0), aImageSize);
+ const tools::Rectangle aRect(Point(0, 0), aImageSize);
if (m_bShowNoneButton && rColor.first == COL_NONE_COLOR)
{
const Color aW(COL_WHITE);
diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx b/svx/source/tbxctrls/tbxcolorupdate.cxx
index e452bc1aaedf..157b65db6318 100644
--- a/svx/source/tbxctrls/tbxcolorupdate.cxx
+++ b/svx/source/tbxctrls/tbxcolorupdate.cxx
@@ -95,7 +95,7 @@ namespace svx
long nWidth = std::min(aItemSize.Width(), aSource.GetSizePixel().Width());
long nHeight = std::min(aItemSize.Height(), aSource.GetSizePixel().Height());
- Rectangle aRect(Point(0, 0), Size(nWidth, nHeight));
+ tools::Rectangle aRect(Point(0, 0), Size(nWidth, nHeight));
aBmpEx.CopyPixel( aRect, aRect, &aSource );
@@ -149,9 +149,9 @@ namespace svx
if (maBmpSize.Width() == maBmpSize.Height())
// tdf#84985 align color bar with icon bottom edge; integer arithmetic e.g. 26 - 26/4 <> 26 * 3/4
- maUpdRect = Rectangle(Point( 0, maBmpSize.Height() - maBmpSize.Height() / 4), Size(maBmpSize.Width(), maBmpSize.Height() / 4));
+ maUpdRect = tools::Rectangle(Point( 0, maBmpSize.Height() - maBmpSize.Height() / 4), Size(maBmpSize.Width(), maBmpSize.Height() / 4));
else
- maUpdRect = Rectangle(Point( maBmpSize.Height() + 2, 2), Point(maBmpSize.Width() - 3, maBmpSize.Height() - 3));
+ maUpdRect = tools::Rectangle(Point( maBmpSize.Height() + 2, 2), Point(maBmpSize.Width() - 3, maBmpSize.Height() - 3));
pBmpAcc->DrawRect(maUpdRect);