summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-04-09 04:55:48 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-04-09 05:02:01 +0200
commit9c5a8f4c959265a87be67cc9f01e6c73fb556abb (patch)
tree30a8544e1779c78d522c01d518b9aad20fbaf3ed
parent756dd983dd41b0f69bf46c979b9055815bb84f58 (diff)
preserve selection if chart creation is cancelled, cp#1000052
Change-Id: Ia8edb3e4c55e1a52515a761a60c4b1a59c990e1c
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 3faea47f1238..6e9f32fac033 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -453,6 +453,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
// get range
OUString aRangeString;
ScRange aPositionRange; // cell range for chart positioning
+ ScMarkData aMark = pViewSh->GetViewData()->GetMarkData();
if( pReqArgs )
{
const SfxPoolItem* pItem;
@@ -463,15 +464,14 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
}
else
{
- ScMarkData& rMark = pViewSh->GetViewData()->GetMarkData();
bool bAutomaticMark = false;
- if ( !rMark.IsMarked() && !rMark.IsMultiMarked() )
+ if ( !aMark.IsMarked() && !aMark.IsMultiMarked() )
{
pViewSh->GetViewData()->GetView()->MarkDataArea( sal_True );
bAutomaticMark = true;
}
- ScMarkData aMultiMark( rMark );
+ ScMarkData aMultiMark( aMark );
aMultiMark.MarkToMulti();
ScRangeList aRanges;
@@ -741,6 +741,10 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
// leave the draw shell
pViewShell->SetDrawShell( false );
+
+ // reset marked cell area
+
+ pViewSh->GetViewData()->GetViewShell()->SetMarkData(aMark);
}
else
{