summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2018-07-06 01:42:20 -0800
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2018-11-05 08:45:18 +0100
commit0dfb0f09f5582a33d16c5ad8659fab198d530b31 (patch)
tree8a651f0a9ad81004d85626b88c13d43e2c49aad9 /sc
parentd9013f6a3961c8651ca3d024acef67428884726e (diff)
tdf#105225 new background tab page
This patch allows the new background/highlighting tab page and derived from area tab page to work correctly in the same tab dialog. It also provides a cleaner way to use the new background tab page by setting brush item as fill attributes to target set in the background tab page created method. Previously if the new background tab page and the area tab page were used in the same tab page dialog one would affect the other due to the same use of pool fill items. This patch makes a local copy of the attribute item set passed and then passes that set along to the parent class area tab page on each activation/deactivation. Tab page dialogs that use both the background and area tab pages are: Writer Paragraph Styles, Impress Presentations Styles and Drawing/ Graphics Styles, and Draw Drawing/Graphics Styles. All new background tab page merged patches have been reworked in this patch and remaining old background tab pages, with the exception of Report Design, have been replaced by the new tab page. Change-Id: I47f9ae10a0fd967729ff6e83c1a312aa49e1d13c Reviewed-on: https://gerrit.libreoffice.org/57102 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/attrdlg/attrdlg.cxx4
-rw-r--r--sc/source/ui/docshell/docsh4.cxx3
-rw-r--r--sc/source/ui/styleui/styledlg.cxx8
-rw-r--r--sc/source/ui/view/formatsh.cxx3
-rw-r--r--sc/source/ui/view/tabvwsha.cxx4
5 files changed, 16 insertions, 6 deletions
diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx
index d49b0ea01d08..be163f7d03cc 100644
--- a/sc/source/ui/attrdlg/attrdlg.cxx
+++ b/sc/source/ui/attrdlg/attrdlg.cxx
@@ -82,6 +82,10 @@ void ScAttrDlg::PageCreated(const OString& rPageId, SfxTabPage& rTabPage)
aSet.Put (SvxFontListItem(static_cast<const SvxFontListItem*>(pInfoItem)->GetFontList(), SID_ATTR_CHAR_FONTLIST ));
rTabPage.PageCreated(aSet);
}
+ else if (rPageId == "background")
+ {
+ rTabPage.PageCreated(aSet);
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 56dde155c812..b24470891f00 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -117,6 +117,8 @@ using namespace ::com::sun::star;
#include <sfx2/notebookbar/SfxNotebookBar.hxx>
#include <helpids.h>
+#include <svx/xdef.hxx>
+
void ScDocShell::ReloadAllLinks()
{
m_aDocument.SetLinkFormulaNeedingCheck(false);
@@ -1689,6 +1691,7 @@ void ScDocShell::ExecutePageStyle( const SfxViewShell& rCaller,
aOldData.InitFromStyle( pStyleSheet );
SfxItemSet& rStyleSet = pStyleSheet->GetItemSet();
+ rStyleSet.MergeRange( XATTR_FILL_FIRST, XATTR_FILL_LAST );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
diff --git a/sc/source/ui/styleui/styledlg.cxx b/sc/source/ui/styleui/styledlg.cxx
index 2315186b75c7..f0b261841650 100644
--- a/sc/source/ui/styleui/styledlg.cxx
+++ b/sc/source/ui/styleui/styledlg.cxx
@@ -56,7 +56,7 @@ ScStyleDlg::ScStyleDlg(weld::Window* pParent,
{
AddTabPage("page", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ) );
AddTabPage("borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
- AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
+ AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BKG ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
AddTabPage("header", &ScHeaderPage::Create, &ScHeaderPage::GetRanges );
AddTabPage("footer", &ScFooterPage::Create, &ScFooterPage::GetRanges );
AddTabPage("sheet", &ScTablePage::Create, &ScTablePage::GetRanges );
@@ -75,7 +75,7 @@ ScStyleDlg::ScStyleDlg(weld::Window* pParent,
else
RemoveTabPage("asiantypo");
AddTabPage("borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ));
- AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ));
+ AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BKG ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ));
AddTabPage("protection", &ScTabPageProtection::Create, &ScTabPageProtection::GetRanges);
}
}
@@ -126,6 +126,10 @@ void ScStyleDlg::PageCreated(const OString& rPageId, SfxTabPage& rTabPage)
aSet.Put (SvxFontListItem(static_cast<const SvxFontListItem&>(*pInfoItem).GetFontList(), SID_ATTR_CHAR_FONTLIST));
rTabPage.PageCreated(aSet);
}
+ else if (rPageId == "background")
+ {
+ rTabPage.PageCreated(aSet);
+ }
}
}
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 0ee2c0e65925..7868e43b1d81 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -842,6 +842,9 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
pTabViewShell->SetInFormatDialog(true);
+ SfxItemSet& rStyleSet = pStyleSheet->GetItemSet();
+ rStyleSet.MergeRange( XATTR_FILL_FIRST, XATTR_FILL_LAST );
+
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
pDlg.disposeAndReset(pFact->CreateScStyleDlg(rReq.GetFrameWeld(), *pStyleSheet, bPage));
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 963cad98983f..93ca656d4059 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -484,10 +484,6 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName
pOldSet->MergeRange(XATTR_FILLSTYLE, XATTR_FILLCOLOR);
- sal_uInt16 nWhich = pOldSet->GetPool()->GetWhich( SID_ATTR_BRUSH );
- SvxBrushItem aBrushItem(static_cast<const SvxBrushItem&>(pOldSet->Get(nWhich)));
- setSvxBrushItemAsFillAttributesToTargetSet(aBrushItem, *pOldSet);
-
pOldSet->MergeRange(SID_ATTR_BORDER_STYLES, SID_ATTR_BORDER_DEFAULT_WIDTH);
// We only allow these border line types.