diff options
author | Rishabh Kumar <kris.kr296@gmail.com> | 2016-07-20 23:03:37 +0530 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-07-21 06:20:44 +0000 |
commit | 45e9ccb69909fab6934f62b439962814ffa9d827 (patch) | |
tree | b4d6227c9ec2a4e6485ea7d0dec80805be29ad0e /svx | |
parent | a59b6be0850a68a1bb5d7099a004a86c0fcb6e40 (diff) |
Remove PatternLB dead code
PatternLB is replaced by SvxPresetListBox in tppattern.cxx
Change-Id: Ie4ec100963b714e07807f8b600cca2e165fb4641
Reviewed-on: https://gerrit.libreoffice.org/27353
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/dlgctrl.cxx | 133 |
1 files changed, 0 insertions, 133 deletions
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index cefcb4c2fb2b..a864a0a93cc2 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -1490,139 +1490,6 @@ void BitmapLB::Modify(const Size& rSize, const XBitmapEntry& rEntry, sal_Int32 n } } -// BitmapLB Constructor - -PatternLB::PatternLB( vcl::Window* pParent, WinBits aWB) -: ListBox( pParent, aWB ), - maBitmapEx(), - mpList(nullptr) -{ - SetEdgeBlending(true); -} - -VCL_BUILDER_DECL_FACTORY(PatternLB) -{ - WinBits nWinStyle = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE; - OString sBorder = VclBuilder::extractCustomProperty(rMap); - if (!sBorder.isEmpty()) - nWinStyle |= WB_BORDER; - VclPtrInstance<PatternLB> pListBox(pParent, nWinStyle); - pListBox->EnableAutoSize(true); - rRet = pListBox; -} - -namespace -{ - void formatPatternExToSize(BitmapEx& rBitmapEx, const Size& rSize) - { - if(!rBitmapEx.IsEmpty() && rSize.Width() > 0 && rSize.Height() > 0) - { - ScopedVclPtrInstance< VirtualDevice > pVirtualDevice; - pVirtualDevice->SetOutputSizePixel(rSize); - - if(rBitmapEx.IsTransparent()) - { - const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - - if(rStyleSettings.GetPreviewUsesCheckeredBackground()) - { - const Point aNull(0, 0); - static const sal_uInt32 nLen(8); - static const Color aW(COL_WHITE); - static const Color aG(0xef, 0xef, 0xef); - - pVirtualDevice->DrawCheckered(aNull, rSize, nLen, aW, aG); - } - else - { - pVirtualDevice->SetBackground(rStyleSettings.GetFieldColor()); - pVirtualDevice->Erase(); - } - } - - if(rBitmapEx.GetSizePixel().Width() >= rSize.Width() && rBitmapEx.GetSizePixel().Height() >= rSize.Height()) - { - rBitmapEx.Scale(rSize); - pVirtualDevice->DrawBitmapEx(Point(0, 0), rBitmapEx); - } - else - { - const Size aBitmapSize(rBitmapEx.GetSizePixel()); - - for(long y(0); y < rSize.Height(); y += aBitmapSize.Height()) - { - for(long x(0); x < rSize.Width(); x += aBitmapSize.Width()) - { - pVirtualDevice->DrawBitmapEx( - Point(x, y), - rBitmapEx); - } - } - } - - rBitmapEx = pVirtualDevice->GetBitmap(Point(0, 0), rSize); - } - } -} // end of anonymous namespace - -void PatternLB::Fill( const XPatternListRef &pList ) -{ - if( !pList.is() ) - return; - - mpList = pList; - XBitmapEntry* pEntry; - const long nCount(pList->Count()); - const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - const Size aSize(rStyleSettings.GetListBoxPreviewDefaultPixelSize()); - - SetUpdateMode(false); - - for(long i(0); i < nCount; i++) - { - pEntry = pList->GetBitmap(i); - maBitmapEx = pEntry->GetGraphicObject().GetGraphic().GetBitmapEx(); - formatPatternExToSize(maBitmapEx, aSize); - InsertEntry(pEntry->GetName(), Image(maBitmapEx)); - } - - AdaptDropDownLineCountToMaximum(); - SetUpdateMode(true); -} - -void PatternLB::Append(const Size& rSize, const XBitmapEntry& rEntry) -{ - maBitmapEx = rEntry.GetGraphicObject().GetGraphic().GetBitmapEx(); - - if(!maBitmapEx.IsEmpty()) - { - formatPatternExToSize(maBitmapEx, rSize); - InsertEntry(rEntry.GetName(), Image(maBitmapEx)); - } - else - { - InsertEntry(rEntry.GetName()); - } - - AdaptDropDownLineCountToMaximum(); -} - -void PatternLB::Modify(const Size& rSize, const XBitmapEntry& rEntry, sal_Int32 nPos) -{ - RemoveEntry(nPos); - maBitmapEx = rEntry.GetGraphicObject().GetGraphic().GetBitmapEx(); - - if(!maBitmapEx.IsEmpty()) - { - formatPatternExToSize(maBitmapEx, rSize); - InsertEntry(rEntry.GetName(), Image(maBitmapEx), nPos); - } - else - { - InsertEntry(rEntry.GetName()); - } -} - FillAttrLB::FillAttrLB(vcl::Window* pParent, WinBits aWB) : ColorListBox(pParent, aWB) { |