summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/attrdlg/attrdlg.cxx63
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.cxx22
-rw-r--r--sc/source/ui/attrdlg/scdlgfact.hxx3
-rw-r--r--sc/source/ui/attrdlg/tabpages.cxx1
-rw-r--r--sc/source/ui/inc/attrdlg.hrc31
-rw-r--r--sc/source/ui/inc/attrdlg.hxx2
-rw-r--r--sc/source/ui/inc/tabvwsh.hxx2
-rw-r--r--sc/source/ui/src/attrdlg.src92
-rw-r--r--sc/source/ui/view/cellsh3.cxx3
-rw-r--r--sc/source/ui/view/formatsh.cxx3
-rw-r--r--sc/source/ui/view/tabvwsha.cxx8
11 files changed, 37 insertions, 193 deletions
diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx
index c3e570c2d54d..fcd0da3eaf62 100644
--- a/sc/source/ui/attrdlg/attrdlg.cxx
+++ b/sc/source/ui/attrdlg/attrdlg.cxx
@@ -31,7 +31,6 @@
#include "tabpages.hxx"
#include "attrdlg.hxx"
#include "scresid.hxx"
-#include "attrdlg.hrc"
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
#include <svx/flagsdef.hxx>
@@ -40,41 +39,34 @@
//==================================================================
-ScAttrDlg::ScAttrDlg( SfxViewFrame* pFrameP,
- Window* pParent,
- const SfxItemSet* pCellAttrs )
-
- : SfxTabDialog( pFrameP,
- pParent,
- ScResId( RID_SCDLG_ATTR ),
- pCellAttrs )
+ScAttrDlg::ScAttrDlg(SfxViewFrame* pFrameP, Window* pParent, const SfxItemSet* pCellAttrs)
+ : SfxTabDialog(pFrameP, pParent, "FormatCellsDialog", "modules/scalc/ui/formatcellsdialog.ui", pCellAttrs)
{
SvtCJKOptions aCJKOptions;
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialogdiet fail!");
OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), "GetTabPageCreatorFunc fail!");
- AddTabPage( TP_NUMBER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), 0 );
+ m_nNumberPageId = AddTabPage( "numbers", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_NUMBERFORMAT ), 0 );
OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!");
- AddTabPage( TP_FONT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), 0 );
+ m_nFontPageId = AddTabPage( "font", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), 0 );
OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!");
- AddTabPage( TP_FONTEFF, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), 0 );
+ AddTabPage( "fonteffects", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), 0 );
OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), "GetTabPageCreatorFunc fail!");
- AddTabPage( TP_ALIGNMENT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), 0 );
+ AddTabPage( "alignment", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), 0 );
if ( aCJKOptions.IsAsianTypographyEnabled() )
{
OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!");
- AddTabPage( TP_ASIAN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), 0 );
+ AddTabPage( "asiantypography", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), 0 );
}
else
- RemoveTabPage( TP_ASIAN );
+ RemoveTabPage( "asiantypography" );
OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
- AddTabPage( TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), 0 );
+ AddTabPage( "borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), 0 );
OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
- AddTabPage( TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 );
- AddTabPage( TP_PROTECTION, ScTabPageProtection::Create, 0 );
- FreeResource();
+ AddTabPage( "background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 );
+ AddTabPage( "cellprotection" , ScTabPageProtection::Create, 0 );
}
// -----------------------------------------------------------------------
@@ -89,28 +81,19 @@ void ScAttrDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage )
{
SfxObjectShell* pDocSh = SfxObjectShell::Current();
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
- switch ( nPageId )
+ if (nPageId == m_nNumberPageId)
+ {
+ aSet.Put (SfxLinkItem( SID_LINK_TYPE, LINK( this, ScAttrDlg, OkHandler )));
+ rTabPage.PageCreated(aSet);
+ }
+ else if (nPageId == m_nFontPageId)
{
- case TP_NUMBER:
- {
- aSet.Put (SfxLinkItem( SID_LINK_TYPE, LINK( this, ScAttrDlg, OkHandler )));
- rTabPage.PageCreated(aSet);
- }
- break;
-
- case TP_FONT:
- {
- const SfxPoolItem* pInfoItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST );
-
- OSL_ENSURE( pInfoItem, "FontListItem not found :-(" );
-
- aSet.Put (SvxFontListItem(((const SvxFontListItem*)pInfoItem)->GetFontList(), SID_ATTR_CHAR_FONTLIST ));
- rTabPage.PageCreated(aSet);
- }
- break;
-
- default:
- break;
+ const SfxPoolItem* pInfoItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST );
+
+ OSL_ENSURE( pInfoItem, "FontListItem not found :-(" );
+
+ aSet.Put (SvxFontListItem(((const SvxFontListItem*)pInfoItem)->GetFontList(), SID_ATTR_CHAR_FONTLIST ));
+ rTabPage.PageCreated(aSet);
}
}
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index ca1bfd49407d..e511c7bb7e0f 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -1338,25 +1338,11 @@ AbstractScImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScImportOptions
}
-SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScAttrDlg( SfxViewFrame* pFrame,
- Window* pParent,
- const SfxItemSet* pCellAttrs,
- int nId)
+SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScAttrDlg(SfxViewFrame* pFrame,
+ Window* pParent, const SfxItemSet* pCellAttrs)
{
- SfxTabDialog* pDlg=NULL;
- switch ( nId )
- {
- case RID_SCDLG_ATTR :
- pDlg = new ScAttrDlg( pFrame, pParent, pCellAttrs );
- break;
- default:
- break;
- }
-
- if ( pDlg )
- return new ScAbstractTabDialog_Impl( pDlg );
- return 0;
-
+ SfxTabDialog* pDlg = new ScAttrDlg(pFrame, pParent, pCellAttrs);
+ return new ScAbstractTabDialog_Impl(pDlg);
}
#undef SfxTabDialog
diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx
index f0cca3dc5136..5720c691ca72 100644
--- a/sc/source/ui/attrdlg/scdlgfact.hxx
+++ b/sc/source/ui/attrdlg/scdlgfact.hxx
@@ -549,8 +549,7 @@ public:
sal_Bool bImport = sal_True );
virtual SfxAbstractTabDialog * CreateScAttrDlg( SfxViewFrame* pFrame, //add for ScAttrDlg
Window* pParent,
- const SfxItemSet* pCellAttrs,
- int nId);
+ const SfxItemSet* pCellAttrs );
virtual SfxAbstractTabDialog * CreateScHFEditDlg( SfxViewFrame* pFrame, //add for ScHFEditDlg
Window* pParent,
diff --git a/sc/source/ui/attrdlg/tabpages.cxx b/sc/source/ui/attrdlg/tabpages.cxx
index f16897ac176f..94ecdc0f3c99 100644
--- a/sc/source/ui/attrdlg/tabpages.cxx
+++ b/sc/source/ui/attrdlg/tabpages.cxx
@@ -27,7 +27,6 @@
#include "scresid.hxx"
#include "sc.hrc"
-#include "attrdlg.hrc"
#include "tabpages.hxx"
// STATIC DATA -----------------------------------------------------------
diff --git a/sc/source/ui/inc/attrdlg.hrc b/sc/source/ui/inc/attrdlg.hrc
deleted file mode 100644
index c45f29d77701..000000000000
--- a/sc/source/ui/inc/attrdlg.hrc
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "sc.hrc" // -> SC_DLG_ATTR
-
-#define TP_NUMBER 1
-#define TP_FONT 2
-#define TP_ALIGNMENT 3
-#define TP_BORDER 4
-#define TP_BACKGROUND 5
-#define TP_PROTECTION 6
-#define TP_FONTEFF 7
-#define TP_ASIAN 8
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/attrdlg.hxx b/sc/source/ui/inc/attrdlg.hxx
index 18a80a1a2e5b..111190d6572a 100644
--- a/sc/source/ui/inc/attrdlg.hxx
+++ b/sc/source/ui/inc/attrdlg.hxx
@@ -41,6 +41,8 @@ protected:
private:
DECL_LINK( OkHandler, void* ); // for closing by double clicking in TabPages
+ sal_uInt16 m_nNumberPageId;
+ sal_uInt16 m_nFontPageId;
};
#endif // SC_ATTRDLG_HXX
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 9ca9868a4542..eb3550ad9805 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -391,7 +391,7 @@ public:
void UpdateNumberFormatter ( const SvxNumberInfoItem& rInfoItem );
- void ExecuteCellFormatDlg ( SfxRequest& rReq, sal_uInt16 nTabPage = 0xffff );
+ void ExecuteCellFormatDlg ( SfxRequest& rReq, const OString &rTabPage = OString());
sal_Bool GetFunction( String& rFuncStr, sal_uInt16 nErrCode = 0 );
diff --git a/sc/source/ui/src/attrdlg.src b/sc/source/ui/src/attrdlg.src
deleted file mode 100644
index c976106031fd..000000000000
--- a/sc/source/ui/src/attrdlg.src
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#include <svx/dialogs.hrc>
-#include "attrdlg.hrc"
-
- //================================================
- // Attributdialog:
-
-TabDialog RID_SCDLG_ATTR
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 280 , 165 ) ;
- Text [ en-US ] = "Format Cells" ;
- Moveable = TRUE ;
- Closeable = FALSE ;
- TabControl 1
- {
- OutputSize = TRUE ;
- Pos = MAP_APPFONT ( 23 , 0 ) ;
- Size = MAP_APPFONT ( 260 , 135 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = TP_NUMBER ;
- PageResID = 256 ;
- Text [ en-US ] = "Numbers" ;
- };
- PageItem
- {
- Identifier = TP_FONT ;
- PageResID = 257 ;
- Text [ en-US ] = "Font" ;
- };
- PageItem
- {
- Identifier = TP_FONTEFF ;
- PageResID = 262 ;
- Text [ en-US ] = "Font Effects";
- };
- PageItem
- {
- Identifier = TP_ALIGNMENT ;
- PageResID = 258 ;
- Text [ en-US ] = "Alignment" ;
- };
- PageItem
- {
- Identifier = TP_ASIAN ;
- PageResID = 263 ;
- Text [ en-US ] = "Asian Typography";
- };
- PageItem
- {
- Identifier = TP_BORDER ;
- PageResID = 259 ;
- Text [ en-US ] = "Borders" ;
- };
- PageItem
- {
- Identifier = TP_BACKGROUND ;
- PageResID = 260 ;
- Text [ en-US ] = "Background" ;
- };
- PageItem
- {
- Identifier = TP_PROTECTION ;
- PageResID = 261 ;
- Text [ en-US ] = "Cell Protection" ;
- };
- };
- };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 4e40e4fbaf8e..6a17bdd2626b 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -37,7 +37,6 @@
#include "autoform.hxx"
#include "autofmt.hxx"
#include "cellsh.hxx"
-#include "attrdlg.hrc" // TP_ALIGNMENT
#include "inputhdl.hxx"
#include "editable.hxx"
#include "markdata.hxx"
@@ -355,7 +354,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
break;
case SID_ENABLE_HYPHENATION:
- pTabViewShell->ExecuteCellFormatDlg( rReq, TP_ALIGNMENT );
+ pTabViewShell->ExecuteCellFormatDlg(rReq, "alignment");
break;
case SID_OPENDLG_SOLVE:
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index d35c0f3322e3..8a0908155cc7 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -61,7 +61,6 @@
#include "docsh.hxx"
#include "patattr.hxx"
#include "scmod.hxx"
-#include "attrdlg.hrc"
#include "stlpool.hxx"
#include "stlsheet.hxx"
#include "printfun.hxx"
@@ -1420,7 +1419,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
case SID_ATTR_CHAR_COLOR:
case SID_ATTR_CHAR_FONT:
case SID_ATTR_CHAR_FONTHEIGHT:
- pTabViewShell->ExecuteCellFormatDlg( rReq, TP_FONT ); // wenn ToolBar vertikal
+ pTabViewShell->ExecuteCellFormatDlg(rReq, "font"); // wenn ToolBar vertikal
break;
case SID_BACKGROUND_COLOR:
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 20b3d39a3e94..e9a5e6bf52e0 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -466,7 +466,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
}
//------------------------------------------------------------------
-void ScTabViewShell::ExecuteCellFormatDlg( SfxRequest& rReq, sal_uInt16 nTabPage )
+void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName)
{
SfxAbstractTabDialog * pDlg = NULL;
ScDocument* pDoc = GetViewData()->GetDocument();
@@ -516,10 +516,10 @@ void ScTabViewShell::ExecuteCellFormatDlg( SfxRequest& rReq, sal_uInt16 nTabPage
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
- pDlg = pFact->CreateScAttrDlg( GetViewFrame(), GetDialogParent(), pOldSet, RID_SCDLG_ATTR);
+ pDlg = pFact->CreateScAttrDlg(GetViewFrame(), GetDialogParent(), pOldSet);
OSL_ENSURE(pDlg, "Dialog create fail!");
- if ( nTabPage != 0xffff )
- pDlg->SetCurPageId( nTabPage );
+ if (!rName.isEmpty())
+ pDlg->SetCurPageId(rName);
short nResult = pDlg->Execute();
bInFormatDialog = false;