summaryrefslogtreecommitdiffstats
path: root/cui/source
diff options
context:
space:
mode:
authorRishabh Kumar <kris.kr296@gmail.com>2016-08-23 01:08:41 +0530
committerKatarina Behrens <Katarina.Behrens@cib.de>2016-08-25 12:47:42 +0000
commit28da3aed71a4850f47156d717b6a18fce98154e9 (patch)
treedd932a04080910161f881caf973e6e9d8bd92cbe /cui/source
parentMissing operator definition (diff)
downloadcore-28da3aed71a4850f47156d717b6a18fce98154e9.tar.gz
core-28da3aed71a4850f47156d717b6a18fce98154e9.zip
[GSoC]Remove Colors entry from Options dialog
Change-Id: I6865bd159659d2386bf32876f5c65ac533522fbc Reviewed-on: https://gerrit.libreoffice.org/28330 Tested-by: Jenkins <ci@libreoffice.org> Tested-by: Yousuf Philips <philipz85@hotmail.com> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/inc/cuitabarea.hxx2
-rw-r--r--cui/source/inc/treeopt.hxx4
-rw-r--r--cui/source/options/treeopt.cxx56
-rw-r--r--cui/source/options/treeopt.src1
-rw-r--r--cui/source/tabpages/tpcolor.cxx48
5 files changed, 5 insertions, 106 deletions
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index 1c2afd77739b..0d65c261e691 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -821,8 +821,6 @@ public:
void SetColorList( const XColorListRef& pColList );
const XColorListRef& GetColorList() { return pColorList; }
- void SaveToViewFrame( SfxViewFrame *pViewFrame );
- void SetupForViewFrame( SfxViewFrame *pViewFrame );
void SetPageType( PageType* pInType ) { pPageType = pInType; }
void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }
diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx
index 35bff4e9d645..27c8510c8f84 100644
--- a/cui/source/inc/treeopt.hxx
+++ b/cui/source/inc/treeopt.hxx
@@ -137,10 +137,6 @@ private:
OUString sTitle;
OUString sNotLoadedError;
- // for the ColorTabPage
- SfxItemSet* pColorPageItemSet;
- VclPtr<SvxColorTabPage> mpColorPage;
-
bool bForgetSelection;
bool bIsFromExtensionManager;
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 4c4c62fd20f6..bab5d9408c23 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -121,8 +121,6 @@ LastPageSaver* OfaTreeOptionsDialog::pLastPageSaver = nullptr;
static const sal_Char* pViewOptDataName = "page data";
#define VIEWOPT_DATANAME OUString::createFromAscii( pViewOptDataName )
-static XOutdevItemPool* mpStaticXOutdevItemPool = nullptr;
-
static inline void SetViewOptUserItem( SvtViewOptions& rOpt, const OUString& rData )
{
rOpt.SetUserItem( VIEWOPT_DATANAME, makeAny( OUString( rData ) ) );
@@ -298,7 +296,6 @@ VclPtr<SfxTabPage> CreateGeneralTabPage( sal_uInt16 nId, vcl::Window* pParent, c
case RID_SFXPAGE_PRINTOPTIONS: fnCreate = &SfxCommonPrintOptionsTabPage::Create; break;
case OFA_TP_LANGUAGES: fnCreate = &OfaLanguagesTabPage::Create; break;
case RID_SFXPAGE_LINGU: fnCreate = &SvxLinguTabPage::Create; break;
- case RID_SVXPAGE_COLOR: fnCreate = &SvxColorTabPage::Create; break;
case OFA_TP_VIEW: fnCreate = &OfaViewTabPage::Create; break;
case OFA_TP_MISC: fnCreate = &OfaMiscTabPage::Create; break;
case OFA_TP_MEMORY: fnCreate = &OfaMemoryOptionsPage::Create; break;
@@ -349,7 +346,6 @@ static OptionsMapping_Impl const OptionsMap_Impl[] =
{ "ProductName", "View", OFA_TP_VIEW },
{ "ProductName", "Print", RID_SFXPAGE_PRINTOPTIONS },
{ "ProductName", "Paths", RID_SFXPAGE_PATH },
- { "ProductName", "Colors", RID_SVXPAGE_COLOR },
{ "ProductName", "Fonts", RID_SVX_FONT_SUBSTITUTION },
{ "ProductName", "Security", RID_SVXPAGE_INET_SECURITY },
{ "ProductName", "Personalization", RID_SVXPAGE_PERSONALIZATION },
@@ -492,8 +488,6 @@ struct OptionsGroupInfo
pCurrentPageEntry ( nullptr ),\
sTitle ( GetText() ),\
sNotLoadedError ( CUI_RES( RID_SVXSTR_LOAD_ERROR ) ),\
- pColorPageItemSet ( nullptr ),\
- mpColorPage ( nullptr ),\
bForgetSelection ( false ),\
bIsFromExtensionManager( false ), \
bIsForSetDocumentLanguage( false )
@@ -604,14 +598,11 @@ void OfaTreeOptionsDialog::dispose()
}
pEntry = pTreeLB->Next(pEntry);
}
- delete pColorPageItemSet;
- pColorPageItemSet = nullptr;
deleteGroupNames();
pOkPB.clear();
pBackPB.clear();
pTreeLB.clear();
pTabBox.clear();
- mpColorPage.clear();
SfxModalDialog::dispose();
}
@@ -661,10 +652,7 @@ IMPL_LINK_NOARG_TYPED(OfaTreeOptionsDialog, BackHdl_Impl, Button*, void)
{
OptionsGroupInfo* pGroupInfo =
static_cast<OptionsGroupInfo*>(pTreeLB->GetParent( pCurrentPageEntry )->GetUserData());
- if ( RID_SVXPAGE_COLOR == pPageInfo->m_nPageId )
- pPageInfo->m_pPage->Reset( pColorPageItemSet );
- else
- pPageInfo->m_pPage->Reset( pGroupInfo->m_pInItemSet );
+ pPageInfo->m_pPage->Reset( pGroupInfo->m_pInItemSet );
}
else if ( pPageInfo->m_pExtPage )
pPageInfo->m_pExtPage->ResetPage();
@@ -984,18 +972,6 @@ void OfaTreeOptionsDialog::SelectHdl_Impl()
{
if(pGroupInfo->m_bLoadError)
return;
- if ( RID_SVXPAGE_COLOR == pPageInfo->m_nPageId )
- {
- if(!pColorPageItemSet)
- {
- // Move usage of a static XOutdevItemPool instance here
- if(!mpStaticXOutdevItemPool)
- mpStaticXOutdevItemPool = new XOutdevItemPool();
-
- pColorPageItemSet = new SfxItemSet( *mpStaticXOutdevItemPool, XATTR_FILLSTYLE, XATTR_FILLCOLOR);
- pColorPageItemSet->Put( XFillColorItem() );
- }
- }
else
{
if(pGroupInfo->m_pModule /*&& !pGroupInfo->pModule->IsLoaded()*/)
@@ -1041,37 +1017,17 @@ void OfaTreeOptionsDialog::SelectHdl_Impl()
pGroupInfo->m_pInItemSet->GetRanges());
}
- if(pPageInfo->m_nPageId == RID_SVXPAGE_COLOR)
- {
- pPageInfo->m_pPage.disposeAndReset( ::CreateGeneralTabPage(
- pPageInfo->m_nPageId, pTabBox, *pColorPageItemSet ) );
- mpColorPage = static_cast<SvxColorTabPage*>(pPageInfo->m_pPage.get());
- mpColorPage->SetupForViewFrame( SfxViewFrame::Current() );
- }
- else
- {
- pPageInfo->m_pPage.disposeAndReset( ::CreateGeneralTabPage(pPageInfo->m_nPageId, pTabBox, *pGroupInfo->m_pInItemSet ) );
-
- if(!pPageInfo->m_pPage && pGroupInfo->m_pModule)
- pPageInfo->m_pPage.disposeAndReset( pGroupInfo->m_pModule->CreateTabPage(pPageInfo->m_nPageId, pTabBox, *pGroupInfo->m_pInItemSet) );
+ pPageInfo->m_pPage.disposeAndReset( ::CreateGeneralTabPage(pPageInfo->m_nPageId, pTabBox, *pGroupInfo->m_pInItemSet ) );
- }
+ if(!pPageInfo->m_pPage && pGroupInfo->m_pModule)
+ pPageInfo->m_pPage.disposeAndReset( pGroupInfo->m_pModule->CreateTabPage(pPageInfo->m_nPageId, pTabBox, *pGroupInfo->m_pInItemSet) );
DBG_ASSERT( pPageInfo->m_pPage, "tabpage could not created");
if ( pPageInfo->m_pPage )
{
SvtViewOptions aTabPageOpt( E_TABPAGE, OUString::number( pPageInfo->m_nPageId) );
pPageInfo->m_pPage->SetUserData( GetViewOptUserItem( aTabPageOpt ) );
-
- if ( RID_SVXPAGE_COLOR == pPageInfo->m_nPageId )
- {
- pPageInfo->m_pPage->Reset( pColorPageItemSet );
- pPageInfo->m_pPage->ActivatePage( *pColorPageItemSet );
- }
- else
- {
- pPageInfo->m_pPage->Reset( pGroupInfo->m_pInItemSet );
- }
+ pPageInfo->m_pPage->Reset( pGroupInfo->m_pInItemSet );
}
}
else if ( 0 == pPageInfo->m_nPageId && !pPageInfo->m_pExtPage )
@@ -2137,8 +2093,6 @@ short OfaTreeOptionsDialog::Execute()
if( RET_OK == nRet )
{
ApplyItemSets();
- if( mpColorPage )
- mpColorPage->SaveToViewFrame( SfxViewFrame::Current() );
utl::ConfigManager::storeConfigItems();
}
diff --git a/cui/source/options/treeopt.src b/cui/source/options/treeopt.src
index 44dc8a5295ed..7209e503f6a2 100644
--- a/cui/source/options/treeopt.src
+++ b/cui/source/options/treeopt.src
@@ -34,7 +34,6 @@ Resource RID_OFADLG_OPTIONS_TREE_PAGES
< "View" ; OFA_TP_VIEW ; > ;
< "Print" ; RID_SFXPAGE_PRINTOPTIONS; > ;
< "Paths" ; RID_SFXPAGE_PATH; > ;
- < "Colors" ; RID_SVXPAGE_COLOR; > ;
< "Fonts" ; RID_SVX_FONT_SUBSTITUTION ; > ;
< "Security" ; RID_SVXPAGE_INET_SECURITY ; > ;
< "Personalization" ; RID_SVXPAGE_PERSONALIZATION ; > ;
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 77b62f9b34f8..9571073ccfa4 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -52,11 +52,6 @@
using namespace com::sun::star;
-// FIXME: you have to hate yourself for this - all this
-// horrible and broadly unused pointer based coupling
-// needs to die. cf SetupForViewFrame
-#define COLORPAGE_UNKNOWN ((sal_uInt16)0xFFFF)
-
struct SvxColorTabPageShadow
{
PageType nUnknownType;
@@ -837,49 +832,6 @@ void SvxColorTabPage::FillUserData()
}
-void SvxColorTabPage::SetupForViewFrame( SfxViewFrame *pViewFrame )
-{
- const OfaRefItem<XColorList> *pPtr = nullptr;
- if ( pViewFrame != nullptr && pViewFrame->GetDispatcher() )
- pPtr = static_cast<const OfaRefItem<XColorList> *>(pViewFrame->
- GetDispatcher()->Execute( SID_GET_COLORLIST,
- SfxCallMode::SYNCHRON ));
- pColorList = pPtr ? pPtr->GetValue() : XColorList::GetStdColorList();
-
- SetPageType( &pShadow->nUnknownType );
- SetDlgType( COLORPAGE_UNKNOWN );
- SetPos( &pShadow->nUnknownPos );
- SetAreaTP( &pShadow->bIsAreaTP );
- SetColorChgd( &pShadow->nChangeType );
- Construct();
-}
-
-void SvxColorTabPage::SaveToViewFrame( SfxViewFrame *pViewFrame )
-{
- if( !pColorList.is() )
- return;
-
- if( !pViewFrame )
- return;
-
- // notify current viewframe that it uses the same color table
- if ( !pViewFrame->GetDispatcher() )
- return;
-
- const OfaRefItem<XColorList> * pPtr;
- pPtr = static_cast<const OfaRefItem<XColorList>*>(pViewFrame->GetDispatcher()->Execute( SID_GET_COLORLIST, SfxCallMode::SYNCHRON ));
- if( pPtr )
- {
- XColorListRef pReference = pPtr->GetValue();
-
- if( pReference.is() &&
- pReference->GetPath() == pColorList->GetPath() &&
- pReference->GetName() == pColorList->GetName() )
- SfxObjectShell::Current()->PutItem( SvxColorListItem( pColorList,
- SID_COLOR_TABLE ) );
- }
-}
-
void SvxColorTabPage::SetPropertyList( XPropertyListType t, const XPropertyListRef &xRef )
{
(void) t;