cui/source/inc/cuitabarea.hxx | 1 extras/source/glade/libreoffice-catalog.xml.in | 11 -- include/svx/dlgctrl.hxx | 18 --- svx/source/dialog/dlgctrl.cxx | 133 ------------------------- 4 files changed, 163 deletions(-)
New commits: commit 45e9ccb69909fab6934f62b439962814ffa9d827 Author: Rishabh Kumar <[email protected]> Date: Wed Jul 20 23:03:37 2016 +0530 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 <[email protected]> Reviewed-by: Samuel Mehrbrodt <[email protected]> diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx index 881568a..46cb922 100644 --- a/cui/source/inc/cuitabarea.hxx +++ b/cui/source/inc/cuitabarea.hxx @@ -563,7 +563,6 @@ private: VclPtr<SvxPixelCtl> m_pCtlPixel; VclPtr<ColorLB> m_pLbColor; VclPtr<ColorLB> m_pLbBackgroundColor; - VclPtr<PatternLB> m_pLbPatterns; VclPtr<SvxPresetListBox> m_pPatternLB; VclPtr<SvxXRectPreview> m_pCtlPreview; VclPtr<PushButton> m_pBtnAdd; diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in index 4be35f2..10b3d02 100644 --- a/extras/source/glade/libreoffice-catalog.xml.in +++ b/extras/source/glade/libreoffice-catalog.xml.in @@ -150,17 +150,6 @@ </property> </properties> </glade-widget-class> - <glade-widget-class title="Pattern ListBox" name="svxlo-PatternLB" - generic-name="PatternListBox" parent="GtkComboBox" - icon-name="widget-gtk-combobox"> - <properties> - <property save="True" query="False" id="dropdown" default="True" name="Use DropDown"> - <parameter-spec> - <type>GParamBoolean</type> - </parameter-spec> - </property> - </properties> - </glade-widget-class> <glade-widget-class title="Font Name ListBox" name="svtlo-FontNameBox" generic-name="Font name ListBox" parent="GtkComboBox" icon-name="widget-gtk-combobox"> diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx index 92b656c..e32bfc1 100644 --- a/include/svx/dlgctrl.hxx +++ b/include/svx/dlgctrl.hxx @@ -270,24 +270,6 @@ private: /************************************************************************/ -class SAL_WARN_UNUSED SVX_DLLPUBLIC PatternLB : public ListBox -{ -public: - explicit PatternLB(vcl::Window* pParent, WinBits aWB); - - void Fill(const XPatternListRef &pList); - - void Append(const Size& rSize, const XBitmapEntry& rEntry); - void Modify(const Size& rSize, const XBitmapEntry& rEntry, sal_Int32 nPos); - -private: - BitmapEx maBitmapEx; - - XPatternListRef mpList; -}; - -/************************************************************************/ - class SAL_WARN_UNUSED SVX_DLLPUBLIC FillAttrLB : public ColorListBox { private: diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index cefcb4c..a864a0a 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) { _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
