[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sw/inc sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Wed Sep 2 04:19:05 PDT 2015
sw/inc/drawdoc.hxx | 2 ++
sw/source/core/draw/drawdoc.cxx | 8 ++++++++
sw/source/uibase/shells/frmsh.cxx | 6 +-----
sw/source/uibase/shells/textsh.cxx | 7 +++++++
4 files changed, 18 insertions(+), 5 deletions(-)
New commits:
commit 55f0c2f416db716f0cccf1bb05625c264a78d9df
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Jul 31 09:15:14 2015 +0200
tdf#88986 sw: add missing XPropertyList pool items on TextFrame insertion
Regression from commit 6e61ecd09679a66060f932835622821d39e92f01 (Merge
back branch alg_writerframes to trunk, 2014-03-19), the problem was
while SwFrameShell::Execute() was modified to put the various pool items
related to fill types (colors, gradients, etc) to the item set of the
dialog, the same was missing in SwTextShell::ExecInsert(), so colors
were missing on inserting a new frame, but not when editing an existing
one.
(cherry picked from commit 6c3ca675509101732d3d878d6ceb6226026cd9ac)
Conflicts:
sw/inc/drawdoc.hxx
Change-Id: Id009f914c1c3b6509e31a4887e32a00624678cf4
Reviewed-on: https://gerrit.libreoffice.org/18232
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/inc/drawdoc.hxx b/sw/inc/drawdoc.hxx
index 2bc65c6..ddcf713 100644
--- a/sw/inc/drawdoc.hxx
+++ b/sw/inc/drawdoc.hxx
@@ -33,6 +33,8 @@ public:
const SwDoc& GetDoc() const { return *pDoc; }
SwDoc& GetDoc() { return *pDoc; }
+ /// Put needed items for XPropertyList entries from the DrawModel.
+ void PutAreaListItems(SfxItemSet& rSet) const;
virtual SdrPage* AllocPage(bool bMasterPage) SAL_OVERRIDE;
diff --git a/sw/source/core/draw/drawdoc.cxx b/sw/source/core/draw/drawdoc.cxx
index 149408b..8d312b3 100644
--- a/sw/source/core/draw/drawdoc.cxx
+++ b/sw/source/core/draw/drawdoc.cxx
@@ -150,4 +150,12 @@ uno::Reference< uno::XInterface > SwDrawModel::createUnoModel()
return xModel;
}
+void SwDrawModel::PutAreaListItems(SfxItemSet& rSet) const
+{
+ rSet.Put(SvxColorListItem(GetColorList(), SID_COLOR_TABLE));
+ rSet.Put(SvxGradientListItem(GetGradientList(), SID_GRADIENT_LIST));
+ rSet.Put(SvxHatchListItem(GetHatchList(), SID_HATCH_LIST));
+ rSet.Put(SvxBitmapListItem(GetBitmapList(), SID_BITMAP_LIST));
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index 8ba06c9..2b7450c 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -447,11 +447,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
//UUUU create needed items for XPropertyList entries from the DrawModel so that
// the Area TabPage can access them
const SwDrawModel* pDrawModel = rSh.GetView().GetDocShell()->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
-
- aSet.Put(SvxColorListItem(pDrawModel->GetColorList(), SID_COLOR_TABLE));
- aSet.Put(SvxGradientListItem(pDrawModel->GetGradientList(), SID_GRADIENT_LIST));
- aSet.Put(SvxHatchListItem(pDrawModel->GetHatchList(), SID_HATCH_LIST));
- aSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapList(), SID_BITMAP_LIST));
+ pDrawModel->PutAreaListItems(aSet);
const SwViewOption* pVOpt = rSh.GetViewOptions();
if(nSel & nsSelectionType::SEL_OLE)
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index 89f0871..ae19de5 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -114,6 +114,8 @@ using namespace ::com::sun::star;
#include <table.hrc>
#include <frmui.hrc>
#include <unomid.h>
+#include <IDocumentDrawModelAccess.hxx>
+#include <drawdoc.hxx>
#include <boost/scoped_ptr.hpp>
SFX_IMPL_INTERFACE(SwTextShell, SwBaseShell, SW_RES(STR_SHELLNAME_TEXT))
@@ -579,11 +581,16 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
FN_SET_FRM_NAME, FN_SET_FRM_NAME,
SID_HTML_MODE, SID_HTML_MODE,
+ SID_COLOR_TABLE, SID_BITMAP_LIST,
0
};
SfxItemSet aSet(GetPool(), aFrmAttrRange );
aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell())));
+
+ // For the Area tab page.
+ GetShell().GetDoc()->getIDocumentDrawModelAccess().GetDrawModel()->PutAreaListItems(aSet);
+
const SwRect &rPg = GetShell().GetAnyCurRect(RECT_PAGE);
SwFmtFrmSize aFrmSize(ATT_VAR_SIZE, rPg.Width(), rPg.Height());
aFrmSize.SetWhich(GetPool().GetWhich(SID_ATTR_PAGE_SIZE));
More information about the Libreoffice-commits
mailing list