cui/source/dialogs/sdrcelldlg.cxx |    2 +
 cui/source/inc/cuitabarea.hxx     |    8 +++--
 cui/source/inc/sdrcelldlg.hxx     |    1 
 cui/source/tabpages/backgrnd.cxx  |   20 -------------
 cui/source/tabpages/tparea.cxx    |    1 
 cui/source/tabpages/tpcolor.cxx   |   46 +++++++++++++------------------
 include/svx/xtable.hxx            |    1 
 include/vcl/ctrl.hxx              |    2 -
 include/vcl/window.hxx            |    2 -
 svx/source/xoutdev/xtabcolr.cxx   |   13 ++++++++
 vcl/source/control/ctrl.cxx       |   18 ------------
 vcl/source/window/paint.cxx       |   55 +++++++++++++++++++++++++++++++++-----
 12 files changed, 91 insertions(+), 78 deletions(-)

New commits:
commit dc6b1c2329bb744fb5e8c33749dcff34553645da
Author: Tamás Zolnai <tamas.zol...@collabora.com>
Date:   Sat Feb 10 17:31:44 2018 +0100

    lokdialog: Render non-pixel based preview windows
    
    PaintToDevice() method was designed for pixel based windows,
    now I added some scaling to handle different units.
    
    Reviewed-on: https://gerrit.libreoffice.org/49543
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com>
    (cherry picked from commit d6a2dc03806c4e7c0be8e4f2aee272f036f4765e)
    Signed-off-by: Andras Timar <andras.ti...@collabora.com>
    
    Change-Id: Id242c44101c1e842409ba3a9b13291e48bdd44ca

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index 54341c5e4039..d88e04823ed8 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1229,7 +1229,7 @@ void Window::LogicInvalidate(const Rectangle* pRectangle)
     // Added for dialog items. Pass invalidation to the parent window.
     else if (VclPtr<vcl::Window> pParent = GetParentWithLOKNotifier())
     {
-        const tools::Rectangle aRect(Point(GetOutOffXPixel(), 
GetOutOffYPixel()), Size(GetOutputWidthPixel(), GetOutputHeightPixel()));
+        const Rectangle aRect(Point(GetOutOffXPixel(), GetOutOffYPixel()), 
Size(GetOutputWidthPixel(), GetOutputHeightPixel()));
         pParent->LogicInvalidate(&aRect);
     }
 }
@@ -1356,9 +1356,29 @@ void Window::ImplPaintToDevice( OutputDevice* 
i_pTargetOutDev, const Point& i_rP
     bool bOutput = IsOutputEnabled();
     EnableOutput();
 
+    double fScaleX = 1;
+    double fScaleY = 1;
+    bool bNeedsScaling = false;
+    if(comphelper::LibreOfficeKit::isActive())
+    {
+        if(GetMapMode().GetMapUnit() != MapUnit::MapPixel &&
+        // Some of the preview windows (SvxPreviewBase) uses different 
painting (drawinglayer primitives)
+        // For these preview we don't need to scale even tough the unit is not 
pixel.
+        GetMapMode().GetMapUnit() != MapUnit::Map100thMM)
+        {
+            bNeedsScaling = true;
+            // 1000.0 is used to reduce rounding imprecision (Size uses 
integers)
+            Size aLogicSize = PixelToLogic(Size(1000.0, 1000.0));
+            fScaleX = aLogicSize.Width() / 1000.0;
+            fScaleY = aLogicSize.Height() / 1000.0;
+        }
+    }
+    else
+    {   // TODO: Above scaling was added for LOK only, would be good to check 
how it works in other use cases
     SAL_WARN_IF( GetMapMode().GetMapUnit() != MapUnit::MapPixel, "vcl", 
"MapMode must be PIXEL based" );
-    if ( GetMapMode().GetMapUnit() != MapUnit::MapPixel )
-        return;
+        if ( GetMapMode().GetMapUnit() != MapUnit::MapPixel )
+            return;
+    }
 
     // preserve graphicsstate
     Push();
