officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu | 12 +- sc/inc/sc.hrc | 4 sc/sdi/cellsh.sdi | 2 sc/sdi/scalc.sdi | 50 ++++++++ sc/source/ui/attrdlg/scdlgfact.cxx | 13 +- sc/source/ui/condformat/condformatdlg.cxx | 58 ++++++++-- sc/source/ui/condformat/condformatmgr.cxx | 42 ++++++- sc/source/ui/inc/condformatdlg.hxx | 26 +++- sc/source/ui/inc/condformatmgr.hxx | 1 sc/source/ui/view/cellsh1.cxx | 13 +- sc/uiconfig/scalc/menubar/menubar.xml | 2 11 files changed, 204 insertions(+), 19 deletions(-)
New commits: commit ce8ac5bbe40e4cb57e1826a81b3b5c4632474789 Author: Markus Mohrhard <[email protected]> Date: Sat Oct 6 06:52:28 2012 +0200 prevent creating cond formats without a attached range Change-Id: Ic4c13fa3d0eae54b7db1fa5a4e5c5040582b21ed diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 9dc6350..4c5708a 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -1133,6 +1133,7 @@ ScCondFormatDlg::ScCondFormatDlg(Window* pParent, ScDocument* pDoc, const ScCond maBtnAdd.SetClickHdl( LINK( &maCondFormList, ScCondFormatList, AddBtnHdl ) ); maBtnRemove.SetClickHdl( LINK( &maCondFormList, ScCondFormatList, RemoveBtnHdl ) ); maEdRange.SetModifyHdl( LINK( this, ScCondFormatDlg, EdRangeModifyHdl ) ); + maBtnOk.SetClickHdl( LINK( this, ScCondFormatDlg, OkBtnHdl ) ); FreeResource(); maEdRange.SetText(aRangeString); @@ -1207,5 +1208,21 @@ IMPL_LINK( ScCondFormatDlg, EdRangeModifyHdl, Edit*, pEdit ) return 0; } +IMPL_LINK_NOARG( ScCondFormatDlg, OkBtnHdl ) +{ + rtl::OUString aRangeStr = maEdRange.GetText(); + ScRangeList aRange; + aRange.Parse(aRangeStr, mpDoc, SCA_VALID, mpDoc->GetAddressConvention()); + boost::scoped_ptr<ScConditionalFormat> pFormat(maCondFormList.GetConditionalFormat()); + if(pFormat && pFormat->GetRange().empty() && aRange.empty()) + return 0; + else + { + EndDialog(RET_OK); + } + + return 0; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx index c7a247c..52c03e5 100644 --- a/sc/source/ui/inc/condformatdlg.hxx +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -205,6 +205,7 @@ private: ScDocument* mpDoc; DECL_LINK( EdRangeModifyHdl, Edit* ); + DECL_LINK( OkBtnHdl, void* ); public: ScCondFormatDlg(Window* pWindow, ScDocument* pDoc, const ScConditionalFormat* pFormat, const ScRangeList& rRange, const ScAddress& rPos, condformat::dialog::ScCondFormatDialogType eType); commit 7f127204ce0d601ef4b956b92c6ba433f753d534 Author: Markus Mohrhard <[email protected]> Date: Sat Oct 6 06:52:03 2012 +0200 prevent crash when no cond format will be defined in cond format dlg Change-Id: Iffc54ada1fcf586c00eddf934079fa671f263ce0 diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx index c6a6465..0bd3538 100644 --- a/sc/source/ui/condformat/condformatmgr.cxx +++ b/sc/source/ui/condformat/condformatmgr.cxx @@ -257,6 +257,9 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, AddBtnHdl) if(pDlg->Execute() == RET_OK) { ScConditionalFormat* pNewFormat = pDlg->GetConditionalFormat(); + if(!pNewFormat) + return 0; + mpFormatList->InsertNew(pNewFormat); pNewFormat->SetKey(FindKey(mpFormatList)); maCtrlManager.Update(); commit d8a854364f6c3d9a7a1de2073d3ff5f17c5c2762 Author: Markus Mohrhard <[email protected]> Date: Sat Oct 6 06:24:30 2012 +0200 enable the add button in manage conditional formats Change-Id: I82a0abf58f8fc68d0e9e145923961fa3e3c654fe diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx index 6eeecd1..c6a6465 100644 --- a/sc/source/ui/condformat/condformatmgr.cxx +++ b/sc/source/ui/condformat/condformatmgr.cxx @@ -181,8 +181,8 @@ ScCondFormatManagerDlg::ScCondFormatManagerDlg(Window* pParent, ScDocument* pDoc maBtnRemove.SetClickHdl(LINK(this, ScCondFormatManagerDlg, RemoveBtnHdl)); maBtnEdit.SetClickHdl(LINK(this, ScCondFormatManagerDlg, EditBtnHdl)); + maBtnAdd.SetClickHdl(LINK(this, ScCondFormatManagerDlg, AddBtnHdl)); maCtrlManager.GetListControl().SetDoubleClickHdl(LINK(this, ScCondFormatManagerDlg, EditBtnHdl)); - maBtnAdd.Hide(); } ScCondFormatManagerDlg::~ScCondFormatManagerDlg() @@ -233,4 +233,39 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, EditBtnHdl) return 0; } +namespace { + +sal_uInt32 FindKey(ScConditionalFormatList* pFormatList) +{ + sal_uInt32 nKey = 0; + for(ScConditionalFormatList::const_iterator itr = pFormatList->begin(), itrEnd = pFormatList->end(); + itr != itrEnd; ++itr) + { + if(itr->GetKey() > nKey) + nKey = itr->GetKey(); + } + + return nKey + 1; +} + +} + +IMPL_LINK_NOARG(ScCondFormatManagerDlg, AddBtnHdl) +{ + boost::scoped_ptr<ScCondFormatDlg> pDlg(new ScCondFormatDlg(this, mpDoc, NULL, ScRangeList(), + maPos, condformat::dialog::CONDITION)); + if(pDlg->Execute() == RET_OK) + { + ScConditionalFormat* pNewFormat = pDlg->GetConditionalFormat(); + mpFormatList->InsertNew(pNewFormat); + pNewFormat->SetKey(FindKey(mpFormatList)); + maCtrlManager.Update(); + + mbModified = true; + } + + return 0; +} + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/condformatmgr.hxx b/sc/source/ui/inc/condformatmgr.hxx index c71e2ef..5b0d1e8 100644 --- a/sc/source/ui/inc/condformatmgr.hxx +++ b/sc/source/ui/inc/condformatmgr.hxx @@ -106,6 +106,7 @@ private: DECL_LINK(RemoveBtnHdl, void*); DECL_LINK(EditBtnHdl, void*); + DECL_LINK(AddBtnHdl, void*); bool mbModified; }; commit c2d8d60748769d32133f33efb43be3e9ea28f8c8 Author: Markus Mohrhard <[email protected]> Date: Sat Oct 6 05:19:19 2012 +0200 selecting the correct entry will also show it in the dialog Change-Id: I6bbeb2d1cb5af724ac0743d13f3e36cb8b613a88 diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 7962c6d..9200eba 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -787,8 +787,17 @@ AbstractScCondFormatDlg* ScAbstractDialogFactory_Impl::CreateScCondFormatDlg(Win ScCondFormatDlg* pDlg = NULL; switch( nId ) { - case RID_SCDLG_CONDFORMAT: - pDlg = new ScCondFormatDlg( pParent, pDoc, pFormat, rRange, rPos ); + case 0: + pDlg = new ScCondFormatDlg( pParent, pDoc, pFormat, rRange, rPos, condformat::dialog::NONE ); + break; + case SID_OPENDLG_CONDFRMT: + pDlg = new ScCondFormatDlg( pParent, pDoc, pFormat, rRange, rPos, condformat::dialog::CONDITION ); + break; + case SID_OPENDLG_COLORSCALE: + pDlg = new ScCondFormatDlg( pParent, pDoc, pFormat, rRange, rPos, condformat::dialog::COLORSCALE ); + break; + case SID_OPENDLG_DATABAR: + pDlg = new ScCondFormatDlg( pParent, pDoc, pFormat, rRange, rPos, condformat::dialog::DATABAR ); break; default: break; diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index e2f8d67..9dc6350 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -633,6 +633,14 @@ void ScCondFrmtEntry::Select() SetHeight(); } +void ScCondFrmtEntry::SetType( ScCondFormatEntryType eType ) +{ + meType = eType; + if(eType == DATABAR) + maLbColorFormat.SelectEntryPos(2); + Select(); +} + void ScCondFrmtEntry::Deselect() { SetControlBackground(GetSettings().GetStyleSettings().GetDialogColor()); @@ -987,7 +995,8 @@ IMPL_LINK_NOARG( ScCondFrmtEntry, ConditionTypeSelectHdl ) return 0; } -ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId, ScDocument* pDoc, const ScConditionalFormat* pFormat, const ScRangeList& rRanges, const ScAddress& rPos): +ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId, ScDocument* pDoc, const ScConditionalFormat* pFormat, + const ScRangeList& rRanges, const ScAddress& rPos, condformat::dialog::ScCondFormatDialogType eType): Control(pParent, rResId), mbHasScrollBar(false), mpScrollBar(new ScrollBar(this, WB_VERT )), @@ -1005,9 +1014,28 @@ ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId, ScDocum { maEntries.push_back(new ScCondFrmtEntry( this, mpDoc, pFormat->GetEntry(nIndex), maPos )); } - if (nCount > 0) - maEntries.begin()->Select(); } + else + { + switch(eType) + { + case condformat::dialog::CONDITION: + maEntries.push_back(new ScCondFrmtEntry( this, mpDoc, maPos )); + break; + case condformat::dialog::COLORSCALE: + maEntries.push_back(new ScCondFrmtEntry( this, mpDoc, maPos )); + maEntries[0].SetType(COLORSCALE); + break; + case condformat::dialog::DATABAR: + maEntries.push_back(new ScCondFrmtEntry( this, mpDoc, maPos )); + maEntries[0].SetType(DATABAR); + break; + default: + break; + } + } + if (!maEntries.empty()) + maEntries.begin()->Select(); RecalcAll(); FreeResource(); @@ -1083,7 +1111,8 @@ void ScCondFormatList::DoScroll(long nDelta) mpScrollBar->SetPosPixel(aNewPoint); } -ScCondFormatDlg::ScCondFormatDlg(Window* pParent, ScDocument* pDoc, const ScConditionalFormat* pFormat, const ScRangeList& rRange, const ScAddress& rPos): +ScCondFormatDlg::ScCondFormatDlg(Window* pParent, ScDocument* pDoc, const ScConditionalFormat* pFormat, const ScRangeList& rRange, + const ScAddress& rPos, condformat::dialog::ScCondFormatDialogType eType): ModalDialog(pParent, ScResId( RID_SCDLG_CONDFORMAT )), maBtnAdd( this, ScResId( BTN_ADD ) ), maBtnRemove( this, ScResId( BTN_REMOVE ) ), @@ -1091,7 +1120,7 @@ ScCondFormatDlg::ScCondFormatDlg(Window* pParent, ScDocument* pDoc, const ScCond maBtnCancel( this, ScResId( BTN_CANCEL ) ), maFtRange( this, ScResId( FT_RANGE ) ), maEdRange( this, ScResId( ED_RANGE ) ), - maCondFormList( this, ScResId( CTRL_LIST ), pDoc, pFormat, rRange, rPos ), + maCondFormList( this, ScResId( CTRL_LIST ), pDoc, pFormat, rRange, rPos, eType ), maPos(rPos), mpDoc(pDoc) { diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx index 0931899..6eeecd1 100644 --- a/sc/source/ui/condformat/condformatmgr.cxx +++ b/sc/source/ui/condformat/condformatmgr.cxx @@ -217,7 +217,7 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, EditBtnHdl) return 0; boost::scoped_ptr<ScCondFormatDlg> pDlg(new ScCondFormatDlg(this, mpDoc, pFormat, pFormat->GetRange(), - pFormat->GetRange().GetTopLeftCorner())); + pFormat->GetRange().GetTopLeftCorner(), condformat::dialog::NONE)); if(pDlg->Execute() == RET_OK) { sal_Int32 nKey = pFormat->GetKey(); diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx index 4b3e780..c7a247c 100644 --- a/sc/source/ui/inc/condformatdlg.hxx +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -47,6 +47,22 @@ class ScFormatEntry; class ScConditionalFormat; struct ScDataBarFormatData; +namespace condformat { + +namespace dialog { + +enum ScCondFormatDialogType +{ + NONE, + CONDITION, + COLORSCALE, + DATABAR +}; + +} + +} + class ScCondFrmtEntry : public Control { private: @@ -96,7 +112,6 @@ private: boost::scoped_ptr<ScDataBarFormatData> mpDataBarData; // - void SwitchToType(ScCondFormatEntryType eType); void SetCondType(); void SetColorScaleType(); void SetDataBarType(); @@ -104,6 +119,7 @@ private: void HideCondElements(); void HideColorScaleElements(); void HideDataBarElements(); + void SwitchToType(ScCondFormatEntryType eType); void SetHeight(); void Init(); @@ -134,6 +150,8 @@ public: virtual long Notify( NotifyEvent& rNEvt ); + void SetType( ScCondFormatEntryType eType ); + void Select(); void Deselect(); @@ -159,7 +177,8 @@ private: void RecalcAll(); void DoScroll(long nDiff); public: - ScCondFormatList( Window* pParent, const ResId& rResId, ScDocument* pDoc, const ScConditionalFormat* pFormat, const ScRangeList& rRanges, const ScAddress& rPos); + ScCondFormatList( Window* pParent, const ResId& rResId, ScDocument* pDoc, const ScConditionalFormat* pFormat, + const ScRangeList& rRanges, const ScAddress& rPos, condformat::dialog::ScCondFormatDialogType eType); ScConditionalFormat* GetConditionalFormat() const; @@ -188,7 +207,7 @@ private: DECL_LINK( EdRangeModifyHdl, Edit* ); public: - ScCondFormatDlg(Window* pWindow, ScDocument* pDoc, const ScConditionalFormat* pFormat, const ScRangeList& rRange, const ScAddress& rPos); + ScCondFormatDlg(Window* pWindow, ScDocument* pDoc, const ScConditionalFormat* pFormat, const ScRangeList& rRange, const ScAddress& rPos, condformat::dialog::ScCondFormatDialogType eType); ScConditionalFormat* GetConditionalFormat() const; }; diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index c4b21f3..1f970b6 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2065,15 +2065,15 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) { const ScRangeList& rCondFormatRange = pCondFormat->GetRange(); if(rCondFormatRange == aRangeList) - pDlg.reset(pFact->CreateScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, pCondFormat->GetRange(), aPos, RID_SCDLG_CONDFORMAT )); + pDlg.reset(pFact->CreateScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, pCondFormat->GetRange(), aPos, 0 )); } if(!pDlg) { - pDlg.reset(pFact->CreateScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, NULL, aRangeList, aRangeList.GetTopLeftCorner(), RID_SCDLG_CONDFORMAT )); + pDlg.reset(pFact->CreateScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, NULL, aRangeList, aRangeList.GetTopLeftCorner(), nSlot )); } - if(pDlg->Execute() == RET_OK) + if(pDlg && pDlg->Execute() == RET_OK) { ScConditionalFormat* pFormat = pDlg->GetConditionalFormat(); sal_uLong nOldIndex = 0; commit b65e98a6a8be0ad7864eb607087d9b85003e5a1e Author: Markus Mohrhard <[email protected]> Date: Sat Oct 6 02:32:07 2012 +0200 implement the menu strucutre from Astron's proposal Change-Id: I46b751f033f2b4f08461b2eaae8ad16c1487f1c0 diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu index e6767b7..7418498 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu @@ -446,7 +446,17 @@ </node> <node oor:name=".uno:ConditionalFormatDialog" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Conditional Formatting...</value> + <value xml:lang="en-US">Condition...</value> + </prop> + </node> + <node oor:name=".uno:ColorScaleFormatDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Color Scale...</value> + </prop> + </node> + <node oor:name=".uno:DataBarFormatDialog" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Data Bar...</value> </prop> </node> <node oor:name=".uno:ConditionalFormatManagerDialog" oor:op="replace"> diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 51cebf3..e47ee57 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -250,7 +250,9 @@ #define SID_OPENDLG_OPTSOLVER (SC_MESSAGE_START + 60) #define SID_VALIDITY_REFERENCE (SC_MESSAGE_START + 61) #define SID_OPENDLG_CONDFRMT_MANAGER (SC_MESSAGE_START + 62) -#define SC_HINT_NAVIGATOR_UPDATEALL (SC_MESSAGE_START + 65) +#define SC_HINT_NAVIGATOR_UPDATEALL (SC_MESSAGE_START + 65) +#define SID_OPENDLG_COLORSCALE (SC_MESSAGE_START + 66) +#define SID_OPENDLG_DATABAR (SC_MESSAGE_START + 67) // functions diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index 77eea5c..15233b6 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -189,6 +189,8 @@ interface CellSelection SID_CANCEL [ ExecMethod = Execute; ] SID_TOGGLE_REL [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] SID_OPENDLG_CONDFRMT [ ExecMethod = ExecuteEdit; ] + SID_OPENDLG_COLORSCALE [ ExecMethod = ExecuteEdit; ] + SID_OPENDLG_DATABAR [ ExecMethod = ExecuteEdit; ] SID_OPENDLG_CONDFRMT_MANAGER [ ExecMethod = ExecuteEdit; ] SID_COLORSCALE [ ExecMethod = ExecuteEdit; ] SID_DATABAR [ ExecMethod = ExecuteEdit; ] diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index 0350d7d..5b9cda6 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -1094,6 +1094,56 @@ SfxVoidItem ConditionalFormatDialog SID_OPENDLG_CONDFRMT ] //-------------------------------------------------------------------------- +SfxVoidItem ColorScaleFormatDialog SID_OPENDLG_COLORSCALE +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = TRUE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_FORMAT; +] + +//-------------------------------------------------------------------------- +SfxVoidItem DataBarFormatDialog SID_OPENDLG_DATABAR +() +[ + /* flags: */ + AutoUpdate = FALSE, + Cachable = Cachable, + FastCall = FALSE, + HasCoreId = FALSE, + HasDialog = TRUE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + /* config: */ + AccelConfig = TRUE, + MenuConfig = TRUE, + StatusBarConfig = FALSE, + ToolBoxConfig = TRUE, + GroupId = GID_FORMAT; +] + +//-------------------------------------------------------------------------- SfxVoidItem ConditionalFormatManagerDialog SID_OPENDLG_CONDFRMT_MANAGER () [ diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 3d292f6..c4b21f3 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2035,6 +2035,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) break; case SID_OPENDLG_CONDFRMT: + case SID_OPENDLG_COLORSCALE: + case SID_OPENDLG_DATABAR: { ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml index 0bff97c..621586e 100644 --- a/sc/uiconfig/scalc/menubar/menubar.xml +++ b/sc/uiconfig/scalc/menubar/menubar.xml @@ -277,6 +277,8 @@ <menu:menu menu:id=".uno:ConditionalFormatMenu"> <menu:menupopup> <menu:menuitem menu:id=".uno:ConditionalFormatDialog"/> + <menu:menuitem menu:id=".uno:ColorScaleFormatDialog"/> + <menu:menuitem menu:id=".uno:DataBarFormatDialog"/> <menu:menuseparator/> <menu:menuitem menu:id=".uno:ConditionalFormatManagerDialog"/> </menu:menupopup> commit ea89abb435a0175a7c12a6ccb430752393ce4b64 Author: Markus Mohrhard <[email protected]> Date: Sat Oct 6 01:15:10 2012 +0200 onyl show the exisiting cond format if the range is equal Change-Id: I6a183b41261f1813b1cce277f3fe4a276ab07bb0 diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index b468530..3d292f6 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2061,9 +2061,12 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) const ScConditionalFormat* pCondFormat = pDoc->GetCondFormat(aPos.Col(), aPos.Row(), aPos.Tab()); if(pCondFormat) { - pDlg.reset(pFact->CreateScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, pCondFormat->GetRange(), aPos, RID_SCDLG_CONDFORMAT )); + const ScRangeList& rCondFormatRange = pCondFormat->GetRange(); + if(rCondFormatRange == aRangeList) + pDlg.reset(pFact->CreateScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, pCondFormat->GetRange(), aPos, RID_SCDLG_CONDFORMAT )); } - else + + if(!pDlg) { pDlg.reset(pFact->CreateScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, NULL, aRangeList, aRangeList.GetTopLeftCorner(), RID_SCDLG_CONDFORMAT )); } commit 32d8c9b96cef77fd563ca1ab0c3943f783f1b16a Author: Markus Mohrhard <[email protected]> Date: Sat Oct 6 01:13:57 2012 +0200 fix another crash in cond format dialog with range name list Change-Id: I84f9c71fd7f80ad9300f4f7b2c273cd9af0f075e diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 2e294f2..e2f8d67 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -1116,7 +1116,7 @@ ScConditionalFormat* ScCondFormatDlg::GetConditionalFormat() const sal_uInt16 nFlags = aRange.Parse(aRangeStr, mpDoc, SCA_VALID, mpDoc->GetAddressConvention()); ScConditionalFormat* pFormat = maCondFormList.GetConditionalFormat(); - if(nFlags & SCA_VALID && !aRange.empty()) + if(nFlags & SCA_VALID && !aRange.empty() && pFormat) pFormat->AddRange(aRange); return pFormat; _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
