diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-03-01 14:08:19 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-03-01 16:15:59 -0500 |
commit | 65b0689ed0e28a82fdaa24268dba9d65654975d3 (patch) | |
tree | aba277eac05ba810de6f678a6bc379e125682542 /sc/source | |
parent | 6529718c2262125ba952ecb7910c356afd2f3611 (diff) |
Initial change to display named range option in the source dialog.
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.cxx | 19 | ||||
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.hxx | 7 | ||||
-rw-r--r-- | sc/source/ui/dbgui/dapitype.cxx | 22 | ||||
-rw-r--r-- | sc/source/ui/dbgui/dapitype.hrc | 3 | ||||
-rw-r--r-- | sc/source/ui/dbgui/dapitype.src | 20 | ||||
-rw-r--r-- | sc/source/ui/inc/dapitype.hxx | 11 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 6 |
7 files changed, 74 insertions, 14 deletions
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 64006c450e44..24fc3b011a16 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -250,16 +250,31 @@ void AbstractScDataPilotDatabaseDlg_Impl::GetValues( ScImportSourceDesc& rDesc ) //AbstractScDataPilotSourceTypeDlg_Impl begin -BOOL AbstractScDataPilotSourceTypeDlg_Impl::IsDatabase() const +bool AbstractScDataPilotSourceTypeDlg_Impl::IsDatabase() const { return pDlg->IsDatabase(); } -BOOL AbstractScDataPilotSourceTypeDlg_Impl::IsExternal() const +bool AbstractScDataPilotSourceTypeDlg_Impl::IsExternal() const { return pDlg->IsExternal(); } +bool AbstractScDataPilotSourceTypeDlg_Impl::IsNamedRange() const +{ + return pDlg->IsNamedRange(); +} + +rtl::OUString AbstractScDataPilotSourceTypeDlg_Impl::GetSelectedNamedRange() const +{ + return pDlg->GetSelectedNamedRange(); +} + +void AbstractScDataPilotSourceTypeDlg_Impl::SetNamedRanges(const std::vector<rtl::OUString>& rNames) +{ + pDlg->SetNamedRanges(rNames); +} + //AbstractScDataPilotSourceTypeDlg_Impl end diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index d89ee8203dbe..b9bf83f195ad 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -145,8 +145,11 @@ class AbstractScDataPilotDatabaseDlg_Impl :public AbstractScDataPilotDatabaseDl class AbstractScDataPilotSourceTypeDlg_Impl :public AbstractScDataPilotSourceTypeDlg //add for ScDataPilotSourceTypeDlg { DECL_ABSTDLG_BASE(AbstractScDataPilotSourceTypeDlg_Impl, ScDataPilotSourceTypeDlg) - virtual BOOL IsDatabase() const; - virtual BOOL IsExternal() const; + virtual bool IsDatabase() const; + virtual bool IsExternal() const; + virtual bool IsNamedRange() const; + virtual rtl::OUString GetSelectedNamedRange() const; + virtual void SetNamedRanges(const ::std::vector<rtl::OUString>& rNames); }; class AbstractScDataPilotServiceDlg_Impl : public AbstractScDataPilotServiceDlg //add for ScDataPilotServiceDlg diff --git a/sc/source/ui/dbgui/dapitype.cxx b/sc/source/ui/dbgui/dapitype.cxx index b9ca10fef09e..8842e24f5f9e 100644 --- a/sc/source/ui/dbgui/dapitype.cxx +++ b/sc/source/ui/dbgui/dapitype.cxx @@ -41,6 +41,7 @@ #include "dapitype.hrc" using namespace com::sun::star; +using ::rtl::OUString; //------------------------------------------------------------------------- @@ -49,6 +50,8 @@ ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg( Window* pParent, BOOL bEnabl // aFlFrame ( this, ScResId( FL_FRAME ) ), aBtnSelection ( this, ScResId( BTN_SELECTION ) ), + aBtnNamedRange ( this, ScResId( BTN_NAMED_RANGE ) ), + aLbNamedRange ( this, ScResId( LB_NAMED_RANGE ) ), aBtnDatabase ( this, ScResId( BTN_DATABASE ) ), aBtnExternal ( this, ScResId( BTN_EXTERNAL ) ), aBtnOk ( this, ScResId( BTN_OK ) ), @@ -59,6 +62,7 @@ ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg( Window* pParent, BOOL bEnabl aBtnExternal.Disable(); aBtnSelection.Check(); + aLbNamedRange.Disable(); FreeResource(); } @@ -67,16 +71,30 @@ ScDataPilotSourceTypeDlg::~ScDataPilotSourceTypeDlg() { } -BOOL ScDataPilotSourceTypeDlg::IsDatabase() const +bool ScDataPilotSourceTypeDlg::IsDatabase() const { return aBtnDatabase.IsChecked(); } -BOOL ScDataPilotSourceTypeDlg::IsExternal() const +bool ScDataPilotSourceTypeDlg::IsExternal() const { return aBtnExternal.IsChecked(); } +bool ScDataPilotSourceTypeDlg::IsNamedRange() const +{ + return false; +} + +OUString ScDataPilotSourceTypeDlg::GetSelectedNamedRange() const +{ + return OUString(); +} + +void ScDataPilotSourceTypeDlg::SetNamedRanges(const ::std::vector<OUString>& rNames) +{ +} + //------------------------------------------------------------------------- ScDataPilotServiceDlg::ScDataPilotServiceDlg( Window* pParent, diff --git a/sc/source/ui/dbgui/dapitype.hrc b/sc/source/ui/dbgui/dapitype.hrc index 6358763d7fd1..794b8e34100c 100644 --- a/sc/source/ui/dbgui/dapitype.hrc +++ b/sc/source/ui/dbgui/dapitype.hrc @@ -50,3 +50,6 @@ #define CB_OBJECT 21 #define FT_OBJTYPE 22 #define LB_OBJTYPE 23 + +#define BTN_NAMED_RANGE 24 +#define LB_NAMED_RANGE 25 diff --git a/sc/source/ui/dbgui/dapitype.src b/sc/source/ui/dbgui/dapitype.src index 3c03150e400b..1aef003fd5df 100644 --- a/sc/source/ui/dbgui/dapitype.src +++ b/sc/source/ui/dbgui/dapitype.src @@ -34,7 +34,7 @@ ModalDialog RID_SCDLG_DAPITYPE OutputSize = TRUE ; HelpId = HID_DATAPILOT_TYPE ; SVLook = TRUE ; - Size = MAP_APPFONT ( 241 , 63 ) ; + Size = MAP_APPFONT ( 241 , 83 ) ; Moveable = TRUE ; Closeable = FALSE ; OKButton BTN_OK @@ -63,16 +63,30 @@ ModalDialog RID_SCDLG_DAPITYPE TabStop = TRUE ; Text [ en-US ] = "~Current selection"; }; - RadioButton BTN_DATABASE + RadioButton BTN_NAMED_RANGE { Pos = MAP_APPFONT ( 12 , 28 ) ; + Size = MAP_APPFONT ( 70 , 10 ) ; + TabStop = TRUE ; + Text [ en-US ] = "~Named range"; + }; + ListBox LB_NAMED_RANGE + { + Pos = MAP_APPFONT ( 90 , 27 ) ; + Size = MAP_APPFONT ( 70 , 10 ) ; + TabStop = TRUE ; + DropDown = TRUE ; + }; + RadioButton BTN_DATABASE + { + Pos = MAP_APPFONT ( 12 , 42 ) ; Size = MAP_APPFONT ( 164 , 10 ) ; TabStop = TRUE ; Text [ en-US ] = "~Data source registered in %PRODUCTNAME"; }; RadioButton BTN_EXTERNAL { - Pos = MAP_APPFONT ( 12 , 42 ) ; + Pos = MAP_APPFONT ( 12 , 56 ) ; Size = MAP_APPFONT ( 164 , 10 ) ; TabStop = TRUE ; Text [ en-US ] = "~External source/interface"; diff --git a/sc/source/ui/inc/dapitype.hxx b/sc/source/ui/inc/dapitype.hxx index 25b3453822e0..ff4f3863eef8 100644 --- a/sc/source/ui/inc/dapitype.hxx +++ b/sc/source/ui/inc/dapitype.hxx @@ -36,6 +36,8 @@ #include <vcl/lstbox.hxx> #include <com/sun/star/uno/Sequence.hxx> +#include <vector> + //------------------------------------------------------------------------ class ScDataPilotSourceTypeDlg : public ModalDialog @@ -43,6 +45,8 @@ class ScDataPilotSourceTypeDlg : public ModalDialog private: FixedLine aFlFrame; RadioButton aBtnSelection; + RadioButton aBtnNamedRange; + ListBox aLbNamedRange; RadioButton aBtnDatabase; RadioButton aBtnExternal; OKButton aBtnOk; @@ -53,8 +57,11 @@ public: ScDataPilotSourceTypeDlg( Window* pParent, BOOL bEnableExternal ); ~ScDataPilotSourceTypeDlg(); - BOOL IsDatabase() const; - BOOL IsExternal() const; + bool IsDatabase() const; + bool IsExternal() const; + bool IsNamedRange() const; + rtl::OUString GetSelectedNamedRange() const; + void SetNamedRanges(const ::std::vector<rtl::OUString>& rNames); }; diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index face59d0fb2a..e5c22632f09b 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2147,7 +2147,7 @@ void ScCellShell::ExecuteDataPilotDialog() // first select type of source data - BOOL bEnableExt = ScDPObject::HasRegisteredSources(); + bool bEnableExt = ScDPObject::HasRegisteredSources(); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "ScAbstractFactory create fail!"); @@ -2216,7 +2216,7 @@ void ScCellShell::ExecuteDataPilotDialog() pTabViewShell->MarkRange(aRange); } - BOOL bOK = TRUE; + bool bOK = true; if ( pDoc->HasSubTotalCells( aRange ) ) { // confirm selection if it contains SubTotal cells @@ -2225,7 +2225,7 @@ void ScCellShell::ExecuteDataPilotDialog() WinBits(WB_YES_NO | WB_DEF_YES), ScGlobal::GetRscString(STR_DATAPILOT_SUBTOTAL) ); if (aBox.Execute() == RET_NO) - bOK = FALSE; + bOK = false; } if (bOK) { |