@@ -1408,7 +1428,17 @@ void Window::ImplPaintToDevice( OutputDevice* 
i_pTargetOutDev, const Point& i_rP
         SetRefPoint();
     SetLayoutMode( GetLayoutMode() );
     SetDigitLanguage( GetDigitLanguage() );
-    Rectangle aPaintRect( Point( 0, 0 ), GetOutputSizePixel() );
+
+    Rectangle aPaintRect;
+    if(bNeedsScaling)
+    {
+        aPaintRect = Rectangle( Point( 0, 0 ),
+            Size(GetOutputSizePixel().Width() * fScaleX, 
GetOutputSizePixel().Height() * fScaleY)  );
+    }
+    else
+    {
+        aPaintRect = Rectangle( Point( 0, 0 ), GetOutputSizePixel() );
+    }
     aClipRegion.Intersect( aPaintRect );
     SetClipRegion( aClipRegion );
 
@@ -1416,7 +1446,11 @@ void Window::ImplPaintToDevice( OutputDevice* 
i_pTargetOutDev, const Point& i_rP
 
     // background
     if( ! IsPaintTransparent() && IsBackground() && ! (GetParentClipMode() & 
ParentClipMode::NoClip ) )
+    {
         Erase(*this);
+        if(bNeedsScaling)
+            aMtf.Scale(fScaleX, fScaleY);
+    }
     // foreground
     Paint(*this, aPaintRect);
     // put a pop action to metafile
@@ -1430,11 +1464,14 @@ void Window::ImplPaintToDevice( OutputDevice* 
i_pTargetOutDev, const Point& i_rP
     VclPtrInstance<VirtualDevice> pMaskedDevice(*i_pTargetOutDev,
                                                 DeviceFormat::DEFAULT,
                                                 DeviceFormat::DEFAULT);
+
+    if(bNeedsScaling)
+        pMaskedDevice->SetMapMode( GetMapMode() );
     pMaskedDevice->SetOutputSizePixel( GetOutputSizePixel() );
     pMaskedDevice->EnableRTL( IsRTLEnabled() );
     aMtf.WindStart();
     aMtf.Play( pMaskedDevice );
-    BitmapEx aBmpEx( pMaskedDevice->GetBitmapEx( Point( 0, 0 ), 
pMaskedDevice->GetOutputSizePixel() ) );
+    BitmapEx aBmpEx( pMaskedDevice->GetBitmapEx( Point( 0, 0 ), 
aPaintRect.GetSize() ) );
     i_pTargetOutDev->DrawBitmapEx( i_rPos, aBmpEx );
     // get rid of virtual device now so they don't pile up during recursive 
calls
     pMaskedDevice.disposeAndClear();
@@ -1467,8 +1504,6 @@ void Window::ImplPaintToDevice( OutputDevice* 
i_pTargetOutDev, const Point& i_rP
 
 void Window::PaintToDevice( OutputDevice* pDev, const Point& rPos, const Size& 
/*rSize*/ )
 {
-    // FIXME: scaling: currently this is for pixel copying only
-
     SAL_WARN_IF(  pDev->HasMirroredGraphics(), "vcl", "PaintToDevice to 
mirroring graphics" );
     SAL_WARN_IF(  pDev->IsRTLEnabled(), "vcl", "PaintToDevice to mirroring 
device" );
 
commit 1c5ba7f055f8dc9f2ff081ad0e8509a18e74c61c
Author: Tamás Zolnai <tamas.zol...@collabora.com>
Date:   Sat Feb 10 13:24:21 2018 +0100

    lokdialog: Handle dialog items' invalidation in general
    
    Reviewed-on: https://gerrit.libreoffice.org/49240
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Tamás Zolnai <tamas.zol...@collabora.com>
    (cherry picked from commit b33287cde2d270d83e2658529be768a99dba98f0)
    Signed-off-by: Andras Timar <andras.ti...@collabora.com>
    
    Change-Id: Ib7b178fe97964bc5fd6ac173a143ba8ba089e237

diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index ed04e696199c..8fd4f9337850 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -163,7 +163,6 @@ protected:
     virtual void    Paint( vcl::RenderContext& /*rRenderContext*/, const 
Rectangle& rRect ) override;
     virtual void    DataChanged( const DataChangedEvent& rDCEvt ) override;
     virtual void    Resize() override;
-    virtual void    LogicInvalidate(const Rectangle* pRectangle) override;
 
 private:
 
@@ -325,25 +324,6 @@ void BackgroundPreviewImpl::DataChanged( const 
DataChangedEvent& rDCEvt )
     Window::DataChanged( rDCEvt );
 }
 
-
-void BackgroundPreviewImpl::LogicInvalidate(const Rectangle* /*pRectangle*/)
-{
-    // Invalidate the container dialog or floating window
-    // The code is same as in Control::LogicInvalidate() method
-    if (comphelper::LibreOfficeKit::isActive() && 
!comphelper::LibreOfficeKit::isDialogPainting())
-    {
-        if (VclPtr<vcl::Window> pParent = GetParentWithLOKNotifier())
-        {
-            // invalidate the complete floating window for now
-            if (pParent->ImplIsFloatingWindow())
-                return pParent->LogicInvalidate(nullptr);
-
-            const Rectangle aRect(Point(GetOutOffXPixel(), GetOutOffYPixel()), 
Size(GetOutputWidthPixel(), GetOutputHeightPixel()));
-            pParent->LogicInvalidate(&aRect);
-        }
-    }
-}
-
 #define HDL(hdl) LINK(this,SvxBackgroundTabPage,hdl)
 
 SvxBackgroundTabPage::SvxBackgroundTabPage(vcl::Window* pParent, const 
SfxItemSet& rCoreSet)
diff --git a/include/vcl/ctrl.hxx b/include/vcl/ctrl.hxx
index c9768a653a50..63fb36c87a1a 100644
--- a/include/vcl/ctrl.hxx
+++ b/include/vcl/ctrl.hxx
@@ -44,8 +44,6 @@ private:
 
     SAL_DLLPRIVATE void     ImplInitControlData();
 
-    virtual void            LogicInvalidate(const Rectangle* pRectangle) 
override;
-
                             Control (const Control &) = delete;
                             Control & operator= (const Control &) = delete;
 
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index dcdaddc75c12..7f15b5dac267 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -560,7 +560,7 @@ public:
 
     SAL_DLLPRIVATE bool                 ImplIsWindowOrChild( const 
vcl::Window* pWindow, bool bSystemWindow = false ) const;
     SAL_DLLPRIVATE bool                 ImplIsChild( const vcl::Window* 
pWindow, bool bSystemWindow = false ) const;
-                   bool                 ImplIsFloatingWindow() const;
+    SAL_DLLPRIVATE bool                 ImplIsFloatingWindow() const;
     SAL_DLLPRIVATE bool                 ImplIsPushButton() const;
     SAL_DLLPRIVATE bool                 ImplIsSplitter() const;
     SAL_DLLPRIVATE bool                 ImplIsOverlapWindow() const;
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index 15c3a4ea61cf..007b430f580f 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -415,24 +415,6 @@ void Control::ImplInitSettings(const bool, const bool)
     ApplySettings(*this);
 }
 
-void Control::LogicInvalidate(const Rectangle* /*pRectangle*/)
-{
-    // Several repaint, resize invalidations are emitted when we are painting,
-    // ignore all of those
-    if (comphelper::LibreOfficeKit::isActive() && 
!comphelper::LibreOfficeKit::isDialogPainting())
-    {
-        if (VclPtr<vcl::Window> pParent = GetParentWithLOKNotifier())
-        {
-            // invalidate the complete floating window for now
-            if (pParent->ImplIsFloatingWindow())
-                return pParent->LogicInvalidate(nullptr);
-
-            const Rectangle aRect(Point(GetOutOffXPixel(), GetOutOffYPixel()), 
Size(GetOutputWidthPixel(), GetOutputHeightPixel()));
-            pParent->LogicInvalidate(&aRect);
-        }
-    }
-}
-
 Rectangle Control::DrawControlText( OutputDevice& _rTargetDevice, const 
Rectangle& rRect, const OUString& _rStr,
     DrawTextFlags _nStyle, MetricVector* _pVector, OUString* _pDisplayText, 
const Size* i_pDeviceSize ) const
 {
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index a3fe6a6612b3..54341c5e4039 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1214,7 +1214,7 @@ void Window::Invalidate( const vcl::Region& rRegion, 
InvalidateFlags nFlags )
 
 void Window::LogicInvalidate(const Rectangle* pRectangle)
 {
-    if (comphelper::LibreOfficeKit::isDialogPainting())
+    if (comphelper::LibreOfficeKit::isDialogPainting() || 
!comphelper::LibreOfficeKit::isActive())
         return;
 
     if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
@@ -1226,6 +1226,12 @@ void Window::LogicInvalidate(const Rectangle* pRectangle)
 
         pNotifier->notifyWindow(GetLOKWindowId(), "invalidate", aPayload);
     }
+    // Added for dialog items. Pass invalidation to the parent window.
+    else if (VclPtr<vcl::Window> pParent = GetParentWithLOKNotifier())
+    {
+        const tools::Rectangle aRect(Point(GetOutOffXPixel(), 
GetOutOffYPixel()), Size(GetOutputWidthPixel(), GetOutputHeightPixel()));
+        pParent->LogicInvalidate(&aRect);
+    }
 }
 
 void Window::Validate()
commit d319b8ea37122b494992c76fd9dc890b95e48e01
Author: Katarina Behrens <katarina.behr...@cib.de>
Date:   Thu Feb 16 22:29:10 2017 +0100

    tdf#103224: Get the initial colour right
    
    Change-Id: I59309f5b433eb7aa92d05ce7d373d69cb413b258
    Reviewed-on: https://gerrit.libreoffice.org/34383
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Katarina Behrens <katarina.behr...@cib.de>
    (cherry picked from commit f35e6f2504384ad66b475d39849ed10987b2da53)
    Signed-off-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index dd941f844e28..fd11015ad623 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -734,7 +734,6 @@ private:
     XColorListRef         pColorList;
 
     ChangeType*         pnColorListState;
-    sal_Int32*          pPos;
 
     XFillStyleItem      aXFStyleItem;
     XFillColorItem      aXFillColorItem;
@@ -754,6 +753,7 @@ private:
 
     void ImpColorCountChanged();
     void FillPaletteLB();
+    long FindColorInPalette(const OUString& rPaletteName) const;
 
     DECL_LINK( ClickAddHdl_Impl, Button*, void );
     DECL_LINK( ClickWorkOnHdl_Impl, Button*, void );
@@ -766,11 +766,14 @@ private:
     void SetColorModel(ColorModel eModel);
     void ChangeColorModel();
     void UpdateColorValues( bool bUpdatePreset = true );
-    static sal_Int32 SearchColorList(OUString const & aColorName);
     DECL_LINK( ModifiedHdl_Impl, Edit&, void );
 
     void UpdateModified();
     css::uno::Reference< css::uno::XComponentContext > m_context;
+
+    static sal_Int32 FindInCustomColors( OUString const & aColorName );
+    sal_Int32 FindInPalette( const Color& rColor );
+
 public:
     SvxColorTabPage( vcl::Window* pParent, const SfxItemSet& rInAttrs );
     virtual ~SvxColorTabPage() override;
@@ -786,7 +789,6 @@ public:
     virtual DeactivateRC DeactivatePage( SfxItemSet* pSet ) override;
 
     void    SetPropertyList( XPropertyListType t, const XPropertyListRef &xRef 
);
-    void    SetPos( sal_Int32* pInPos ) { pPos = pInPos; }
     void    SetColorList( const XColorListRef& pColList );
 
 
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index f2a054df2e55..d2e358c21ef7 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -401,7 +401,6 @@ void SvxAreaTabPage::CreatePage( sal_Int32 nId, SfxTabPage* 
pTab )
     if(nId == SOLID )
     {
         static_cast<SvxColorTabPage*>(pTab)->SetColorList( m_pColorList );
-        static_cast<SvxColorTabPage*>(pTab)->SetPos( &m_nPos );
         static_cast<SvxColorTabPage*>(pTab)->SetColorChgd( m_pnColorListState 
);
         static_cast<SvxColorTabPage*>(pTab)->Construct();
         static_cast<SvxColorTabPage*>(pTab)->ActivatePage( m_rXFSet );
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index e4545b497d6e..62a1515d3f5d 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -59,7 +59,6 @@ SvxColorTabPage::SvxColorTabPage(vcl::Window* pParent, const 
SfxItemSet& rInAttr
     , rOutAttrs           ( rInAttrs )
     // All the horrific pointers we store and should not
     , pnColorListState( nullptr )
-    , pPos( nullptr )
     , aXFStyleItem( drawing::FillStyle_SOLID )
     , aXFillColorItem( OUString(), Color( COL_BLACK ) )
     , aXFillAttr( rInAttrs.GetPool() )
@@ -239,38 +238,26 @@ void SvxColorTabPage::ActivatePage( const SfxItemSet& )
 {
     if( pColorList.is() )
     {
-        if( *pPos != LISTBOX_ENTRY_NOTFOUND )
+        const SfxPoolItem* pPoolItem = nullptr;
+        if( SfxItemState::SET == rOutAttrs.GetItemState( GetWhich( 
XATTR_FILLCOLOR ), true, &pPoolItem ) )
         {
-            m_pValSetColorList->SelectItem( m_pValSetColorList->GetItemId( 
static_cast<size_t>(*pPos) ) );
-            const XColorEntry* pEntry = pColorList->GetColor(*pPos);
-            aPreviousColor = pEntry->GetColor();
-            ChangeColor(pEntry->GetColor());
-        }
-        else if( *pPos == LISTBOX_ENTRY_NOTFOUND )
-        {
-            const SfxPoolItem* pPoolItem = nullptr;
-            if( SfxItemState::SET == rOutAttrs.GetItemState( GetWhich( 
XATTR_FILLCOLOR ), true, &pPoolItem ) )
-            {
-                SetColorModel( ColorModel::RGB );
-                ChangeColorModel();
+            SetColorModel( ColorModel::RGB );
+            ChangeColorModel();
 
-                aPreviousColor = static_cast<const 
XFillColorItem*>(pPoolItem)->GetColorValue();
-                ChangeColor( aPreviousColor );
+            const Color aColor = static_cast<const 
XFillColorItem*>(pPoolItem)->GetColorValue();
+            ChangeColor( aColor );
+            sal_Int32 nPos = FindInPalette( aColor );
 
-                m_pRcustom->SetValue( ColorToPercent_Impl( 
aCurrentColor.GetRed() ) );
-                m_pGcustom->SetValue( ColorToPercent_Impl( 
aCurrentColor.GetGreen() ) );
-                m_pBcustom->SetValue( ColorToPercent_Impl( 
aCurrentColor.GetBlue() ) );
-                m_pHexcustom->SetColor( aCurrentColor.GetColor() );
+            if ( nPos != -1 )
+                m_pValSetColorList->SelectItem( m_pValSetColorList->GetItemId( 
nPos ) );
+            // else search in other palettes?
 
-            }
         }
 
         m_pCtlPreviewOld->SetAttributes( aXFillAttr.GetItemSet() );
         m_pCtlPreviewOld->Invalidate();
 
         SelectValSetHdl_Impl( m_pValSetColorList );
-
-        *pPos = LISTBOX_ENTRY_NOTFOUND;
     }
 }
 
@@ -374,7 +361,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, Button*, 
void)
     while (!bValidColorName)
     {
         aName = aNewName + " " + OUString::number( j++ );
-        bValidColorName = (SearchColorList(aName) == LISTBOX_ENTRY_NOTFOUND);
+        bValidColorName = (FindInCustomColors(aName) == 
LISTBOX_ENTRY_NOTFOUND);
     }
 
     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
@@ -386,7 +373,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, Button*, 
void)
     {
         pDlg->GetName( aName );
 
-        bValidColorName = (SearchColorList(aName) == LISTBOX_ENTRY_NOTFOUND);
+        bValidColorName = (FindInCustomColors(aName) == 
LISTBOX_ENTRY_NOTFOUND);
         if (bValidColorName)
         {
             nError = 0;
@@ -662,7 +649,7 @@ void SvxColorTabPage::UpdateColorValues( bool bUpdatePreset 
)
     }
 }
 
-sal_Int32 SvxColorTabPage::SearchColorList(OUString const & aColorName)
+sal_Int32 SvxColorTabPage::FindInCustomColors(OUString const & aColorName)
 {
     css::uno::Sequence< OUString > 
aCustomColorNameList(officecfg::Office::Common::UserColors::CustomColorName::get());
     long nCount = aCustomColorNameList.getLength();
@@ -680,6 +667,13 @@ sal_Int32 SvxColorTabPage::SearchColorList(OUString const 
& aColorName)
     return nPos;
 }
 
+sal_Int32 SvxColorTabPage::FindInPalette( const Color& rColor )
+{
+    sal_Int32 nPos = pColorList->GetIndexOfColor( rColor );
+
+    return ( nPos == -1) ? LISTBOX_ENTRY_NOTFOUND : nPos;
+}
+
 // A RGB value is converted to a CMYK value - not in an ideal way as
 // R is converted into C, G into M and B into Y. The K value is held in an
 // extra variable. For further color models one should develop own
diff --git a/include/svx/xtable.hxx b/include/svx/xtable.hxx
index 1d781b970495..6039e151af3a 100644
--- a/include/svx/xtable.hxx
+++ b/include/svx/xtable.hxx
@@ -267,6 +267,7 @@ public:
 
     void Replace(long nIndex, std::unique_ptr<XColorEntry> pEntry);
     XColorEntry* GetColor(long nIndex) const;
+    long GetIndexOfColor( const Color& rColor) const;
     virtual css::uno::Reference< css::container::XNameContainer > 
createInstance() override;
     virtual bool Create() override;
 
diff --git a/svx/source/xoutdev/xtabcolr.cxx b/svx/source/xoutdev/xtabcolr.cxx
index 374f6fc9a6cb..44f881403580 100644
--- a/svx/source/xoutdev/xtabcolr.cxx
+++ b/svx/source/xoutdev/xtabcolr.cxx
@@ -157,4 +157,17 @@ Bitmap XColorList::CreateBitmapForUI( long /*nIndex*/ )
     return Bitmap();
 }
 
+long XColorList::GetIndexOfColor( const Color& rColor ) const
+{
+    for( long i = 0, n = maList.size(); i < n; ++i )
+    {
+        const Color aColor = static_cast<XColorEntry*>( maList[i].get() 
)->GetColor();
+
+        if (aColor == rColor )
+            return i;
+    }
+
+    return -1;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 0924f4049ca5081665e43fdadcf9d6452295c049
Author: Tamás Zolnai <tamas.zol...@collabora.com>
Date:   Wed Feb 7 15:54:41 2018 +0100

    tdf#115506: Crash when trying to set pattern fill for tables in Impress
    
    Setting pattern list was missed in this specific dialog.
    
    Change-Id: I9f47e9e0dd4f99bf5403c70685508b0f14a5bd61
    Reviewed-on: https://gerrit.libreoffice.org/49361
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>
    Tested-by: Jenkins <c...@libreoffice.org>
    (cherry picked from commit de8a1b4f6c8fcca9fc9cc5ad83c393ecd7292f76)
    Signed-off-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/cui/source/dialogs/sdrcelldlg.cxx 
b/cui/source/dialogs/sdrcelldlg.cxx
index d6e9244cb738..160477c157b9 100644
--- a/cui/source/dialogs/sdrcelldlg.cxx
+++ b/cui/source/dialogs/sdrcelldlg.cxx
@@ -34,6 +34,7 @@ SvxFormatCellsDialog::SvxFormatCellsDialog( vcl::Window* 
pParent, const SfxItemS
     , mpGradientList(pModel->GetGradientList())
     , mpHatchingList(pModel->GetHatchList())
     , mpBitmapList(pModel->GetBitmapList())
+    , mpPatternList(pModel->GetPatternList())
     , m_nAreaPageId(0)
 {
     AddTabPage("name", RID_SVXPAGE_CHAR_NAME);
@@ -51,6 +52,7 @@ void SvxFormatCellsDialog::PageCreated( sal_uInt16 nId, 
SfxTabPage &rPage )
         rAreaPage.SetGradientList( mpGradientList );
         rAreaPage.SetHatchingList( mpHatchingList );
         rAreaPage.SetBitmapList( mpBitmapList );
+        rAreaPage.SetPatternList( mpPatternList );;
         rAreaPage.ActivatePage( mrOutAttrs );
     }
     else if (nId == m_nBorderPageId)
diff --git a/cui/source/inc/sdrcelldlg.hxx b/cui/source/inc/sdrcelldlg.hxx
index f5939979b96d..6b41e69fc8b3 100644
--- a/cui/source/inc/sdrcelldlg.hxx
+++ b/cui/source/inc/sdrcelldlg.hxx
@@ -34,6 +34,7 @@ private:
     XGradientListRef    mpGradientList;
     XHatchListRef       mpHatchingList;
     XBitmapListRef      mpBitmapList;
+    XPatternListRef     mpPatternList;
 
     sal_uInt16          m_nAreaPageId;
     sal_uInt16          m_nBorderPageId;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to