[Libreoffice-commits] core.git: 2 commits - sc/source
Markus Mohrhard
markus.mohrhard at collabora.co.uk
Tue Apr 8 20:01:02 PDT 2014
sc/source/filter/orcus/interface.cxx | 16 ++++++++++++++--
sc/source/ui/drawfunc/fuins2.cxx | 10 +++++++---
2 files changed, 21 insertions(+), 5 deletions(-)
New commits:
commit 34669e634d7cb18099e8d27eed10e5b816237411
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed Apr 9 04:55:48 2014 +0200
preserve selection if chart creation is cancelled, cp#1000052
Change-Id: Ia8edb3e4c55e1a52515a761a60c4b1a59c990e1c
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index a369d39..75ab416 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -443,6 +443,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;
@@ -453,15 +454,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( true );
bAutomaticMark = true;
}
- ScMarkData aMultiMark( rMark );
+ ScMarkData aMultiMark( aMark );
aMultiMark.MarkToMulti();
ScRangeList aRanges;
@@ -730,6 +730,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
{
commit d9cde132b5a98dee61e0d0ce228e5008e699f37d
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Tue Apr 8 02:56:13 2014 +0200
add array cell import to orcus import
Change-Id: I4f6dab039389e6b07486162df8bf939b557e7ed8
diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx
index 7a89b62..085a2d6 100644
--- a/sc/source/filter/orcus/interface.cxx
+++ b/sc/source/filter/orcus/interface.cxx
@@ -358,9 +358,21 @@ void ScOrcusSheet::set_shared_formula(os::row_t row, os::col_t col, size_t sinde
}
void ScOrcusSheet::set_array_formula(
- os::row_t /*row*/, os::col_t /*col*/, os::formula_grammar_t /*grammar*/,
- const char* /*p*/, size_t /*n*/, os::row_t /*array_rows*/, os::col_t /*array_cols*/)
+ os::row_t row, os::col_t col, os::formula_grammar_t grammar,
+ const char* p, size_t n, os::row_t array_rows, os::col_t array_cols)
{
+ formula::FormulaGrammar::Grammar eGrammar = getCalcGrammarFromOrcus( grammar );
+ OUString aFormula(p, n, RTL_TEXTENCODING_UTF8);
+
+ ScRange aRange(col, row, mnTab, col+array_cols, row + array_rows, mnTab);
+
+ ScCompiler aComp(&mrDoc.getDoc(), aRange.aStart);
+ aComp.SetGrammar(eGrammar);
+ boost::scoped_ptr<ScTokenArray> pArray(aComp.CompileString(aFormula));
+ if (!pArray)
+ return;
+
+ mrDoc.setMatrixCells(aRange, *pArray, eGrammar);
}
void ScOrcusSheet::set_array_formula(
More information about the Libreoffice-commits
mailing list