diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-11-30 22:19:45 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-11-30 22:19:45 +0100 |
commit | 4026e1824de8ff9b5d006ae6eba491f91bc4e599 (patch) | |
tree | 0ae0292c1904975bf4042fe780615b6ccf882558 | |
parent | a0dcf961879ab644a52f801f65466756cb144b72 (diff) |
prevent uncloseable cond format dlg
-rw-r--r-- | sc/source/ui/view/tabvwshc.cxx | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index 152a940e3a5a..289e60595d02 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -204,30 +204,31 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog( } const ScConditionalFormat* pCondFormat = pDoc->GetCondFormat(aPos.Col(), aPos.Row(), aPos.Tab()); + condformat::dialog::ScCondFormatDialogType eType = condformat::dialog::NONE; + switch(nSlotId) + { + case SID_OPENDLG_CONDFRMT: + eType = condformat::dialog::CONDITION; + break; + case SID_OPENDLG_COLORSCALE: + eType = condformat::dialog::COLORSCALE; + break; + case SID_OPENDLG_DATABAR: + eType = condformat::dialog::DATABAR; + break; + default: + break; + } + if(pCondFormat) { const ScRangeList& rCondFormatRange = pCondFormat->GetRange(); if(rCondFormatRange == aRangeList) - pResult = new ScCondFormatDlg( pB, pCW, pParent, pDoc, pCondFormat, rCondFormatRange, aPos, condformat::dialog::NONE ); + pResult = new ScCondFormatDlg( pB, pCW, pParent, pDoc, pCondFormat, rCondFormatRange, aPos, eType ); } if(!pResult) { - condformat::dialog::ScCondFormatDialogType eType = condformat::dialog::NONE; - switch(nSlotId) - { - case SID_OPENDLG_CONDFRMT: - eType = condformat::dialog::CONDITION; - break; - case SID_OPENDLG_COLORSCALE: - eType = condformat::dialog::COLORSCALE; - break; - case SID_OPENDLG_DATABAR: - eType = condformat::dialog::DATABAR; - break; - default: - break; - } pResult = new ScCondFormatDlg( pB, pCW, pParent, pDoc, NULL, aRangeList, aRangeList.GetTopLeftCorner(), eType ); } } |