Kaydet (Commit) 9a9218a7 authored tarafından Miklos Vajna's avatar Miklos Vajna Kaydeden (comit) Caolán McNamara

tdf#88986 sw: add missing XPropertyList pool items on TextFrame insertion

Regression from commit 6e61ecd0 (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.

Change-Id: Id009f914c1c3b6509e31a4887e32a00624678cf4
(cherry picked from commit 6c3ca675)
Reviewed-on: https://gerrit.libreoffice.org/17753Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 5d6c8958
...@@ -35,6 +35,8 @@ public: ...@@ -35,6 +35,8 @@ public:
const SwDoc& GetDoc() const { return *m_pDoc; } const SwDoc& GetDoc() const { return *m_pDoc; }
SwDoc& GetDoc() { return *m_pDoc; } SwDoc& GetDoc() { return *m_pDoc; }
/// Put needed items for XPropertyList entries from the DrawModel.
void PutAreaListItems(SfxItemSet& rSet) const;
virtual SdrPage* AllocPage(bool bMasterPage) SAL_OVERRIDE; virtual SdrPage* AllocPage(bool bMasterPage) SAL_OVERRIDE;
......
...@@ -151,4 +151,12 @@ uno::Reference< uno::XInterface > SwDrawModel::createUnoModel() ...@@ -151,4 +151,12 @@ uno::Reference< uno::XInterface > SwDrawModel::createUnoModel()
return xModel; 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: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -415,11 +415,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) ...@@ -415,11 +415,7 @@ void SwFrameShell::Execute(SfxRequest &rReq)
//UUUU create needed items for XPropertyList entries from the DrawModel so that //UUUU create needed items for XPropertyList entries from the DrawModel so that
// the Area TabPage can access them // the Area TabPage can access them
const SwDrawModel* pDrawModel = rSh.GetView().GetDocShell()->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel(); const SwDrawModel* pDrawModel = rSh.GetView().GetDocShell()->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
pDrawModel->PutAreaListItems(aSet);
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));
const SwViewOption* pVOpt = rSh.GetViewOptions(); const SwViewOption* pVOpt = rSh.GetViewOptions();
if(nSel & nsSelectionType::SEL_OLE) if(nSel & nsSelectionType::SEL_OLE)
......
...@@ -114,6 +114,8 @@ using namespace ::com::sun::star; ...@@ -114,6 +114,8 @@ using namespace ::com::sun::star;
#include <table.hrc> #include <table.hrc>
#include <frmui.hrc> #include <frmui.hrc>
#include <unomid.h> #include <unomid.h>
#include <IDocumentDrawModelAccess.hxx>
#include <drawdoc.hxx>
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
SFX_IMPL_INTERFACE(SwTextShell, SwBaseShell) SFX_IMPL_INTERFACE(SwTextShell, SwBaseShell)
...@@ -579,11 +581,16 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) ...@@ -579,11 +581,16 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
FN_SET_FRM_NAME, FN_SET_FRM_NAME, FN_SET_FRM_NAME, FN_SET_FRM_NAME,
SID_HTML_MODE, SID_HTML_MODE, SID_HTML_MODE, SID_HTML_MODE,
SID_COLOR_TABLE, SID_BITMAP_LIST,
0 0
}; };
SfxItemSet aSet(GetPool(), aFrmAttrRange ); SfxItemSet aSet(GetPool(), aFrmAttrRange );
aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell()))); 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); const SwRect &rPg = GetShell().GetAnyCurRect(RECT_PAGE);
SwFormatFrmSize aFrmSize(ATT_VAR_SIZE, rPg.Width(), rPg.Height()); SwFormatFrmSize aFrmSize(ATT_VAR_SIZE, rPg.Width(), rPg.Height());
aFrmSize.SetWhich(GetPool().GetWhich(SID_ATTR_PAGE_SIZE)); aFrmSize.SetWhich(GetPool().GetWhich(SID_ATTR_PAGE_SIZE));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment