[Libreoffice-commits] .: 3 commits - officecfg/registry sc/qa

2012-04-24 Thread Markus Mohrhard
 officecfg/registry/data/org/openoffice/TypeDetection/UISort.xcu |6 -
 sc/qa/unit/ucalc.cxx|   45 
+-
 2 files changed, 47 insertions(+), 4 deletions(-)

New commits:
commit f3d7d6ece96d74e55dc92babfd12812dfe1a4793
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Apr 24 12:06:43 2012 +0200

default to Office 2007/2010 filter for ooxml export, fdo#48941

diff --git a/officecfg/registry/data/org/openoffice/TypeDetection/UISort.xcu 
b/officecfg/registry/data/org/openoffice/TypeDetection/UISort.xcu
index 4593983..e0d569d 100644
--- a/officecfg/registry/data/org/openoffice/TypeDetection/UISort.xcu
+++ b/officecfg/registry/data/org/openoffice/TypeDetection/UISort.xcu
@@ -30,7 +30,7 @@
 node oor:name=ModuleDependendFilterOrder
 node oor:name=com.sun.star.sheet.SpreadsheetDocument 
oor:op=replace install:module=calc
 prop oor:name=SortedFilterList
-value oor:separator=;calc8;calc8_template;StarOffice XML 
(Calc);calc_StarOffice_XML_Calc_Template;Calc Office Open XML;Calc Office Open 
XML Template;OpenDocument Spreadsheet Flat XML;UOF spreadsheet;Calc MS Excel 
2007 XML;Calc MS Excel 2007 XML Template;Calc MS Excel 2007 Binary;MS Excel 
2003 XML;MS Excel 97;MS Excel 97 Vorlage/Template;MS Excel 95;MS Excel 95 
Vorlage/Template;MS Excel 5.0/95;MS Excel 5.0/95 Vorlage/Template;MS Excel 
4.0;MS Excel 4.0 Vorlage/Template;StarCalc 5.0;StarCalc 5.0 
Vorlage/Template;StarCalc 4.0;StarCalc 4.0 Vorlage/Template;StarCalc 
3.0;StarCalc 3.0 Vorlage/Template;StarCalc 1.0;DIF;dBase;HTML 
(StarCalc);Lotus;Pocket Excel;Quattro Pro 6.0;Rich Text Format 
(StarCalc);SYLK;Text - txt - csv (StarCalc);calc_HTML_WebQuery/value
+value oor:separator=;calc8;calc8_template;StarOffice XML 
(Calc);calc_StarOffice_XML_Calc_Template;OpenDocument Spreadsheet Flat XML;UOF 
spreadsheet;Calc MS Excel 2007 XML;Calc MS Excel 2007 XML Template;Calc MS 
Excel 2007 Binary;MS Excel 2003 XML;MS Excel 97;MS Excel 97 Vorlage/Template;MS 
Excel 95;MS Excel 95 Vorlage/Template;MS Excel 5.0/95;MS Excel 5.0/95 
Vorlage/Template;MS Excel 4.0;MS Excel 4.0 Vorlage/Template;StarCalc 
5.0;StarCalc 5.0 Vorlage/Template;StarCalc 4.0;StarCalc 4.0 
Vorlage/Template;StarCalc 3.0;StarCalc 3.0 Vorlage/Template;StarCalc 
1.0;DIF;dBase;HTML (StarCalc);Lotus;Pocket Excel;Quattro Pro 6.0;Rich Text 
Format (StarCalc);SYLK;Text - txt - csv (StarCalc);calc_HTML_WebQuery;Calc 
Office Open XML;Calc Office Open XML Template/value
 /prop
 /node
 node oor:name=com.sun.star.drawing.DrawingDocument oor:op=replace 
install:module=draw 
@@ -40,7 +40,7 @@
 /node
 node oor:name=com.sun.star.presentation.PresentationDocument 
oor:op=replace install:module=impress
 prop oor:name=SortedFilterList
-value 
oor:separator=;impress8;impress8_template;impress8_draw;StarOffice XML 
(Impress);impress_StarOffice_XML_Impress_Template;impress_StarOffice_XML_Draw;Impress
 Office Open XML;Impress Office Open XML AutoPlay;Impress Office Open XML 
Template;OpenDocument Presentation Flat XML;UOF presentation;Impress MS 
PowerPoint 2007 XML;Impress MS PowerPoint 2007 XML AutoPlay;Impress MS 
PowerPoint 2007 XML Template;MS PowerPoint 97;MS PowerPoint 97 AutoPlay;MS 
PowerPoint 97 Vorlage;StarDraw 5.0 (StarImpress);StarDraw 3.0 
(StarImpress);StarImpress 5.0;StarImpress 5.0 Vorlage;StarImpress 5.0 
(packed);StarImpress 4.0;StarImpress 4.0 Vorlage;CGM - Computer Graphics 
Metafile/value
+value 
oor:separator=;impress8;impress8_template;impress8_draw;StarOffice XML 
(Impress);impress_StarOffice_XML_Impress_Template;impress_StarOffice_XML_Draw;OpenDocument
 Presentation Flat XML;UOF presentation;Impress MS PowerPoint 2007 XML;Impress 
MS PowerPoint 2007 XML AutoPlay;Impress MS PowerPoint 2007 XML Template;MS 
PowerPoint 97;MS PowerPoint 97 AutoPlay;MS PowerPoint 97 Vorlage;StarDraw 5.0 
(StarImpress);StarDraw 3.0 (StarImpress);StarImpress 5.0;StarImpress 5.0 
Vorlage;StarImpress 5.0 (packed);StarImpress 4.0;StarImpress 4.0 Vorlage;CGM - 
Computer Graphics Metafile;Impress Office Open XML;Impress Office Open XML 
AutoPlay;Impress Office Open XML Template/value
 /prop
 /node
 node oor:name=com.sun.star.formula.FormulaProperties 
oor:op=replace install:module=math
@@ -55,7 +55,7 @@
 /node
 node oor:name=com.sun.star.text.TextDocument oor:op=replace 
install:module=writer
 prop oor:name=SortedFilterList
-value oor:separator=;writer8;writer8_template;StarOffice 
XML (Writer);writer_StarOffice_XML_Writer_Template;Office Open XML Text;Office 
Open XML Text Template;OpenDocument Text Flat XML;UOF text;MS Word 2007 XML;MS 
Word 2007 XML Template;MS Word 2003 XML;MS Word 97;MS Word 97 Vorlage;MS Word 
95;MS Word 95 Vorlage;MS WinWord 6.0;MS WinWord 5;MS_Works;AportisDoc Palm 
DB;DocBook File;writer_MIZI_Hwp_97;HTML (StarWriter

[Libreoffice-commits] .: sc/qa

2012-04-24 Thread Markus Mohrhard
 sc/qa/unit/ucalc.cxx |   46 ++
 1 file changed, 42 insertions(+), 4 deletions(-)

New commits:
commit f839984910f0fd4ef385552df3af5e09190e15b9
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Apr 25 01:12:48 2012 +0200

add test case for copypaste formulas between documents

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 7662602..d875e42 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -4262,16 +4262,24 @@ void Test::testCopyPasteFormulas()
 
 void Test::testCopyPasteFormulasExternalDoc()
 {
+rtl::OUString aDocName(file:///source.fake);
+SfxMedium* pMedium = new SfxMedium(aDocName, STREAM_STD_READWRITE);
+m_xDocShRef-DoInitNew(pMedium);
+m_pDoc = m_xDocShRef-GetDocument();
+
 ScDocShellRef xExtDocSh = new ScDocShell;
-OUString aExtDocName(RTL_CONSTASCII_USTRINGPARAM(file:///extdata.fake));
-OUString aExtSh1Name(RTL_CONSTASCII_USTRINGPARAM(ExtSheet1));
-OUString aExtSh2Name(RTL_CONSTASCII_USTRINGPARAM(ExtSheet2));
-OUString aExtSh3Name(RTL_CONSTASCII_USTRINGPARAM(ExtSheet3));
+OUString aExtDocName(file:///extdata.fake);
+OUString aExtSh1Name(ExtSheet1);
+OUString aExtSh2Name(ExtSheet2);
 SfxMedium* pMed = new SfxMedium(aExtDocName, STREAM_STD_READWRITE);
 xExtDocSh-DoInitNew(pMed);
 CPPUNIT_ASSERT_MESSAGE(external document instance not loaded.,
findLoadedDocShellByName(aExtDocName) != NULL);
 
+ScDocument* pExtDoc = xExtDocSh-GetDocument();
+pExtDoc-InsertTab(0, aExtSh1Name);
+pExtDoc-InsertTab(1, aExtSh2Name);
+
 m_pDoc-InsertTab(0, Sheet1);
 m_pDoc-InsertTab(1, Sheet2);
 
@@ -4280,7 +4288,37 @@ void Test::testCopyPasteFormulasExternalDoc()
 m_pDoc-SetString(0,2,0, =$Sheet2.A1);
 m_pDoc-SetString(0,3,0, =$Sheet2.$A$1);
 m_pDoc-SetString(0,4,0, =$Sheet2.A$1);
+m_pDoc-SetString(0,5,0, =$Sheet1.$A$1);
+
+ScRange aRange(0,0,0,0,5,0);
+ScClipParam aClipParam(aRange, false);
+ScMarkData aMark;
+aMark.SetMarkArea(aRange);
+ScDocument* pClipDoc = new ScDocument(SCDOCMODE_CLIP);
+m_pDoc-CopyToClip(aClipParam, pClipDoc, aMark);
 
+sal_uInt16 nFlags = IDF_ALL;
+aRange = ScRange(1,1,1,1,6,1);
+ScMarkData aMarkData2;
+aMarkData2.SetMarkArea(aRange);
+pExtDoc-CopyFromClip(aRange, aMarkData2, nFlags, NULL, pClipDoc);
+
+rtl::OUString aFormula;
+pExtDoc-GetFormula(1,1,1, aFormula);
+//adjust absolute refs pointing to the copy area
+CPPUNIT_ASSERT_EQUAL(aFormula, rtl::OUString(=COLUMN($B$2)));
+pExtDoc-GetFormula(1,2,1, aFormula);
+//adjust absolute refs and keep relative refs
+CPPUNIT_ASSERT_EQUAL(aFormula, rtl::OUString(=$B$2+C3));
+pExtDoc-GetFormula(1,3,1, aFormula);
+// make absolute sheet refs external refs
+CPPUNIT_ASSERT_EQUAL(aFormula, 
rtl::OUString(='file:///source.fake'#$Sheet2.B2));
+pExtDoc-GetFormula(1,4,1, aFormula);
+CPPUNIT_ASSERT_EQUAL(aFormula, 
rtl::OUString(='file:///source.fake'#$Sheet2.$A$1));
+pExtDoc-GetFormula(1,5,1, aFormula);
+CPPUNIT_ASSERT_EQUAL(aFormula, 
rtl::OUString(='file:///source.fake'#$Sheet2.B$1));
+pExtDoc-GetFormula(1,6,1, aFormula);
+CPPUNIT_ASSERT_EQUAL(aFormula, rtl::OUString(=$ExtSheet2.$B$2));
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/inc sc/source

2012-04-22 Thread Markus Mohrhard
 sc/inc/tokenarray.hxx |3 ++-
 sc/source/core/data/cell.cxx  |7 ---
 sc/source/core/tool/token.cxx |   14 +++---
 3 files changed, 13 insertions(+), 11 deletions(-)

New commits:
commit bba176a844bd993cf7fe6acce9ff18027870dfa5
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Apr 23 01:15:01 2012 +0200

only update absolute refs when copying between docs, fdo#48482

The copy/paste formulas code is getting a bit complex. I will try to
write some test cases for it.

diff --git a/sc/inc/tokenarray.hxx b/sc/inc/tokenarray.hxx
index 48bf4c5..cc55936 100644
--- a/sc/inc/tokenarray.hxx
+++ b/sc/inc/tokenarray.hxx
@@ -108,8 +108,9 @@ public:
 
 /**
  * Make all absolute references pointing to the copied range if the range 
is copied too
+ * @param bCheckCopyArea should references pointing into the copy area be 
adjusted independently from being absolute, should be true only for copypaste 
between documents
  */
-void AdjustAbsoluteRefs( const ScDocument* pOldDoc, const ScAddress 
rOldPos, const ScAddress rNewPos, bool bRangeName = false );
+void AdjustAbsoluteRefs( const ScDocument* pOldDoc, const ScAddress 
rOldPos, const ScAddress rNewPos, bool bRangeName = false, bool bCheckCopyArea 
= false );
 };
 
 #endif // SC_TOKENARRAY_HXX
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index a4e5361..fd9499b 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -175,7 +175,7 @@ void adjustRangeName(ScToken* pToken, ScDocument rNewDoc, 
const ScDocument* pOl
 if (rNewDoc.GetPool() != const_castScDocument*(pOldDoc)-GetPool())
 {
 pRangeNameToken-ReadjustAbsolute3DReferences(pOldDoc, rNewDoc, 
pRangeData-GetPos(), true);
-pRangeNameToken-AdjustAbsoluteRefs(pOldDoc, aOldPos, aNewPos, 
true);
+pRangeNameToken-AdjustAbsoluteRefs(pOldDoc, aOldPos, aNewPos, 
false, true);
 }
 
 bool bInserted;
@@ -811,12 +811,13 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell rCell, 
ScDocument rDoc, cons
 }
 }
 
-if (pDocument-GetPool() != rCell.pDocument-GetPool())
+bool bCopyBetweenDocs = pDocument-GetPool() != 
rCell.pDocument-GetPool();
+if (bCopyBetweenDocs)
 {
 pCode-ReadjustAbsolute3DReferences( rCell.pDocument, rDoc, 
rCell.aPos);
 }
 
-pCode-AdjustAbsoluteRefs( rCell.pDocument, rCell.aPos, aPos );
+pCode-AdjustAbsoluteRefs( rCell.pDocument, rCell.aPos, aPos, false, 
bCopyBetweenDocs );
 }
 
 if ( nCloneFlags  SC_CLONECELL_ADJUST3DREL )
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 0bbb3d6..dc88df1 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1832,7 +1832,7 @@ bool IsInCopyRange( const ScRange rRange, const 
ScDocument* pClipDoc )
 return rClipParam.maRanges.In(rRange);
 }
 
-bool SkipReference(ScToken* pToken, const ScAddress rPos, const ScDocument* 
pOldDoc, bool bRangeName)
+bool SkipReference(ScToken* pToken, const ScAddress rPos, const ScDocument* 
pOldDoc, bool bRangeName, bool bCheckCopyArea)
 {
 ScRange aRange;
 
@@ -1862,7 +1862,7 @@ bool SkipReference(ScToken* pToken, const ScAddress 
rPos, const ScDocument* pOl
 }
 }
 
-if (IsInCopyRange(aRange, pOldDoc))
+if (bCheckCopyArea  IsInCopyRange(aRange, pOldDoc))
 return true;
 
 return false;
@@ -1894,7 +1894,7 @@ void ScTokenArray::ReadjustAbsolute3DReferences( const 
ScDocument* pOldDoc, cons
 {
 case svDoubleRef :
 {
-if (SkipReference(static_castScToken*(pCode[j]), rPos, 
pOldDoc, bRangeName))
+if (SkipReference(static_castScToken*(pCode[j]), rPos, 
pOldDoc, bRangeName, true))
 continue;
 
 ScComplexRefData rRef = 
static_castScToken*(pCode[j])-GetDoubleRef();
@@ -1915,7 +1915,7 @@ void ScTokenArray::ReadjustAbsolute3DReferences( const 
ScDocument* pOldDoc, cons
 break;
 case svSingleRef :
 {
-if (SkipReference(static_castScToken*(pCode[j]), rPos, 
pOldDoc, bRangeName))
+if (SkipReference(static_castScToken*(pCode[j]), rPos, 
pOldDoc, bRangeName, true))
 continue;
 
 ScSingleRefData rRef = 
static_castScToken*(pCode[j])-GetSingleRef();
@@ -1941,7 +1941,7 @@ void ScTokenArray::ReadjustAbsolute3DReferences( const 
ScDocument* pOldDoc, cons
 }
 }
 
-void ScTokenArray::AdjustAbsoluteRefs( const ScDocument* pOldDoc, const 
ScAddress rOldPos, const ScAddress rNewPos, bool bRangeName)
+void ScTokenArray::AdjustAbsoluteRefs( const ScDocument* pOldDoc, const 
ScAddress rOldPos, const ScAddress rNewPos, bool bRangeName, bool 
bCheckCopyRange)
 {
 for ( sal_uInt16 j=0; jnLen; ++j )
 {
@@ -1949,7 +1949,7 @@ void ScTokenArray::AdjustAbsoluteRefs( const ScDocument

[Libreoffice-commits] .: 2 commits - sc/qa

2012-04-22 Thread Markus Mohrhard
 sc/qa/unit/ucalc.cxx |   23 +--
 1 file changed, 21 insertions(+), 2 deletions(-)

New commits:
commit 7d65dd728ca2b7dea073ef085110dccdf22c2d5c
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Apr 23 02:18:14 2012 +0200

add test case for copy/paste formulas, related fdo#48482

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 07782da..9542320 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -209,6 +209,7 @@ public:
 void testRenameTable();
 
 void testAutoFill();
+void testCopyPasteFormulas();
 
 CPPUNIT_TEST_SUITE(Test);
 CPPUNIT_TEST(testCollator);
@@ -249,6 +250,7 @@ public:
 CPPUNIT_TEST(testSetBackgroundColor);
 CPPUNIT_TEST(testRenameTable);
 CPPUNIT_TEST(testAutoFill);
+CPPUNIT_TEST(testCopyPasteFormulas);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -4221,6 +4223,25 @@ void Test::testAutoFill()
 m_pDoc-DeleteTab(0);
 }
 
+void Test::testCopyPasteFormulas()
+{
+m_pDoc-InsertTab(0, Sheet1);
+m_pDoc-InsertTab(1, Sheet2);
+
+m_pDoc-SetString(0,0,0, =COLUMN($A$1));
+m_pDoc-SetInTest();
+CPPUNIT_ASSERT_DOUBLES_EQUAL(m_pDoc-GetValue(0,0,0), 1.0, 1e-08);
+ScDocFunc rDocFunc = m_xDocShRef-GetDocFunc();
+bool bMoveDone = rDocFunc.MoveBlock(ScRange(0,0,0), ScAddress( 10, 10, 0), 
false, false, false, true);
+
+// check that moving was succesful, mainly for editable tester
+CPPUNIT_ASSERT(bMoveDone);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(m_pDoc-GetValue(10,10,0), 1.0, 1e-8);
+rtl::OUString aFormula;
+m_pDoc-GetFormula(10,10,0, aFormula);
+CPPUNIT_ASSERT_EQUAL(aFormula, rtl::OUString(=COLUMN($A$1)));
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 }
commit 0d3d836ec6541b7a1e0a7fa48195ebb678e2951e
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Apr 23 01:34:47 2012 +0200

I did not want to disable these tests

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index c743e68..07782da 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -211,7 +211,6 @@ public:
 void testAutoFill();
 
 CPPUNIT_TEST_SUITE(Test);
-#if 0
 CPPUNIT_TEST(testCollator);
 CPPUNIT_TEST(testInput);
 CPPUNIT_TEST(testCellFunctions);
@@ -249,7 +248,6 @@ public:
 CPPUNIT_TEST(testJumpToPrecedentsDependents);
 CPPUNIT_TEST(testSetBackgroundColor);
 CPPUNIT_TEST(testRenameTable);
-#endif
 CPPUNIT_TEST(testAutoFill);
 CPPUNIT_TEST_SUITE_END();
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 5 commits - chart2/qa chart2/source sc/inc sc/Module_sc.mk sc/qa sc/source

2012-04-19 Thread Markus Mohrhard
 chart2/qa/unit/data/reference/testChart.xml |  126 ++
 chart2/source/view/main/ChartView.cxx   |2 
 sc/Module_sc.mk |1 
 sc/inc/compiler.hxx |2 
 sc/inc/rangenam.hxx |4 
 sc/qa/extras/regression-test.cxx|   43 +++
 sc/qa/unit/filters-test.cxx |   21 +++
 sc/qa/unit/subsequent_filters-test.cxx  |   21 ---
 sc/source/core/data/table1.cxx  |2 
 sc/source/core/tool/compiler.cxx|7 -
 sc/source/core/tool/rangenam.cxx|8 -
 sc/source/filter/excel/xecontent.cxx|   70 +++-
 sc/source/filter/excel/xeroot.cxx   |2 
 sc/source/filter/excel/xestyle.cxx  |  156 ++--
 sc/source/filter/inc/xecontent.hxx  |4 
 sc/source/filter/inc/xeroot.hxx |5 
 sc/source/filter/inc/xestyle.hxx|   42 +++
 17 files changed, 468 insertions(+), 48 deletions(-)

New commits:
commit 126e58925be1fa76008e5eaebaa8c6893bde879a
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Apr 19 15:50:09 2012 +0200

Revert move testCVE into slowcheck

This reverts commit 97fe16f4dc5582be597971b6e17431b8d353b8ba.

Make Norbert#s tinderbox happy again.

diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index 417b842..de17ced 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -96,6 +96,11 @@ public:
 virtual void setUp();
 virtual void tearDown();
 
+/**
+ * Ensure CVEs remain unbroken
+ */
+void testCVEs();
+
 //ods, xls, xlsx filter tests
 void testRangeNameODS(); // only test ods here, xls and xlsx in 
subsequent_filters-test
 void testContentODS();
@@ -112,6 +117,7 @@ public:
 #endif
 
 CPPUNIT_TEST_SUITE(ScFiltersTest);
+CPPUNIT_TEST(testCVEs);
 CPPUNIT_TEST(testRangeNameODS);
 CPPUNIT_TEST(testContentODS);
 CPPUNIT_TEST(testContentXLS);
@@ -183,6 +189,21 @@ void ScFiltersTest::createCSVPath(const rtl::OUString 
aFileBase, rtl::OUString
 rCSVPath = aBuffer.makeStringAndClear();
 }
 
+void ScFiltersTest::testCVEs()
+{
+testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(Quattro Pro 6.0)),
+getURLFromSrc(/sc/qa/unit/data/qpro/), rtl::OUString());
+
+//warning, the current sylk filter in sc (docsh.cxx) automatically
+//chains on failure on trying as csv, rtf, etc. so success may
+//not indicate that it imported as .slk.
+testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SYLK)),
+getURLFromSrc(/sc/qa/unit/data/slk/), rtl::OUString());
+
+testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(MS Excel 97)),
+getURLFromSrc(/sc/qa/unit/data/xls/), rtl::OUString());
+}
+
 #if TEST_BUG_FILES
 
 void ScFiltersTest::testDir(osl::Directory rDir, sal_uInt32 nType)
diff --git a/sc/qa/unit/subsequent_filters-test.cxx 
b/sc/qa/unit/subsequent_filters-test.cxx
index 8476b85..87697cd 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -96,11 +96,6 @@ public:
 virtual void setUp();
 virtual void tearDown();
 
-/**
- * Ensure CVEs remain unbroken
- */
-void testCVEs();
-
 //ods, xls, xlsx filter tests
 void testRangeNameXLS();
 void testRangeNameXLSX();
@@ -127,7 +122,6 @@ public:
 
 
 CPPUNIT_TEST_SUITE(ScFiltersTest);
-CPPUNIT_TEST(testCVEs);
 CPPUNIT_TEST(testRangeNameXLS);
 CPPUNIT_TEST(testRangeNameXLSX);
 CPPUNIT_TEST(testFunctionsODS);
@@ -234,21 +228,6 @@ void ScFiltersTest::createCSVPath(const rtl::OUString 
aFileBase, rtl::OUString
 rCSVPath = aBuffer.makeStringAndClear();
 }
 
-void ScFiltersTest::testCVEs()
-{
-testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(Quattro Pro 6.0)),
-getURLFromSrc(/sc/qa/unit/data/qpro/), rtl::OUString());
-
-//warning, the current sylk filter in sc (docsh.cxx) automatically
-//chains on failure on trying as csv, rtf, etc. so success may
-//not indicate that it imported as .slk.
-testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SYLK)),
-getURLFromSrc(/sc/qa/unit/data/slk/), rtl::OUString());
-
-testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(MS Excel 97)),
-getURLFromSrc(/sc/qa/unit/data/xls/), rtl::OUString());
-}
-
 namespace {
 
 void testRangeNameImpl(ScDocument* pDoc)
commit 44481da569df85aa91455fdc2892a4e0c5818e6c
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Apr 19 15:41:28 2012 +0200

update relative local range names, fdo#48856

diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 84496b6..b83448b 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -443,7 +443,7 @@ public:
 bool UpdateNameReference( UpdateRefMode eUpdateRefMode,
   const ScRange,
   SCsCOL nDx, SCsROW nDy, SCsTAB nDz

[Libreoffice-commits] .: sc/source

2012-04-19 Thread Markus Mohrhard
 sc/source/filter/excel/xestyle.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9bdb2bc1a0e5a6173ee3517fa64b9eaea46a4ca6
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Apr 19 16:29:17 2012 +0200

fix ambiguous in win build

diff --git a/sc/source/filter/excel/xestyle.cxx 
b/sc/source/filter/excel/xestyle.cxx
index acb746c..01beec6 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1219,7 +1219,7 @@ void XclExpNumFmt::SaveXml( XclExpXmlStream rStrm, const 
String rFormatCode )
 {
 sax_fastparser::FSHelperPtr rStyleSheet = rStrm.GetCurrentStream();
 rStyleSheet-singleElement( XML_numFmt,
-XML_numFmtId,   OString::valueOf( mnXclNumFmt ).getStr(),
+XML_numFmtId,   OString::valueOf( 
static_castsal_Int32(mnXclNumFmt) ).getStr(),
 XML_formatCode, XclXmlUtils::ToOString( rFormatCode ).getStr(),
 FSEND );
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/Module_sc.mk

2012-04-19 Thread Markus Mohrhard
 sc/Module_sc.mk |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 37536c84ab187b8182c5afff912a82746b08b0a8
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Apr 19 17:58:54 2012 +0200

seems there is a difference of one point between clang/gcc in chart test

I need to write a xml diff with configurable tolerance for attributes

diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index a40b0d8..b6a42e1 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -54,7 +54,6 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sc,\
 JunitTest_sc_complex \
 JunitTest_sc_unoapi \
 CppunitTest_sc_cellrangeobj \
-CppunitTest_sc_chart_regression_test \
 $(if $(filter-out $(OS),IOS), \
CppunitTest_sc_databaserangeobj) \
 CppunitTest_sc_datapilottableobj \
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 3 commits - sc/source

2012-04-19 Thread Markus Mohrhard
 sc/source/filter/excel/xecontent.cxx |   19 +++
 sc/source/filter/excel/xeroot.cxx|6 ++
 sc/source/filter/excel/xestyle.cxx   |   26 ++
 3 files changed, 43 insertions(+), 8 deletions(-)

New commits:
commit 503c8fdb1705f0b91e5181b250a6dc94e94e835d
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Apr 20 02:28:55 2012 +0200

export font information into dxf

diff --git a/sc/source/filter/excel/xestyle.cxx 
b/sc/source/filter/excel/xestyle.cxx
index ca608ca..c73a08b 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -28,12 +28,14 @@
 
 #include xestyle.hxx
 
+#include iostream
 #include algorithm
 #include iterator
 #include set
 #include com/sun/star/i18n/ScriptType.hpp
 #include vcl/font.hxx
 #include svl/zformat.hxx
+#include svl/itempool.hxx
 #include svl/languageoptions.hxx
 #include sfx2/printer.hxx
 #include scitems.hxx
@@ -2878,9 +2880,16 @@ XclExpDxfs::XclExpDxfs( const XclExpRoot rRoot )
 delete pCellArea;
 pCellArea = NULL;
 }
-//XclExpFont* pFont = new XclExpFont( GetRoot(), 
XclFontData( rFont ), EXC_COLOR_CELLTEXT );
 
-maDxf.push_back(new XclExpDxf( rRoot, pAlign, pBorder, 
NULL, NULL, pCellProt, pCellArea ));
+XclExpFont* pFont = NULL;
+// check if non default font is set and only export then
+if (rSet.GetItemState(rSet.GetPool()-GetWhich( 
SID_ATTR_CHAR_FONT ))SFX_ITEM_DEFAULT )
+{
+Font aFont = XclExpFontHelper::GetFontFromItemSet( 
GetRoot(), rSet, com::sun::star::i18n::ScriptType::WEAK );
+pFont = new XclExpFont( GetRoot(), XclFontData( aFont 
), EXC_COLOR_CELLTEXT );
+}
+
+maDxf.push_back(new XclExpDxf( rRoot, pAlign, pBorder, 
pFont, NULL, pCellProt, pCellArea ));
 ++nIndex;
 }
 
commit e878c9bba31386cbdb9caca3cbc588a25dc1ae1e
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Apr 20 00:12:20 2012 +0200

allow more complex conditional formats being exported to xlsx

diff --git a/sc/source/filter/excel/xecontent.cxx 
b/sc/source/filter/excel/xecontent.cxx
index 3deb48a..8dfe1cb 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -783,7 +783,7 @@ void XclExpCFImpl::WriteBody( XclExpStream rStrm )
 
 namespace {
 
-const char* GetOperatorString(ScConditionMode eMode)
+const char* GetOperatorString(ScConditionMode eMode, bool bFrmla2)
 {
 switch(eMode)
 {
@@ -800,8 +800,10 @@ const char* GetOperatorString(ScConditionMode eMode)
 case SC_COND_NOTEQUAL:
 return notEqual;
 case SC_COND_BETWEEN:
+bFrmla2 = true;
 return between;
 case SC_COND_NOTBETWEEN:
+bFrmla2 = true;
 return notBetween;
 case SC_COND_DUPLICATE:
 case SC_COND_NOTDUPLICATE:
@@ -814,8 +816,10 @@ const char* GetOperatorString(ScConditionMode eMode)
 return ;
 }
 
-const char* GetTypeString()
+const char* GetTypeString(ScConditionMode eMode)
 {
+if (eMode == SC_COND_DIRECT)
+return expression;
 return cellIs;
 }
 
@@ -823,15 +827,18 @@ const char* GetTypeString()
 
 void XclExpCFImpl::SaveXml( XclExpXmlStream rStrm )
 {
+bool bFmla2 = false;
 sax_fastparser::FSHelperPtr rWorksheet = rStrm.GetCurrentStream();
 rWorksheet-startElement( XML_cfRule,
-XML_type, GetTypeString(),
+XML_type, GetTypeString( mrFormatEntry.GetOperation() ),
 XML_priority, OString::valueOf( mnPriority + 1 ).getStr(),
-XML_operator, GetOperatorString( mrFormatEntry.GetOperation() ),
+XML_operator, GetOperatorString( mrFormatEntry.GetOperation(), 
bFmla2 ),
 XML_dxfId, OString::valueOf( GetDxfs().GetDxfId( 
mrFormatEntry.GetStyle() ) ).getStr(),
 FSEND );
 rWorksheet-startElement( XML_formula, FSEND );
 rWorksheet-write(XclXmlUtils::ToOUString( GetRoot().GetDoc(), 
mrFormatEntry.GetValidSrcPos(), mrFormatEntry.CreateTokenArry( 0 ) ));
+if (bFmla2)
+rWorksheet-write(XclXmlUtils::ToOUString( GetRoot().GetDoc(), 
mrFormatEntry.GetValidSrcPos(), mrFormatEntry.CreateTokenArry( 1 ) ));
 rWorksheet-endElement( XML_formula );
 // OOXTODO: XML_extLst
 rWorksheet-endElement( XML_cfRule );
commit f6a940ad1771016021a75c41a0e9be1e86843fb9
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Apr 19 23:09:58 2012 +0200

export conditional formatting to xlsx, fdo#48360

This is not yet perfect but should export already the conditional
formatting and a great deal of the styles to xlsx

Still missing:

font export
number format export
some advanced conditional formats features

diff --git

[Libreoffice-commits] .: 4 commits - sc/inc sc/Module_sc.mk sc/qa sc/source test/inc test/Library_subsequenttest.mk test/Package_inc.mk test/source

2012-04-17 Thread Markus Mohrhard
 sc/Module_sc.mk   |1 
 sc/inc/tokenuno.hxx   |2 
 sc/qa/extras/sctablesheetobj.cxx  |6 ++
 sc/qa/unit/data/contentCSV/shared-formula.csv |9 +++
 sc/qa/unit/data/xlsx/shared-formula.xlsx  |binary
 sc/qa/unit/subsequent_filters-test.cxx|   32 +
 sc/source/filter/inc/defnamesbuffer.hxx   |4 -
 sc/source/filter/inc/sheetdatabuffer.hxx  |1 
 sc/source/filter/inc/workbookhelper.hxx   |7 +-
 sc/source/filter/oox/defnamesbuffer.cxx   |   24 +-
 sc/source/filter/oox/sheetdatabuffer.cxx  |   10 +---
 sc/source/filter/oox/workbookhelper.cxx   |   29 +---
 test/Library_subsequenttest.mk|1 
 test/Package_inc.mk   |1 
 test/inc/test/sheet/xprintareas.hxx   |   59 +
 test/source/sheet/xprintareas.cxx |   61 ++
 16 files changed, 206 insertions(+), 41 deletions(-)

New commits:
commit 32bd4c6c4b2ff3835cfb7af50e88be6004dd7852
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Apr 17 20:58:05 2012 +0200

enable sctablesheetobj again

diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index 8f51646..b6a42e1 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -61,6 +61,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sc,\
 CppunitTest_sc_macros_test \
 CppunitTest_sc_namedrangeobj \
 CppunitTest_sc_namedrangesobj \
+CppunitTest_sc_tablesheetobj \
 CppunitTest_sc_tablesheetsobj \
 ))
 
commit a48195f4c24cd20a79514b608a1eae40baff9ed1
Author: Artur Dorda artur.dorda+l...@gmail.com
Date:   Sun Apr 15 02:20:16 2012 +0200

transferring java XPrintAreas to c++

diff --git a/sc/qa/extras/sctablesheetobj.cxx b/sc/qa/extras/sctablesheetobj.cxx
index 0f1d79a..28b4d2b 100644
--- a/sc/qa/extras/sctablesheetobj.cxx
+++ b/sc/qa/extras/sctablesheetobj.cxx
@@ -29,6 +29,7 @@
 #include test/unoapi_test.hxx
 #include test/util/xreplaceable.hxx
 #include test/util/xsearchable.hxx
+#include test/sheet/xprintareas.hxx
 
 #include com/sun/star/sheet/XSpreadsheetDocument.hpp
 #include com/sun/star/sheet/XSpreadsheet.hpp
@@ -36,7 +37,7 @@
 namespace sc_apitest
 {
 
-class ScTableSheetObj : public UnoApiTest, apitest::XSearchable, 
apitest::XReplaceable
+class ScTableSheetObj : public UnoApiTest, apitest::XSearchable, 
apitest::XReplaceable, apitest::XPrintAreas
 {
 public:
 ScTableSheetObj();
@@ -49,6 +50,9 @@ public:
 CPPUNIT_TEST(testFindFirst);
 CPPUNIT_TEST(testReplaceAll);
 CPPUNIT_TEST(testCreateReplaceDescriptor);
+// XPrintAreas
+CPPUNIT_TEST(testSetAndGetPrintTitleColumns);
+CPPUNIT_TEST(testSetAndGetPrintTitleRows);
 CPPUNIT_TEST_SUITE_END();
 
 private:
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 070c6d1..7d865f8 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -79,6 +79,7 @@ $(eval $(call 
gb_Library_add_exception_objects,subsequenttest,\
 test/source/sheet/xdatapilottable2 \
 test/source/sheet/xnamedrange \
 test/source/sheet/xnamedranges \
+test/source/sheet/xprintareas \
 test/source/sheet/xspreadsheetdocument \
 test/source/sheet/xspreadsheets2 \
 test/source/util/xreplaceable \
diff --git a/test/Package_inc.mk b/test/Package_inc.mk
index 62c3fa4..160d7b0 100644
--- a/test/Package_inc.mk
+++ b/test/Package_inc.mk
@@ -46,6 +46,7 @@ $(eval $(call 
gb_Package_add_file,test_inc,inc/test/sheet/xdatapilottable.hxx,te
 $(eval $(call 
gb_Package_add_file,test_inc,inc/test/sheet/xdatapilottable2.hxx,test/sheet/xdatapilottable2.hxx))
 $(eval $(call 
gb_Package_add_file,test_inc,inc/test/sheet/xdatapilotfieldgrouping.hxx,test/sheet/xdatapilotfieldgrouping.hxx))
 $(eval $(call 
gb_Package_add_file,test_inc,inc/test/sheet/datapilotfield.hxx,test/sheet/datapilotfield.hxx))
+$(eval $(call 
gb_Package_add_file,test_inc,inc/test/sheet/xprintareas.hxx,test/sheet/xprintareas.hxx))
 $(eval $(call 
gb_Package_add_file,test_inc,inc/test/sheet/xspreadsheetdocument.hxx,test/sheet/xspreadsheetdocument.hxx))
 $(eval $(call 
gb_Package_add_file,test_inc,inc/test/sheet/xspreadsheets2.hxx,test/sheet/xspreadsheets2.hxx))
 $(eval $(call 
gb_Package_add_file,test_inc,inc/test/util/xreplaceable.hxx,test/util/xreplaceable.hxx))
diff --git a/test/inc/test/sheet/xprintareas.hxx 
b/test/inc/test/sheet/xprintareas.hxx
new file mode 100644
index 000..08f5348
--- /dev/null
+++ b/test/inc/test/sheet/xprintareas.hxx
@@ -0,0 +1,59 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the License); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http

[Libreoffice-commits] .: sc/source

2012-04-17 Thread Markus Mohrhard
 sc/source/filter/oox/workbookhelper.cxx |   32 ++--
 1 file changed, 18 insertions(+), 14 deletions(-)

New commits:
commit e5322f13e0d433a7103edbf36cd3d2ab0d3e18c7
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Apr 17 22:10:10 2012 +0200

some more uno removement in oox range name import

diff --git a/sc/source/filter/oox/workbookhelper.cxx 
b/sc/source/filter/oox/workbookhelper.cxx
index 83c67bd..6e5dce8 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -401,29 +401,33 @@ ScRangeData* WorkbookGlobals::createNamedRangeObject( 
OUString orName, const Se
 return pScRangeData;
 }
 
+namespace {
+
+rtl::OUString findUnusedName( const ScRangeName* pRangeName, const 
rtl::OUString rSuggestedName )
+{
+rtl::OUString aNewName = rSuggestedName;
+sal_Int32 nIndex = 0;
+
while(pRangeName-findByUpperName(ScGlobal::pCharClass-uppercase(aNewName)))
+aNewName = rtl::OUStringBuffer(rSuggestedName).append( '_' ).append( 
nIndex++ ).makeStringAndClear();
+
+return aNewName;
+}
+
+}
+
 ScRangeData* WorkbookGlobals::createLocalNamedRangeObject( OUString orName, 
const Sequence FormulaToken   rTokens, sal_Int32 nIndex, sal_Int32 
nNameFlags, sal_Int32 nTab ) const
 {
 // create the name and insert it into the Calc document
 ScRangeData* pScRangeData = NULL;
-if( !orName.isEmpty() ) try
+if( !orName.isEmpty() )
 {
-// find an unused name
-Reference XIndexAccess  xSheets(mxDoc-getSheets(), UNO_QUERY_THROW);
-Reference XSpreadsheet  xSheet (xSheets-getByIndex(nTab), 
UNO_QUERY_THROW);
-Reference com::sun::star::container::XNamed  xNamed(xSheet, 
UNO_QUERY_THROW);
-rtl::OUString aName = xNamed-getName();
-PropertySet aSheetProps( xSheet );
-Reference XNamedRanges  xNamedRanges( aSheetProps.getAnyProperty( 
PROP_NamedRanges ), UNO_QUERY_THROW );
-Reference XNameAccess  xNameAccess( xNamedRanges, UNO_QUERY_THROW );
-orName = ContainerHelper::getUnusedName( xNameAccess, orName, '_' );
-// create the named range
 ScDocument rDoc =  getScDocument();
 ScRangeName* pNames = rDoc.GetRangeName( nTab );
+// find an unused name
+orName = findUnusedName( pNames, orName );
+// create the named range
 pScRangeData = lcl_addNewByNameAndTokens( rDoc, pNames, orName, 
rTokens, nIndex, nNameFlags );
 }
-catch (const Exception)
-{
-}
 return pScRangeData;
 }
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-04-17 Thread Markus Mohrhard
 sc/source/filter/oox/workbookhelper.cxx |   39 +---
 1 file changed, 17 insertions(+), 22 deletions(-)

New commits:
commit cbcf7e32ade5b5402845e14065476f5423351ebf
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Apr 17 22:23:08 2012 +0200

forgot the normal range names

diff --git a/sc/source/filter/oox/workbookhelper.cxx 
b/sc/source/filter/oox/workbookhelper.cxx
index 6e5dce8..1110ebc 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -379,28 +379,6 @@ ScRangeData* lcl_addNewByNameAndTokens( ScDocument rDoc, 
ScRangeName* pNames, c
 return pNew;
 }
 
-ScRangeData* WorkbookGlobals::createNamedRangeObject( OUString orName, const 
Sequence FormulaToken rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags ) const
-{
-// create the name and insert it into the Calc document
-ScRangeData* pScRangeData = NULL;
-if( !orName.isEmpty() ) try
-{
-// find an unused name
-PropertySet aDocProps( mxDoc );
-Reference XNamedRanges  xNamedRanges( aDocProps.getAnyProperty( 
PROP_NamedRanges ), UNO_QUERY_THROW );
-Reference XNameAccess  xNameAccess( xNamedRanges, UNO_QUERY_THROW );
-orName = ContainerHelper::getUnusedName( xNameAccess, orName, '_' );
-// create the named range
-ScDocument rDoc =  getScDocument();
-ScRangeName* pNames = rDoc.GetRangeName();
-pScRangeData = lcl_addNewByNameAndTokens( rDoc, pNames, orName, 
rTokens, nIndex, nNameFlags );
-}
-catch (const Exception)
-{
-}
-return pScRangeData;
-}
-
 namespace {
 
 rtl::OUString findUnusedName( const ScRangeName* pRangeName, const 
rtl::OUString rSuggestedName )
@@ -415,6 +393,23 @@ rtl::OUString findUnusedName( const ScRangeName* 
pRangeName, const rtl::OUString
 
 }
 
+ScRangeData* WorkbookGlobals::createNamedRangeObject( OUString orName, const 
Sequence FormulaToken rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags ) const
+{
+// create the name and insert it into the Calc document
+ScRangeData* pScRangeData = NULL;
+if( !orName.isEmpty() )
+{
+ScDocument rDoc =  getScDocument();
+ScRangeName* pNames = rDoc.GetRangeName();
+// find an unused name
+orName = findUnusedName( pNames, orName );
+// create the named range
+pScRangeData = lcl_addNewByNameAndTokens( rDoc, pNames, orName, 
rTokens, nIndex, nNameFlags );
+}
+return pScRangeData;
+}
+
+
 ScRangeData* WorkbookGlobals::createLocalNamedRangeObject( OUString orName, 
const Sequence FormulaToken   rTokens, sal_Int32 nIndex, sal_Int32 
nNameFlags, sal_Int32 nTab ) const
 {
 // create the name and insert it into the Calc document
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/inc

2012-04-15 Thread Markus Mohrhard
 sc/inc/conditio.hxx |7 ---
 1 file changed, 7 deletions(-)

New commits:
commit e7b440a0afd700cfeed5418ad85a874ecae24100
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Apr 15 15:04:15 2012 +0200

remove no longer used enumeration

diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index 2567f79..66db567 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -66,13 +66,6 @@ enum ScConditionMode
 SC_COND_NONE
 };
 
-enum ScConditionValType
-{
-SC_VAL_VALUE,
-SC_VAL_STRING,
-SC_VAL_FORMULA
-};
-
 class ScConditionalFormat;
 
 class SC_DLLPUBLIC ScConditionEntry
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - sc/qa

2012-04-14 Thread Markus Mohrhard
 sc/qa/unit/filters-test.cxx|   21 -
 sc/qa/unit/subsequent_filters-test.cxx |   21 +
 sc/qa/unit/ucalc.cxx   |   23 ++-
 3 files changed, 43 insertions(+), 22 deletions(-)

New commits:
commit d8ff1a579ff5ac9250aa052ef1a17fce51959cb0
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Apr 13 17:18:14 2012 +0200

improve autofill test case

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 130ad67..78fe168 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -4179,7 +4179,28 @@ void Test::testAutoFill()
 for (SCROW i = 3; i 8; ++i)
 CPPUNIT_ASSERT_DOUBLES_EQUAL(static_castdouble(i-1.0), 
m_pDoc-GetValue(0, i, 0), 0.0001);
 
-
+m_pDoc-Fill( 0, 0, 0, 8, NULL, aMarkData, 5, FILL_TO_RIGHT );
+for (SCCOL i = 0; i  5; ++i)
+{
+for(SCROW j = 0; j  8; ++j)
+{
+if (j  2)
+{
+CPPUNIT_ASSERT_DOUBLES_EQUAL(static_castdouble(j-1+i), 
m_pDoc-GetValue(i, j, 0), 1e-8);
+}
+else if (j == 0)
+{
+CPPUNIT_ASSERT_DOUBLES_EQUAL(static_castdouble(i+1), 
m_pDoc-GetValue(i, 0, 0), 1e-8);
+}
+else if (j == 1 || j== 2)
+{
+if(i == 0)
+CPPUNIT_ASSERT_DOUBLES_EQUAL(10.0, 
m_pDoc-GetValue(0,j,0), 1e-8);
+else
+CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, m_pDoc-GetValue(i,j,0), 
1e-8);
+}
+}
+}
 
 
 m_pDoc-DeleteTab(0);
commit 97fe16f4dc5582be597971b6e17431b8d353b8ba
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Apr 13 17:04:46 2012 +0200

move testCVE into slowcheck

speed up rebuild of sc

diff --git a/sc/qa/unit/filters-test.cxx b/sc/qa/unit/filters-test.cxx
index de17ced..417b842 100644
--- a/sc/qa/unit/filters-test.cxx
+++ b/sc/qa/unit/filters-test.cxx
@@ -96,11 +96,6 @@ public:
 virtual void setUp();
 virtual void tearDown();
 
-/**
- * Ensure CVEs remain unbroken
- */
-void testCVEs();
-
 //ods, xls, xlsx filter tests
 void testRangeNameODS(); // only test ods here, xls and xlsx in 
subsequent_filters-test
 void testContentODS();
@@ -117,7 +112,6 @@ public:
 #endif
 
 CPPUNIT_TEST_SUITE(ScFiltersTest);
-CPPUNIT_TEST(testCVEs);
 CPPUNIT_TEST(testRangeNameODS);
 CPPUNIT_TEST(testContentODS);
 CPPUNIT_TEST(testContentXLS);
@@ -189,21 +183,6 @@ void ScFiltersTest::createCSVPath(const rtl::OUString 
aFileBase, rtl::OUString
 rCSVPath = aBuffer.makeStringAndClear();
 }
 
-void ScFiltersTest::testCVEs()
-{
-testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(Quattro Pro 6.0)),
-getURLFromSrc(/sc/qa/unit/data/qpro/), rtl::OUString());
-
-//warning, the current sylk filter in sc (docsh.cxx) automatically
-//chains on failure on trying as csv, rtf, etc. so success may
-//not indicate that it imported as .slk.
-testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SYLK)),
-getURLFromSrc(/sc/qa/unit/data/slk/), rtl::OUString());
-
-testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(MS Excel 97)),
-getURLFromSrc(/sc/qa/unit/data/xls/), rtl::OUString());
-}
-
 #if TEST_BUG_FILES
 
 void ScFiltersTest::testDir(osl::Directory rDir, sal_uInt32 nType)
diff --git a/sc/qa/unit/subsequent_filters-test.cxx 
b/sc/qa/unit/subsequent_filters-test.cxx
index 1d8a8b6..f2ed04b 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -93,6 +93,11 @@ public:
 virtual void setUp();
 virtual void tearDown();
 
+/**
+ * Ensure CVEs remain unbroken
+ */
+void testCVEs();
+
 //ods, xls, xlsx filter tests
 void testRangeNameXLS();
 void testRangeNameXLSX();
@@ -115,6 +120,7 @@ public:
 
 
 CPPUNIT_TEST_SUITE(ScFiltersTest);
+CPPUNIT_TEST(testCVEs);
 CPPUNIT_TEST(testRangeNameXLS);
 CPPUNIT_TEST(testRangeNameXLSX);
 CPPUNIT_TEST(testFunctionsODS);
@@ -216,6 +222,21 @@ void ScFiltersTest::createCSVPath(const rtl::OUString 
aFileBase, rtl::OUString
 rCSVPath = aBuffer.makeStringAndClear();
 }
 
+void ScFiltersTest::testCVEs()
+{
+testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(Quattro Pro 6.0)),
+getURLFromSrc(/sc/qa/unit/data/qpro/), rtl::OUString());
+
+//warning, the current sylk filter in sc (docsh.cxx) automatically
+//chains on failure on trying as csv, rtf, etc. so success may
+//not indicate that it imported as .slk.
+testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SYLK)),
+getURLFromSrc(/sc/qa/unit/data/slk/), rtl::OUString());
+
+testDir(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(MS Excel 97)),
+getURLFromSrc(/sc/qa/unit/data/xls/), rtl::OUString());
+}
+
 namespace {
 
 void testRangeNameImpl(ScDocument* pDoc)
___
Libreoffice-commits mailing list

[Libreoffice-commits] .: sc/CppunitTest_sc_filters_test.mk

2012-04-14 Thread Markus Mohrhard
 sc/CppunitTest_sc_filters_test.mk |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7ad0f3a4139f7cfde39222cc575e86f3d3343896
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sat Apr 14 14:48:14 2012 +0200

blind fix for Norbert's tinderbox

diff --git a/sc/CppunitTest_sc_filters_test.mk 
b/sc/CppunitTest_sc_filters_test.mk
index df24d15..da56cb8 100644
--- a/sc/CppunitTest_sc_filters_test.mk
+++ b/sc/CppunitTest_sc_filters_test.mk
@@ -118,7 +118,7 @@ $(eval $(call 
gb_CppunitTest_use_components,sc_filters_test,\
 unoxml/source/service/unoxml \
 ))
 
-$(eval $(call gb_CppunitTest_use_configuration,sc_filters_test))
+$(eval $(call gb_CppunitTest_use_filter_configuration,sc_filters_test))
 
 $(eval $(call gb_CppunitTest_use_filter_configuration,sc_filters_test))
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/CppunitTest_sc_filters_test.mk

2012-04-14 Thread Markus Mohrhard
 sc/CppunitTest_sc_filters_test.mk |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3bdb2288957120cc4bd958c36a4d4db22e7343f0
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sat Apr 14 15:34:20 2012 +0200

Revert blind fix for Norbert's tinderbox

This reverts commit 7ad0f3a4139f7cfde39222cc575e86f3d3343896.

diff --git a/sc/CppunitTest_sc_filters_test.mk 
b/sc/CppunitTest_sc_filters_test.mk
index da56cb8..df24d15 100644
--- a/sc/CppunitTest_sc_filters_test.mk
+++ b/sc/CppunitTest_sc_filters_test.mk
@@ -118,7 +118,7 @@ $(eval $(call 
gb_CppunitTest_use_components,sc_filters_test,\
 unoxml/source/service/unoxml \
 ))
 
-$(eval $(call gb_CppunitTest_use_filter_configuration,sc_filters_test))
+$(eval $(call gb_CppunitTest_use_configuration,sc_filters_test))
 
 $(eval $(call gb_CppunitTest_use_filter_configuration,sc_filters_test))
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 4 commits - sal/inc sc/qa sc/source

2012-04-14 Thread Markus Mohrhard
 sal/inc/rtl/math.hxx   |   13 +
 sc/qa/unit/ucalc.cxx   |   19 ++-
 sc/source/core/data/table4.cxx |   22 +++---
 3 files changed, 50 insertions(+), 4 deletions(-)

New commits:
commit 89986db6d5033181324e595032b8d3879d41a705
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Apr 15 01:24:17 2012 +0200

add test case for autofill with user defined lists

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 78fe168..c743e68 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -211,6 +211,7 @@ public:
 void testAutoFill();
 
 CPPUNIT_TEST_SUITE(Test);
+#if 0
 CPPUNIT_TEST(testCollator);
 CPPUNIT_TEST(testInput);
 CPPUNIT_TEST(testCellFunctions);
@@ -248,6 +249,7 @@ public:
 CPPUNIT_TEST(testJumpToPrecedentsDependents);
 CPPUNIT_TEST(testSetBackgroundColor);
 CPPUNIT_TEST(testRenameTable);
+#endif
 CPPUNIT_TEST(testAutoFill);
 CPPUNIT_TEST_SUITE_END();
 
@@ -4202,7 +4204,22 @@ void Test::testAutoFill()
 }
 }
 
-
+// test auto fill user data lists
+m_pDoc-SetString( 0, 100, 0, January );
+m_pDoc-Fill( 0, 100, 0, 100, NULL, aMarkData, 2, FILL_TO_BOTTOM, 
FILL_AUTO );
+rtl::OUString aTestValue = m_pDoc-GetString( 0, 101, 0 );
+CPPUNIT_ASSERT_EQUAL( aTestValue, rtl::OUString(February) );
+aTestValue = m_pDoc-GetString( 0, 102, 0 );
+CPPUNIT_ASSERT_EQUAL( aTestValue, rtl::OUString(March) );
+
+// test that two same user data list entries will not result in 
incremental fill
+m_pDoc-SetString( 0, 101, 0, January );
+m_pDoc-Fill( 0, 100, 0, 101, NULL, aMarkData, 2, FILL_TO_BOTTOM, 
FILL_AUTO );
+for ( SCROW i = 102; i = 103; ++i )
+{
+aTestValue = m_pDoc-GetString( 0, i, 0 );
+CPPUNIT_ASSERT_EQUAL( aTestValue, rtl::OUString(January) );
+}
 m_pDoc-DeleteTab(0);
 }
 
commit 5af699cf62b2313980add377a777c49dc1e7ae2a
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Apr 15 00:11:08 2012 +0200

don't deduce increment from multiple equal list entries, fdo#39500

diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index d15a74e..cced07c 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -342,6 +342,22 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL 
nCol2, SCROW nRow2,
 {
 rtl::OUString aStr;
 GetString(nCol, nRow, aStr);
+
+// fdo#39500 don't deduce increment from multiple equal list entries
+bool bAllSame = true;
+for (sal_uInt16 i = 0; i  nCount; ++i)
+{
+rtl::OUString aTestStr;
+GetString(static_castSCCOL(nCol + i* nAddX), 
static_castSCROW(nRow + i * nAddY), aTestStr);
+if(aStr != aTestStr)
+{
+bAllSame = false;
+break;
+}
+}
+if(bAllSame  nCount  1)
+return;
+
 rListData = (ScUserListData*)(ScGlobal::GetUserList()-GetData(aStr));
 if (rListData)
 {
commit cc94996d96ea8d8e3d136af66846707f9b838bbf
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sat Apr 14 21:00:19 2012 +0200

autofill increment needs a bit more tolerance, fdo#37424

diff --git a/sal/inc/rtl/math.hxx b/sal/inc/rtl/math.hxx
index 2018308..8f4991a 100644
--- a/sal/inc/rtl/math.hxx
+++ b/sal/inc/rtl/math.hxx
@@ -263,6 +263,19 @@ inline bool approxEqual(double a, double b)
  ((a  0.0 ? -a : a) * (1.0 / (16777216.0 * 16777216.0)));
 }
 
+/** Test equality of two values with an accuracy defined by nPrec
+
+@attention
+approxEqual( value!=0.0, 0.0 ) _never_ yields true.
+ */
+inline bool approxEqual(double a, double b, sal_Int16 nPrec)
+{
+if ( a == b )
+return true;
+double x = a - b;
+return (x  0.0 ? -x : x)
+ ((a  0.0 ? -a : a) * (1.0 / (pow(2, nPrec;
+}
 /** Add two values.
 
 If signs differ and the absolute values are equal according to 
approxEqual()
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index a632cf8..d15a74e 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -324,7 +324,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL 
nCol2, SCROW nRow2,
 {
 nVal2 = ((ScValueCell*)pCell)-GetValue();
 double nDiff = nVal2 - nVal1;
-if ( !::rtl::math::approxEqual( nDiff, rInc ) )
+if ( !::rtl::math::approxEqual( nDiff, rInc, 13 ) )
 bVal = false;
 nVal1 = nVal2;
 }
@@ -395,7 +395,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL 
nCol2, SCROW nRow2,
 if ( nFlag1 == nFlag2 )
 {
 double nDiff = (double)nVal2 - (double)nVal1

[Libreoffice-commits] .: sal/inc

2012-04-14 Thread Markus Mohrhard
 sal/inc/rtl/math.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4d804a0052fe661603bc8280bfa541a7b0a302ae
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Apr 15 02:18:37 2012 +0200

fix ambiguous call on windows

diff --git a/sal/inc/rtl/math.hxx b/sal/inc/rtl/math.hxx
index 8f4991a..40eba50 100644
--- a/sal/inc/rtl/math.hxx
+++ b/sal/inc/rtl/math.hxx
@@ -274,7 +274,7 @@ inline bool approxEqual(double a, double b, sal_Int16 nPrec)
 return true;
 double x = a - b;
 return (x  0.0 ? -x : x)
- ((a  0.0 ? -a : a) * (1.0 / (pow(2, nPrec;
+ ((a  0.0 ? -a : a) * (1.0 / (pow(static_castdouble(2.0), 
nPrec;
 }
 /** Add two values.
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 5 commits - chart2/source sc/inc sc/source xmloff/source

2012-04-11 Thread Markus Mohrhard
::getErrorLabeledDataSequenceFromDataSource(
 xErrorSource,
 /* bPositiveValue = */ false,
-/* bYError = */ false ));
-if( xErrorLSequence.is())
-aSequences.push_back( xErrorLSequence );
-
-// y error bars
-// 
-xErrorSource.set(
-StatisticsHelper::getErrorBars( xDataSeries, /* bYError = */ true 
), uno::UNO_QUERY );
-
-// positive y error bars
-xErrorLSequence.set(
-StatisticsHelper::getErrorLabeledDataSequenceFromDataSource(
-xErrorSource,
-/* bPositiveValue = */ true,
-/* bYError = */ true ));
+bYError ));
 if( xErrorLSequence.is())
 aSequences.push_back( xErrorLSequence );
 
-// negative y error bars
-xErrorLSequence.set(
-StatisticsHelper::getErrorLabeledDataSequenceFromDataSource(
-xErrorSource,
-/* bPositiveValue = */ false,
-/* bYError = */ true ));
-if( xErrorLSequence.is())
-aSequences.push_back( xErrorLSequence );
-
-
 for( ::std::vector Reference chart2::data::XLabeledDataSequence  
::const_iterator aIt( aSequences.begin());
  aIt != aSequences.end(); ++aIt )
 {
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.hxx 
b/chart2/source/controller/dialogs/DataBrowserModel.hxx
index ee48fa0..7d6e99a 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.hxx
+++ b/chart2/source/controller/dialogs/DataBrowserModel.hxx
@@ -159,7 +159,7 @@ private:
 ::com::sun::star::chart2::XDataSeries   xDataSeries,
 sal_Int32 nNumberFormatKey,
 sal_Int32  rInOutSequenceIndex,
-sal_Int32  rInOutHeaderEnd );
+sal_Int32  rInOutHeaderEnd, bool bYError );
 
 sal_Int32 getCategoryColumnCount();
 
commit 883d20c5eb68893c73ab2fd5d3bfee528d0a02d1
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Apr 11 09:28:54 2012 +0200

move ScProgress outside of ScTable::Fill

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 99bbc54..42b2949 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1148,10 +1148,10 @@ public:
 voidUpdateGrow( const ScRange rArea, SCCOL nGrowX, SCROW 
nGrowY );
 
 voidFill(   SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
-const ScMarkData rMark,
+ScProgress* pProgress, const ScMarkData rMark,
 sal_uLong nFillCount, FillDir eFillDir = 
FILL_TO_BOTTOM,
 FillCmd eFillCmd = FILL_LINEAR, FillDateCmd 
eFillDateCmd = FILL_DAY,
-double nStepValue = 1.0, double nMaxValue = 1E307);
+double nStepValue = 1.0, double nMaxValue = 1E307 
);
 rtl::OUString  GetAutoFillPreview( const ScRange rSource, SCCOL 
nEndX, SCROW nEndY );
 
 boolGetSelectionFunction( ScSubTotalFunc eFunc,
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index 0c440f9..2261718 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -477,7 +477,7 @@ public:
   const ScRangeData::IndexMap rMap );
 voidFill( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
 sal_uLong nFillCount, FillDir eFillDir, FillCmd 
eFillCmd, FillDateCmd eFillDateCmd,
-double nStepValue, double nMaxValue);
+double nStepValue, double nMaxValue, ScProgress* 
pProgress);
 String  GetAutoFillPreview( const ScRange rSource, SCCOL nEndX, SCROW 
nEndY );
 
 voidUpdateSelectionFunction( ScFunctionData rData,
@@ -792,13 +792,13 @@ private:
 sal_uLong nFillCount, FillDir eFillDir, 
FillCmd eFillCmd,
 FillDateCmd eFillDateCmd,
 double nStepValue, double nMaxValue, 
sal_uInt16 nMinDigits,
-bool bAttribs, ScProgress rProgress );
+bool bAttribs, ScProgress* pProgress );
 voidFillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW 
nRow2,
 FillCmd rCmd, FillDateCmd rDateCmd,
 double rInc, sal_uInt16 rMinDigits,
 ScUserListData* rListData, sal_uInt16 
rListIndex);
 voidFillAuto( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
-sal_uLong nFillCount, FillDir eFillDir, ScProgress 
rProgress );
+sal_uLong nFillCount, FillDir eFillDir, ScProgress* 
pProgress );
 
 boolValidNextPos( SCCOL nCol, SCROW nRow, const ScMarkData rMark,
 bool bMarked, bool bUnprotected );
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data

[Libreoffice-commits] .: 2 commits - sc/source

2012-04-04 Thread Markus Mohrhard
 sc/source/core/data/sortparam.cxx |3 ---
 sc/source/core/data/table3.cxx|3 ++-
 2 files changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 08ee936f3d1cd0d0424dd50bc96da19faf424a86
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Apr 5 05:31:13 2012 +0200

small memory leak in table3.cxx

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 97b948b..7e766a3 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -217,7 +217,7 @@ IMPL_FIXEDMEMPOOL_NEWDEL( ScSortInfo )
 class ScSortInfoArray
 {
 private:
-ScSortInfo***pppInfo;
+ScSortInfo***   pppInfo;
 SCSIZE  nCount;
 SCCOLROWnStart;
 sal_uInt16  nUsedSorts;
@@ -245,6 +245,7 @@ public:
 delete ppInfo[j];
 delete [] ppInfo;
 }
+delete[] pppInfo;
 }
 ScSortInfo* Get( sal_uInt16 nSort, SCCOLROW nInd )
 { return (pppInfo[nSort])[ nInd - nStart ]; }
commit 9646685f3ead54fc67bc457a4804defce8a88e05
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Apr 5 05:29:01 2012 +0200

this does hopefully no longer result in a crash

diff --git a/sc/source/core/data/sortparam.cxx 
b/sc/source/core/data/sortparam.cxx
index 21bf327..1cafc92 100644
--- a/sc/source/core/data/sortparam.cxx
+++ b/sc/source/core/data/sortparam.cxx
@@ -182,14 +182,11 @@ ScSortParam::ScSortParam( const ScSubTotalParam rSub, 
const ScSortParam rOld )
 for (i=0; iMAXSUBTOTAL; i++)
 if (rSub.bGroupActive[i])
 {
-#if 0
-// FIXME this crashes in sc_unoapi currently; table3.cxx has nMaxSorts = 3...
 ScSortKeyState key;
 key.bDoSort = true;
 key.nField = rSub.nField[i];
 key.bAscending = rSub.bAscending;
 maKeyState.push_back(key);
-#endif
 }
 
 //  dann dahinter die alten Einstellungen
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: drawinglayer/inc svx/inc svx/source

2012-04-03 Thread Markus Mohrhard
 drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx |   10 +--
 svx/inc/svx/framelink.hxx   |   22 

 svx/source/dialog/framelink.cxx |   27 
--
 3 files changed, 28 insertions(+), 31 deletions(-)

New commits:
commit 2c91cb08d65cd35fa8ef6eaca3677aa82fb58cbe
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Apr 4 01:58:07 2012 +0200

better drawing support for borders of different width, fdo#33634

diff --git 
a/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx 
b/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx
index 1449e2b..6ca9643 100644
--- a/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx
+++ b/drawinglayer/inc/drawinglayer/primitive2d/borderlineprimitive2d.hxx
@@ -85,17 +85,17 @@ namespace drawinglayer
 /// local helpers
 double getCorrectedLeftWidth() const
 {
-return basegfx::fTools::equal(1.0, mfLeftWidth) ? 0.0 : 
mfLeftWidth;
+return mfLeftWidth = 0.1 ? 0.0 : mfLeftWidth;
 }
 
 double getCorrectedDistance() const
 {
-return basegfx::fTools::equal(1.0, mfDistance) ? 0.0 : 
mfDistance;
+return mfDistance = 0.1 ? 0.0 : mfDistance;
 }
 
 double getCorrectedRightWidth() const
 {
-return basegfx::fTools::equal(1.0, mfRightWidth) ? 0.0 : 
mfRightWidth;
+return mfRightWidth = 0.1 ? 0.0 : mfRightWidth;
 }
 
 double getWidth() const
@@ -105,12 +105,12 @@ namespace drawinglayer
 
 bool leftIsHairline() const
 {
-return basegfx::fTools::equal(1.0, mfLeftWidth);
+return 0  mfLeftWidth  mfLeftWidth = 0.1;
 }
 
 bool rightIsHairline() const
 {
-return basegfx::fTools::equal(1.0, mfRightWidth);
+return 0  mfRightWidth  mfRightWidth = 0.1;
 }
 
 bool isSolidLine() const
diff --git a/svx/inc/svx/framelink.hxx b/svx/inc/svx/framelink.hxx
index 218ae56..c2edbb4 100644
--- a/svx/inc/svx/framelink.hxx
+++ b/svx/inc/svx/framelink.hxx
@@ -118,12 +118,12 @@ public:
 /** Constructs an invisible frame style. */
 inline explicit Style() : meRefMode( REFMODE_CENTERED ), mnType( 
editeng::SOLID ) { Clear(); }
 /** Constructs a frame style with passed line widths. */
-inline explicit Style( sal_uInt16 nP, sal_uInt16 nD, sal_uInt16 nS, 
editeng::SvxBorderStyle nType ) :
+inline explicit Style( double nP, double nD, double nS, 
editeng::SvxBorderStyle nType ) :
 meRefMode( REFMODE_CENTERED ), mnType( nType )
 { Clear(); Set( nP, nD, nS ); }
 /** Constructs a frame style with passed color and line widths. */
 inline explicit Style( const Color rColorPrim, const Color 
rColorSecn, const Color rColorGap, bool bUseGapColor,
-sal_uInt16 nP, sal_uInt16 nD, sal_uInt16 nS, 
editeng::SvxBorderStyle nType ) :
+double nP, double nD, double nS, 
editeng::SvxBorderStyle nType ) :
 meRefMode( REFMODE_CENTERED ), mnType( nType )
 { Set( rColorPrim, rColorSecn, rColorGap, 
bUseGapColor, nP, nD, nS ); }
 /** Constructs a frame style from the passed SvxBorderLine struct. */
@@ -138,21 +138,21 @@ public:
 inline const Color GetColorSecn() const { return maColorSecn; }
 inline const Color GetColorGap() const { return maColorGap; }
 inline bool UseGapColor() const { return mbUseGapColor; }
-inline sal_uInt16   Prim() const { return mnPrim; }
-inline sal_uInt16   Dist() const { return mnDist; }
-inline sal_uInt16   Secn() const { return mnSecn; }
+inline double   Prim() const { return mnPrim; }
+inline double   Dist() const { return mnDist; }
+inline double   Secn() const { return mnSecn; }
 inline editeng::SvxBorderStyle Type() const { return mnType; }
 
 /** Returns the total width of this frame style. */
-inline sal_uInt16   GetWidth() const { return mnPrim + mnDist + mnSecn; }
+inline double   GetWidth() const { return mnPrim + mnDist + mnSecn; }
 
 /** Sets the frame style to invisible state. */
 voidClear();
 /** Sets the frame style to the passed line widths. */
-voidSet( sal_uInt16 nP, sal_uInt16 nD, sal_uInt16 nS );
+voidSet( double nP, double nD, double nS );
 /** Sets the frame style to the passed line widths. */
 voidSet( const Color rColorPrim, const Color rColorSecn, 
const Color rColorGap, bool bUseGapColor,
-sal_uInt16 nP, sal_uInt16 nD, sal_uInt16 nS

[Libreoffice-commits] .: sc/qa

2012-04-03 Thread Markus Mohrhard
 sc/qa/unit/ucalc.cxx |   49 +
 1 file changed, 49 insertions(+)

New commits:
commit 62d745ddde6b60796123f45b3df8c10e9869
Author: Karthik A Padmanabhan treadston...@gmail.com
Date:   Tue Apr 3 01:21:16 2012 +0530

Test cases for ScDocFunc::RenameTable()

Rename twice and also check if upon renaming two tables have the same name 
or not

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 245215c..c8bd00c 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -206,6 +206,7 @@ public:
 void testJumpToPrecedentsDependents();
 
 void testSetBackgroundColor();
+void testRenameTable();
 
 CPPUNIT_TEST_SUITE(Test);
 CPPUNIT_TEST(testCollator);
@@ -244,6 +245,7 @@ public:
 CPPUNIT_TEST(testUpdateReference);
 CPPUNIT_TEST(testJumpToPrecedentsDependents);
 CPPUNIT_TEST(testSetBackgroundColor);
+CPPUNIT_TEST(testRenameTable);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -3910,6 +3912,53 @@ void Test::testMergedCells()
 m_pDoc-DeleteTab(0);
 }
 
+
+void Test::testRenameTable()
+{
+//test set rename table
+//TODO: set name1 and name2 and do an undo to check if name 1 is set now
+//TODO: also check if new name for table is same as another table
+
+m_pDoc-InsertTab(0, Sheet1);
+m_pDoc-InsertTab(1, Sheet2);
+
+//test case 1 , rename table2 to sheet 1, it should return error
+rtl::OUString nameToSet = Sheet1;
+ScDocFunc rDocFunc = m_xDocShRef-GetDocFunc();
+CPPUNIT_ASSERT_MESSAGE(name same as another table is being set, 
!rDocFunc.RenameTable(1,nameToSet,false,true) );
+
+//test case 2 , simple rename to check name
+nameToSet = test1;
+m_xDocShRef-GetDocFunc().RenameTable(0,nameToSet,false,true);
+rtl::OUString nameJustSet;
+m_pDoc-GetName(0,nameJustSet);
+CPPUNIT_ASSERT_MESSAGE(table not renamed, nameToSet != nameJustSet);
+
+//test case 3 , rename again
+rtl::OUString anOldName;
+m_pDoc-GetName(0,anOldName);
+
+nameToSet = test2;
+rDocFunc.RenameTable(0,nameToSet,false,true);
+m_pDoc-GetName(0,nameJustSet);
+CPPUNIT_ASSERT_MESSAGE(table not renamed, nameToSet != nameJustSet);
+
+//test case 4 , check if  undo works
+SfxUndoAction* pUndo = new 
ScUndoRenameTab(m_xDocShRef,0,anOldName,nameToSet);
+pUndo-Undo();
+m_pDoc-GetName(0,nameJustSet);
+CPPUNIT_ASSERT_MESSAGE(the correct name is not set after undo, 
nameJustSet == anOldName);
+
+pUndo-Redo();
+m_pDoc-GetName(0,nameJustSet);
+CPPUNIT_ASSERT_MESSAGE(the correct color is not set after redo, 
nameJustSet == nameToSet);
+
+m_pDoc-DeleteTab(0);
+m_pDoc-DeleteTab(1);
+}
+
+
+
 void Test::testSetBackgroundColor()
 {
 //test set background color
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - cui/source sc/source

2012-04-02 Thread Markus Mohrhard
 cui/source/inc/border.hxx   |3 +--
 cui/source/tabpages/border.cxx  |   15 +--
 sc/source/core/data/docpool.cxx |5 +
 3 files changed, 11 insertions(+), 12 deletions(-)

New commits:
commit 149650b087ab5b15ef23e4ac6af5368b2820af1e
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Apr 2 17:20:26 2012 +0200

show synchronized checked only if all margins are the same, related 
fdo#44337

diff --git a/cui/source/inc/border.hxx b/cui/source/inc/border.hxx
index 7766ec9..ecb6c9e 100644
--- a/cui/source/inc/border.hxx
+++ b/cui/source/inc/border.hxx
@@ -125,8 +125,7 @@ private:
 boolmbTLBREnabled;  /// true = Top-left to 
bottom-right border enabled.
 boolmbBLTREnabled;  /// true = Bottom-left to 
top-right border enabled.
 boolmbUseMarginItem;
-
-static sal_Bool bSync;
+boolmbSync;
 
 #ifdef _SVX_BORDER_CXX
 // Handler
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 390d60a..fd9c63c 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -86,8 +86,6 @@ static sal_uInt16 pRanges[] =
 0
 };
 
-sal_Bool SvxBorderTabPage::bSync = sal_True;
-
 // ---
 void lcl_SetDecimalDigitsTo1(MetricField rField)
 {
@@ -147,7 +145,8 @@ SvxBorderTabPage::SvxBorderTabPage( Window* pParent,
 mbVerEnabled( false ),
 mbTLBREnabled( false ),
 mbBLTREnabled( false ),
-mbUseMarginItem( false )
+mbUseMarginItem( false ),
+mbSync(true)
 
 {
 // diese Page braucht ExchangeSupport
@@ -217,7 +216,6 @@ SvxBorderTabPage::SvxBorderTabPage( Window* pParent,
 SetFieldUnit(aRightMF, eFUnit);
 SetFieldUnit(aTopMF, eFUnit);
 SetFieldUnit(aBottomMF, eFUnit);
-aSynchronizeCB.Check(bSync);
 aSynchronizeCB.SetClickHdl(LINK(this, SvxBorderTabPage, 
SyncHdl_Impl));
 aLeftMF.SetModifyHdl(LINK(this, SvxBorderTabPage, 
ModifyDistanceHdl_Impl));
 aRightMF.SetModifyHdl(LINK(this, SvxBorderTabPage, 
ModifyDistanceHdl_Impl));
@@ -571,6 +569,11 @@ void SvxBorderTabPage::Reset( const SfxItemSet rSet )
 }
 
 LinesChanged_Impl( 0 );
+if(aLeftMF.GetValue() == aRightMF.GetValue()  aTopMF.GetValue() == 
aBottomMF.GetValue()  aTopMF.GetValue() == aLeftMF.GetValue())
+mbSync = true;
+else
+mbSync = false;
+aSynchronizeCB.Check(mbSync);
 }
 
 // ---
@@ -1153,7 +1156,7 @@ IMPL_LINK_NOARG(SvxBorderTabPage, LinesChanged_Impl)
 
 IMPL_LINK( SvxBorderTabPage, ModifyDistanceHdl_Impl, MetricField*, pField)
 {
-if ( bSync )
+if ( mbSync )
 {
 sal_Int64 nVal = pField-GetValue();
 if(pField != aLeftMF)
@@ -1170,7 +1173,7 @@ IMPL_LINK( SvxBorderTabPage, ModifyDistanceHdl_Impl, 
MetricField*, pField)
 
 IMPL_LINK( SvxBorderTabPage, SyncHdl_Impl, CheckBox*, pBox)
 {
-bSync = pBox-IsChecked();
+mbSync = pBox-IsChecked();
 return 0;
 }
 
commit 843dd3f75e4d35b8ae5fd3be6804e54233292948
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Apr 2 17:23:46 2012 +0200

this hack in no longer needed, fdo#44337

excel import now uses the stored row height and we should go back to a
symetric default margin

diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index 3061856..36f0d3b 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -275,10 +275,7 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, 
sal_Bool bLoadRefCounts )
 ppPoolDefaults[ ATTR_SHRINKTOFIT - ATTR_STARTINDEX ] = new 
SfxBoolItem( ATTR_SHRINKTOFIT );
 ppPoolDefaults[ ATTR_BORDER_TLBR - ATTR_STARTINDEX ] = new 
SvxLineItem( ATTR_BORDER_TLBR );
 ppPoolDefaults[ ATTR_BORDER_BLTR - ATTR_STARTINDEX ] = new 
SvxLineItem( ATTR_BORDER_BLTR );
-SvxMarginItem* pItem = new SvxMarginItem( ATTR_MARGIN );
-pItem-SetTopMargin( 27 );
-pItem-SetBottomMargin( 27 );
-ppPoolDefaults[ ATTR_MARGIN  - ATTR_STARTINDEX ] = pItem;
+ppPoolDefaults[ ATTR_MARGIN  - ATTR_STARTINDEX ] = new 
SvxMarginItem( ATTR_MARGIN );
 ppPoolDefaults[ ATTR_MERGE   - ATTR_STARTINDEX ] = new ScMergeAttr;
 ppPoolDefaults[ ATTR_MERGE_FLAG  - ATTR_STARTINDEX ] = new 
ScMergeFlagAttr;
 ppPoolDefaults[ ATTR_VALUE_FORMAT- ATTR_STARTINDEX ] = new 
SfxUInt32Item( ATTR_VALUE_FORMAT, 0 );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: offapi/com

2012-04-02 Thread Markus Mohrhard
 offapi/com/sun/star/table/XTableColumns.idl |6 --
 1 file changed, 6 deletions(-)

New commits:
commit c730a9de1b40d0e731f2ca8621aa7864452a9a7a
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Apr 2 21:19:36 2012 +0200

this methods don't throw, adapt documentation

diff --git a/offapi/com/sun/star/table/XTableColumns.idl 
b/offapi/com/sun/star/table/XTableColumns.idl
index 41e3ed0..ab7a327 100644
--- a/offapi/com/sun/star/table/XTableColumns.idl
+++ b/offapi/com/sun/star/table/XTableColumns.idl
@@ -48,9 +48,6 @@ published interface XTableColumns: 
com::sun::star::container::XIndexAccess
 
 /** inserts new columns.
 
-pWhen the index or combination of index and count is out
-of bounds an exception will be thrown./p
-
 @param nIndex
 is the index the first inserted column will have.
 
@@ -63,9 +60,6 @@ published interface XTableColumns: 
com::sun::star::container::XIndexAccess
 
 /** deletes columns.
 
-pWhen the index or combination of index and count is out
-of bounds an exception will be thrown./p
-
 @param nIndex
 is the index of the first column to delete.
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - chart2/qa sc/qa sc/source

2012-04-01 Thread Markus Mohrhard
 chart2/qa/unit/data/ods/testChart.ods |binary
 dev/null  |binary
 sc/qa/extras/regression-test.cxx  |4 ---
 sc/source/filter/excel/xestyle.cxx|8 +++
 sc/source/filter/excel/xistyle.cxx|   37 +-
 sc/source/filter/inc/xlconst.hxx  |   10 +
 6 files changed, 30 insertions(+), 29 deletions(-)

New commits:
commit 4ab9719f15baddbc60b96d86d2e0878e79a6ddf7
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Apr 1 23:57:46 2012 +0200

use same border width information for xls import and export, fdo#44742

diff --git a/sc/source/filter/excel/xestyle.cxx 
b/sc/source/filter/excel/xestyle.cxx
index ae51486..bd53eef 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1547,15 +1547,15 @@ void lclGetBorderLine(
 sal_uInt16 nDistance = pLine-GetDistance();
 if( nDistance  0 )
 rnXclLine = EXC_LINE_DOUBLE;
-else if( nOuterWidth  DEF_LINE_WIDTH_2 )
+else if( nOuterWidth = EXC_BORDER_THICK )
 rnXclLine = EXC_LINE_THICK;
-else if( nOuterWidth  DEF_LINE_WIDTH_1 )
+else if( nOuterWidth = EXC_BORDER_MEDIUM )
 {
 rnXclLine = EXC_LINE_MEDIUM;
 if ( pLine-GetStyle( ) == ::editeng::DASHED )
 rnXclLine = EXC_LINE_MEDIUMDASHED;
 }
-else if( nOuterWidth  DEF_LINE_WIDTH_0 )
+else if( nOuterWidth = EXC_BORDER_THIN )
 {
 rnXclLine = EXC_LINE_THIN;
 switch ( pLine-GetStyle( ) )
@@ -1570,7 +1570,7 @@ void lclGetBorderLine(
 break;
 }
 }
-else if( nOuterWidth  0 )
+else if( nOuterWidth = EXC_BORDER_HAIR )
 rnXclLine = EXC_LINE_HAIR;
 else
 rnXclLine = EXC_LINE_NONE;
diff --git a/sc/source/filter/excel/xistyle.cxx 
b/sc/source/filter/excel/xistyle.cxx
index 53a75d0..83b54c8 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -890,33 +890,26 @@ bool XclImpCellBorder::HasAnyOuterBorder() const
 
 namespace {
 
-// TODO: These values are approximate; we should probably tweak these values
-// further to better match Excel's border thickness.
-#define XLS_LINE_WIDTH_HAIR1
-#define XLS_LINE_WIDTH_THIN6
-#define XLS_LINE_WIDTH_MEDIUM 18
-#define XLS_LINE_WIDTH_THICK  24
-
 /** Converts the passed line style to a ::editeng::SvxBorderLine, or returns 
false, if style is no line. */
 bool lclConvertBorderLine( ::editeng::SvxBorderLine rLine, const 
XclImpPalette rPalette, sal_uInt8 nXclLine, sal_uInt16 nXclColor )
 {
 static const sal_uInt16 ppnLineParam[][ 4 ] =
 {
-//  outer width,   type
-{   0, ::editeng::SOLID },// 0 = 
none
-{   XLS_LINE_WIDTH_THIN,   ::editeng::SOLID },// 1 = 
thin
-{   XLS_LINE_WIDTH_MEDIUM, ::editeng::SOLID },// 2 = 
medium
-{   XLS_LINE_WIDTH_THIN,   ::editeng::DASHED },   // 3 = 
dashed
-{   XLS_LINE_WIDTH_THIN,   ::editeng::DOTTED },   // 4 = 
dotted
-{   XLS_LINE_WIDTH_THICK,  ::editeng::SOLID },// 5 = 
thick
-{   XLS_LINE_WIDTH_THIN,   ::editeng::DOUBLE }, // 6 = 
double
-{   XLS_LINE_WIDTH_HAIR,   ::editeng::SOLID },// 7 = 
hair
-{   XLS_LINE_WIDTH_MEDIUM, ::editeng::DASHED },   // 8 = 
med dash
-{   XLS_LINE_WIDTH_THIN,   ::editeng::SOLID },// 9 = 
thin dashdot
-{   XLS_LINE_WIDTH_MEDIUM, ::editeng::SOLID },// A = 
med dashdot
-{   XLS_LINE_WIDTH_THIN,   ::editeng::SOLID },// B = 
thin dashdotdot
-{   XLS_LINE_WIDTH_MEDIUM, ::editeng::SOLID },// C = 
med dashdotdot
-{   XLS_LINE_WIDTH_MEDIUM, ::editeng::SOLID } // D = 
med slant dashdot
+//  outer width,type
+{   0,  ::editeng::SOLID },// 0 = none
+{   EXC_BORDER_THIN,::editeng::SOLID },// 1 = thin
+{   EXC_BORDER_MEDIUM,  ::editeng::SOLID },// 2 = 
medium
+{   EXC_BORDER_THIN,::editeng::DASHED },   // 3 = 
dashed
+{   EXC_BORDER_THIN,::editeng::DOTTED },   // 4 = 
dotted
+{   EXC_BORDER_THICK,   ::editeng::SOLID },// 5 = thick
+{   EXC_BORDER_THIN,::editeng::DOUBLE }, // 6 = 
double
+{   EXC_BORDER_HAIR,::editeng::SOLID },// 7 = hair
+{   EXC_BORDER_MEDIUM,  ::editeng::DASHED },   // 8 = med 
dash
+{   EXC_BORDER_THIN,::editeng::SOLID },// 9 = thin 
dashdot
+{   EXC_BORDER_MEDIUM,  ::editeng::SOLID },// A = med 
dashdot

[Libreoffice-commits] .: sc/qa

2012-04-01 Thread Markus Mohrhard
 sc/qa/unit/data/xls/border.xls |binary
 sc/qa/unit/subsequent_filters-test.cxx |   31 +++
 2 files changed, 31 insertions(+)

New commits:
commit 1199713c82d9852f8a41283138f88a06ad887c39
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Apr 2 00:12:13 2012 +0200

add xls border import test

TODO:
add test cases for:
-color import
-different line styles
-...

diff --git a/sc/qa/unit/data/xls/border.xls b/sc/qa/unit/data/xls/border.xls
new file mode 100644
index 000..b314f7d
Binary files /dev/null and b/sc/qa/unit/data/xls/border.xls differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx 
b/sc/qa/unit/subsequent_filters-test.cxx
index 391b157..1d8a8b6 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -104,6 +104,7 @@ public:
 void testMatrixODS();
 void testMatrixXLS();
 void testBorderODS();
+void testBorderXLS();
 void testBugFixesODS();
 void testBugFixesXLS();
 void testBugFixesXLSX();
@@ -124,6 +125,7 @@ public:
 CPPUNIT_TEST(testMatrixODS);
 CPPUNIT_TEST(testMatrixXLS);
 CPPUNIT_TEST(testBorderODS);
+CPPUNIT_TEST(testBorderXLS);
 CPPUNIT_TEST(testBugFixesODS);
 CPPUNIT_TEST(testBugFixesXLS);
 CPPUNIT_TEST(testBugFixesXLSX);
@@ -515,6 +517,35 @@ void ScFiltersTest::testBorderODS()
 xDocSh-DoClose();
 }
 
+void ScFiltersTest::testBorderXLS()
+{
+const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM(border.));
+ScDocShellRef xDocSh = loadDoc( aFileNameBase, 1);
+
+CPPUNIT_ASSERT_MESSAGE(Failed to load border.xls, xDocSh.Is());
+ScDocument* pDoc = xDocSh-GetDocument();
+
+const editeng::SvxBorderLine* pLeft = NULL;
+const editeng::SvxBorderLine* pTop = NULL;
+const editeng::SvxBorderLine* pRight = NULL;
+const editeng::SvxBorderLine* pBottom = NULL;
+
+pDoc-GetBorderLines( 2, 3, 0, pLeft, pTop, pRight, pBottom );
+CPPUNIT_ASSERT(pRight);
+CPPUNIT_ASSERT_EQUAL(pRight-GetStyle(),editeng::SOLID);
+CPPUNIT_ASSERT_EQUAL(pRight-GetWidth(),6L);
+
+pDoc-GetBorderLines( 3, 5, 0, pLeft, pTop, pRight, pBottom );
+CPPUNIT_ASSERT(pRight);
+CPPUNIT_ASSERT_EQUAL(pRight-GetStyle(),editeng::SOLID);
+CPPUNIT_ASSERT_EQUAL(pRight-GetWidth(),18L);
+
+pDoc-GetBorderLines( 5, 7, 0, pLeft, pTop, pRight, pBottom );
+CPPUNIT_ASSERT(pRight);
+CPPUNIT_ASSERT_EQUAL(pRight-GetStyle(),editeng::SOLID);
+CPPUNIT_ASSERT_EQUAL(pRight-GetWidth(),24L);
+}
+
 void ScFiltersTest::testBugFixesODS()
 {
 const rtl::OUString 
aFileNameBase(RTL_CONSTASCII_USTRINGPARAM(bug-fixes.));
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - vcl/source

2012-04-01 Thread Markus Mohrhard
 vcl/source/window/toolbox.cxx |   14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 05d6bb3aed80d0284bdeaf4177c9883aa60ea169
Author: Noel Power noel.po...@novell.com
Date:   Tue Mar 27 12:32:05 2012 +0100

fix vertical align when switching mode in multibar fdo#44140

switching between SumAssign  OkCancel mode in the multibar results in a 
slight 'jumping' of the toolbar items when end up out of allignment with the 
other toolbar items.

Signed-off-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 2a0a089..0ae1ccb 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -2722,7 +2722,19 @@ void ToolBox::ImplFormat( sal_Bool bResize )
 // if special TBX_LAYOUT_LOCKVERT lock vertical 
position
 // don't recalulate the vertical position of the item
 if ( meLayoutMode == TBX_LAYOUT_LOCKVERT  mnLines == 
1 )
-it-maCalcRect.Top()  =  it-maRect.Top();
+{
+// Somewhat of a hack here, calc deletes and 
re-adds
+// the sum/assign  ok/cancel items dynamically.
+// Because TBX_LAYOUT_LOCKVERT effectively prevents
+// recalculation of the vertical pos of an item the
+// it-maRect.Top() for those newly added items is
+// 0. The hack here is that we want to effectively
+// recalculate the vertical pos for those added
+// items here. ( Note: assume mnMaxItemHeight is
+// equal to the LineSize when multibar has a single
+// line size )
+it-maCalcRect.Top()  =  it-maRect.Top() ? 
it-maRect.Top() : ( nY + ( mnMaxItemHeight-aCurrentItemSize.Height())/2 );
+}
 else
 it-maCalcRect.Top()  = 
nY+(nLineSize-aCurrentItemSize.Height())/2;
 it-maCalcRect.Right()= 
nX+aCurrentItemSize.Width()-1;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - sc/inc sc/qa

2012-03-31 Thread Markus Mohrhard
 sc/inc/document.hxx|2 +-
 sc/qa/unit/data/ods/border.ods |binary
 sc/qa/unit/subsequent_filters-test.cxx |   26 ++
 sc/qa/unit/ucalc.cxx   |4 +++-
 4 files changed, 30 insertions(+), 2 deletions(-)

New commits:
commit f19ebe978a329e5322fca89aaf568371c532e5fb
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Apr 1 03:32:40 2012 +0200

first part of border import test

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 2fbd0eb..1c0477c 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -865,7 +865,7 @@ public:
  SCCOL nCol2, SCROW nRow2, SCTAB nTab2, 
sal_uInt16 nMask ) const;
 SC_DLLPUBLIC bool HasAttrib( const ScRange rRange, sal_uInt16 nMask ) 
const;
 
-voidGetBorderLines( SCCOL nCol, SCROW nRow, SCTAB nTab,
+SC_DLLPUBLIC void GetBorderLines( SCCOL nCol, SCROW nRow, SCTAB nTab,
 const ::editeng::SvxBorderLine** ppLeft,
 const ::editeng::SvxBorderLine** ppTop,
 const ::editeng::SvxBorderLine** ppRight,
diff --git a/sc/qa/unit/data/ods/border.ods b/sc/qa/unit/data/ods/border.ods
new file mode 100644
index 000..e2ac68b
Binary files /dev/null and b/sc/qa/unit/data/ods/border.ods differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx 
b/sc/qa/unit/subsequent_filters-test.cxx
index 7ff3ba0..3502d34 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -41,6 +41,7 @@
 
 #include editeng/brshitem.hxx
 #include editeng/justifyitem.hxx
+#include editeng/borderline.hxx
 #include dbdata.hxx
 
 #define CALC_DEBUG_OUTPUT 0
@@ -102,6 +103,7 @@ public:
 void testFormatsXLSX();
 void testMatrixODS();
 void testMatrixXLS();
+void testBorderODS();
 void testBugFixesODS();
 void testBugFixesXLS();
 void testBugFixesXLSX();
@@ -121,6 +123,7 @@ public:
 CPPUNIT_TEST(testFormatsXLSX);
 CPPUNIT_TEST(testMatrixODS);
 CPPUNIT_TEST(testMatrixXLS);
+CPPUNIT_TEST(testBorderODS);
 CPPUNIT_TEST(testBugFixesODS);
 CPPUNIT_TEST(testBugFixesXLS);
 CPPUNIT_TEST(testBugFixesXLSX);
@@ -470,6 +473,29 @@ void ScFiltersTest::testMatrixXLS()
 xDocSh-DoClose();
 }
 
+void ScFiltersTest::testBorderODS()
+{
+const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM(border.));
+ScDocShellRef xDocSh = loadDoc( aFileNameBase, 0);
+
+CPPUNIT_ASSERT_MESSAGE(Failed to load border.*, xDocSh.Is());
+ScDocument* pDoc = xDocSh-GetDocument();
+
+const editeng::SvxBorderLine* pLeft = NULL;
+const editeng::SvxBorderLine* pTop = NULL;
+const editeng::SvxBorderLine* pRight = NULL;
+const editeng::SvxBorderLine* pBottom = NULL;
+
+pDoc-GetBorderLines( 0, 1, 0, pLeft, pTop, pRight, pBottom );
+CPPUNIT_ASSERT(!pLeft);
+CPPUNIT_ASSERT(!pTop);
+CPPUNIT_ASSERT(!pBottom);
+CPPUNIT_ASSERT(pRight);
+CPPUNIT_ASSERT_EQUAL(pRight-GetStyle(),editeng::SOLID);
+
+xDocSh-DoClose();
+}
+
 void ScFiltersTest::testBugFixesODS()
 {
 const rtl::OUString 
aFileNameBase(RTL_CONSTASCII_USTRINGPARAM(bug-fixes.));
commit c41f72f5a9cdee8e048c29768ada9a9e2666b7d7
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Apr 1 02:56:15 2012 +0200

with the correct assumption this check actually makes sense

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 838d3a1..1bdfe9d 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -3933,7 +3933,9 @@ void Test::testSetBackgroundColor()
 //now check for undo
 SfxUndoAction* pUndo = new ScUndoTabColor(m_xDocShRef,0, aOldTabBgColor, 
aColor);
 pUndo-Undo();
-//CPPUNIT_ASSERT_MESSAGE(the correct color is not set after undo, 
m_pDoc-GetTabBgColor(0)!= aOldTabBgColor.GetColor());
+CPPUNIT_ASSERT_MESSAGE(the correct color is not set after undo, 
m_pDoc-GetTabBgColor(0)== aOldTabBgColor.GetColor());
+pUndo-Redo();
+CPPUNIT_ASSERT_MESSAGE(the correct color is not set after undo, 
m_pDoc-GetTabBgColor(0)== aColor.GetColor());
 m_pDoc-DeleteTab(0);
 }
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/qa

2012-03-31 Thread Markus Mohrhard
 sc/qa/unit/subsequent_filters-test.cxx |   19 +++
 1 file changed, 19 insertions(+)

New commits:
commit 9654d3baed29abd009a214e429247fb64451
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Apr 1 04:18:48 2012 +0200

more test cases for border import

diff --git a/sc/qa/unit/subsequent_filters-test.cxx 
b/sc/qa/unit/subsequent_filters-test.cxx
index 3502d34..391b157 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -493,6 +493,25 @@ void ScFiltersTest::testBorderODS()
 CPPUNIT_ASSERT(pRight);
 CPPUNIT_ASSERT_EQUAL(pRight-GetStyle(),editeng::SOLID);
 
+pDoc-GetBorderLines( 2, 1, 0, pLeft, pTop, pRight, pBottom );
+CPPUNIT_ASSERT(!pLeft);
+CPPUNIT_ASSERT(!pTop);
+CPPUNIT_ASSERT(!pBottom);
+
+CPPUNIT_ASSERT(pRight);
+CPPUNIT_ASSERT_EQUAL(pRight-GetStyle(),editeng::SOLID);
+CPPUNIT_ASSERT_EQUAL(pRight-GetWidth(),20L);
+
+pDoc-GetBorderLines( 2, 8, 0, pLeft, pTop, pRight, pBottom );
+
+CPPUNIT_ASSERT(pLeft);
+CPPUNIT_ASSERT(pTop);
+CPPUNIT_ASSERT(pBottom);
+CPPUNIT_ASSERT(pRight);
+CPPUNIT_ASSERT_EQUAL(pRight-GetStyle(),editeng::SOLID);
+CPPUNIT_ASSERT_EQUAL(pRight-GetWidth(),5L);
+CPPUNIT_ASSERT(pRight-GetColor() == Color(COL_BLUE));
+
 xDocSh-DoClose();
 }
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - sc/qa

2012-03-31 Thread Markus Mohrhard
 sc/qa/unit/ucalc.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 98a5031b225d0ba62454e14ed719fd2c7c32aa84
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Apr 1 04:26:08 2012 +0200

with SetInTest it is possible to use some more ScDocFunc methods

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 080bf3c..9132395 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -3903,11 +3903,11 @@ void Test::testMergedCells()
 ScRange aRange(0,2,0,MAXCOL,2,0);
 ScMarkData aMark;
 aMark.SetMarkArea(aRange);
+m_pDoc-SetInTest();
 aDocFunc.InsertCells(aRange, aMark, INS_INSROWS, true, true);
 m_pDoc-ExtendMerge( 1, 1, nEndCol, nEndRow, 0, false);
 cout  nEndRow  nEndCol;
-//ScEditableTester won't work without an SfxMedium/XStorage
-//CPPUNIT_ASSERT_MESSAGE(did not increase merge area, nEndCol == 3  
nEndRow == 4);
+CPPUNIT_ASSERT_MESSAGE(did not increase merge area, nEndCol == 3  
nEndRow == 4);
 m_pDoc-DeleteTab(0);
 }
 
commit 0034110ca6e68e2d3bd6fef11f1b0698738f24b0
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Apr 1 04:23:55 2012 +0200

it does not make sense to get ColorData which is converted back to Color

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 1bdfe9d..080bf3c 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -3922,20 +3922,20 @@ void Test::testSetBackgroundColor()
  //test yellow
 aColor=Color(COL_YELLOW);
 m_xDocShRef-GetDocFunc().SetTabBgColor(0,aColor,false, true);
-CPPUNIT_ASSERT_MESSAGE(the correct color is not set, 
m_pDoc-GetTabBgColor(0)!= aColor.GetColor());
+CPPUNIT_ASSERT_MESSAGE(the correct color is not set, 
m_pDoc-GetTabBgColor(0)!= aColor);
 
 
 Color aOldTabBgColor=m_pDoc-GetTabBgColor(0);
 aColor.SetColor(COL_BLUE);//set BLUE
 m_xDocShRef-GetDocFunc().SetTabBgColor(0,aColor,false, true);
-CPPUNIT_ASSERT_MESSAGE(the correct color is not set the second time, 
m_pDoc-GetTabBgColor(0)!= aColor.GetColor());
+CPPUNIT_ASSERT_MESSAGE(the correct color is not set the second time, 
m_pDoc-GetTabBgColor(0)!= aColor);
 
 //now check for undo
 SfxUndoAction* pUndo = new ScUndoTabColor(m_xDocShRef,0, aOldTabBgColor, 
aColor);
 pUndo-Undo();
-CPPUNIT_ASSERT_MESSAGE(the correct color is not set after undo, 
m_pDoc-GetTabBgColor(0)== aOldTabBgColor.GetColor());
+CPPUNIT_ASSERT_MESSAGE(the correct color is not set after undo, 
m_pDoc-GetTabBgColor(0)== aOldTabBgColor);
 pUndo-Redo();
-CPPUNIT_ASSERT_MESSAGE(the correct color is not set after undo, 
m_pDoc-GetTabBgColor(0)== aColor.GetColor());
+CPPUNIT_ASSERT_MESSAGE(the correct color is not set after undo, 
m_pDoc-GetTabBgColor(0)== aColor);
 m_pDoc-DeleteTab(0);
 }
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/qa

2012-03-31 Thread Markus Mohrhard
 sc/qa/unit/ucalc.cxx |   94 +--
 1 file changed, 47 insertions(+), 47 deletions(-)

New commits:
commit 464a3a271cd4b97573e87d15a38b3f4cad727daf
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Apr 1 05:00:09 2012 +0200

use better/correct assert macros in ucalc

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 9132395..6a92628 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -2092,8 +2092,8 @@ void Test::testPivotTableDuplicateDataFields()
 bool bSuccess = pDPs-InsertNewTable(pDPObj);
 
 CPPUNIT_ASSERT_MESSAGE(failed to insert a new pivot table object into 
document., bSuccess);
-CPPUNIT_ASSERT_MESSAGE(there should be only one data pilot table.,
-   pDPs-GetCount() == 1);
+CPPUNIT_ASSERT_EQUAL_MESSAGE(there should be only one data pilot table.,
+   pDPs-GetCount(), static_castsize_t(1));
 pDPObj-SetName(pDPs-CreateNewName());
 
 ScRange aOutRange = refresh(pDPObj);
@@ -2139,13 +2139,13 @@ void Test::testPivotTableDuplicateDataFields()
 
 ScPivotParam aParam;
 pDPObj-FillLabelData(aParam);
-CPPUNIT_ASSERT_MESSAGE(There should be exactly 4 labels (2 original, 1 
data layout, and 1 duplicate dimensions).,
-   aParam.maLabelArray.size() == 4);
+CPPUNIT_ASSERT_EQUAL_MESSAGE(There should be exactly 4 labels (2 
original, 1 data layout, and 1 duplicate dimensions).,
+   aParam.maLabelArray.size(), static_castsize_t(4));
 
 pDPs-FreeTable(pDPObj);
-CPPUNIT_ASSERT_MESSAGE(There should be no more tables., pDPs-GetCount() 
== 0);
-CPPUNIT_ASSERT_MESSAGE(There shouldn't be any more cache stored.,
-   pDPs-GetSheetCaches().size() == 0);
+CPPUNIT_ASSERT_EQUAL_MESSAGE(There should be no more tables., 
pDPs-GetCount(), static_castsize_t(0));
+CPPUNIT_ASSERT_EQUAL_MESSAGE(There shouldn't be any more cache stored.,
+   pDPs-GetSheetCaches().size(), 
static_castsize_t(0));
 
 m_pDoc-DeleteTab(1);
 m_pDoc-DeleteTab(0);
@@ -2185,8 +2185,8 @@ void Test::testPivotTableNormalGrouping()
 bool bSuccess = pDPs-InsertNewTable(pDPObj);
 
 CPPUNIT_ASSERT_MESSAGE(failed to insert a new pivot table object into 
document., bSuccess);
-CPPUNIT_ASSERT_MESSAGE(there should be only one data pilot table.,
-   pDPs-GetCount() == 1);
+CPPUNIT_ASSERT_EQUAL_MESSAGE(there should be only one data pilot table.,
+   pDPs-GetCount(), static_castsize_t(1));
 pDPObj-SetName(pDPs-CreateNewName());
 
 ScRange aOutRange = refresh(pDPObj);
@@ -2294,9 +2294,9 @@ void Test::testPivotTableNormalGrouping()
 }
 
 pDPs-FreeTable(pDPObj);
-CPPUNIT_ASSERT_MESSAGE(There should be no more tables., pDPs-GetCount() 
== 0);
-CPPUNIT_ASSERT_MESSAGE(There shouldn't be any more cache stored.,
-   pDPs-GetSheetCaches().size() == 0);
+CPPUNIT_ASSERT_EQUAL_MESSAGE(There should be no more tables., 
pDPs-GetCount(), static_castsize_t(0));
+CPPUNIT_ASSERT_EQUAL_MESSAGE(There shouldn't be any more cache stored.,
+   pDPs-GetSheetCaches().size(), 
static_castsize_t(0));
 
 m_pDoc-DeleteTab(1);
 m_pDoc-DeleteTab(0);
@@ -2347,8 +2347,8 @@ void Test::testPivotTableNumberGrouping()
 bool bSuccess = pDPs-InsertNewTable(pDPObj);
 
 CPPUNIT_ASSERT_MESSAGE(failed to insert a new pivot table object into 
document., bSuccess);
-CPPUNIT_ASSERT_MESSAGE(there should be only one data pilot table.,
-   pDPs-GetCount() == 1);
+CPPUNIT_ASSERT_EQUAL_MESSAGE(there should be only one data pilot table.,
+   pDPs-GetCount(), static_castsize_t(1));
 pDPObj-SetName(pDPs-CreateNewName());
 
 ScDPSaveData* pSaveData = pDPObj-GetSaveData();
@@ -2389,9 +2389,9 @@ void Test::testPivotTableNumberGrouping()
 }
 
 pDPs-FreeTable(pDPObj);
-CPPUNIT_ASSERT_MESSAGE(There should be no more tables., pDPs-GetCount() 
== 0);
-CPPUNIT_ASSERT_MESSAGE(There shouldn't be any more cache stored.,
-   pDPs-GetSheetCaches().size() == 0);
+CPPUNIT_ASSERT_EQUAL_MESSAGE(There should be no more tables., 
pDPs-GetCount(), static_castsize_t(0));
+CPPUNIT_ASSERT_EQUAL_MESSAGE(There shouldn't be any more cache stored.,
+   pDPs-GetSheetCaches().size(), 
static_castsize_t(0));
 
 m_pDoc-DeleteTab(1);
 m_pDoc-DeleteTab(0);
@@ -2534,9 +2534,9 @@ void Test::testPivotTableDateGrouping()
 }
 
 pDPs-FreeTable(pDPObj);
-CPPUNIT_ASSERT_MESSAGE(There should be no more tables., pDPs-GetCount() 
== 0);
-CPPUNIT_ASSERT_MESSAGE(There shouldn't be any more cache stored.,
-   pDPs-GetSheetCaches().size() == 0);
+CPPUNIT_ASSERT_EQUAL_MESSAGE(There should be no more tables., 
pDPs-GetCount

[Libreoffice-commits] .: sc/inc sc/source

2012-03-29 Thread Markus Mohrhard
 sc/inc/document.hxx  |5 +
 sc/source/core/data/document.cxx |3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit f826a5b56ac12e0b85c380f7d26c379e3d1f7281
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Mar 29 20:36:12 2012 +0200

quick and ugly hack for ScEditableTester in ucalc

Fix this as soon as possible with a clean fix

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 6b2139b..2fbd0eb 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -419,6 +419,10 @@ private:
 
 ::std::setScFormulaCell* maSubTotalCells;
 
+// quick and ugly hack to fix the ScEditableTester problem in ucalc
+// write a clean fix for this as soon as possible
+boolmbIsInTest;
+
 public:
 SC_DLLPUBLIC sal_uLong  GetCellCount() const;   // all cells
 SCSIZE  GetCellCount(SCTAB nTab, SCCOL nCol) const;
@@ -1103,6 +1107,7 @@ public:
 bool bColInfo = false, bool bRowInfo = false );
 SC_DLLPUBLIC void   InitUndoSelected( ScDocument* pSrcDoc, const 
ScMarkData rTabSelection,
 bool bColInfo = false, bool bRowInfo = false );
+voidSetInTest() { mbIsInTest = true; }
 
 //  don't use anymore:
 voidCopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1,
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 6e21d91..ef2a8c4 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -4766,7 +4766,8 @@ bool ScDocument::IsBlockEditable( SCTAB nTab, SCCOL 
nStartCol, SCROW nStartRow,
 bool* pOnlyNotBecauseOfMatrix /* = 
NULL */ ) const
 {
 // import into read-only document is possible
-if ( !bImportingXML  !mbChangeReadOnlyEnabled  pShell  
pShell-IsReadOnly() )
+// TODO: come up with a clean solution for the testing problem
+if ( !bImportingXML  !mbChangeReadOnlyEnabled  pShell  
(pShell-IsReadOnly()!mbIsInTest) )
 {
 if ( pOnlyNotBecauseOfMatrix )
 *pOnlyNotBecauseOfMatrix = false;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: basctl/source

2012-03-29 Thread Markus Mohrhard
 basctl/source/basicide/baside2.hxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit da2c7a91adc46ed01167b9b582d6cd65fac5e982
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Mar 29 21:21:32 2012 +0200

add missing tools/table.hxx include

diff --git a/basctl/source/basicide/baside2.hxx 
b/basctl/source/basicide/baside2.hxx
index 2267914..922be10 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -56,6 +56,8 @@ class SvxSearchItem;
 #include linenumberwindow.hxx
 #include objdlg.hxx
 
+#include tools/table.hxx
+
 DBG_NAMEEX( ModulWindow )
 
 #define MARKER_NOMARKER 0x
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - chart2/source

2012-03-28 Thread Markus Mohrhard
 chart2/source/view/main/ChartView.cxx |   33 +
 1 file changed, 25 insertions(+), 8 deletions(-)

New commits:
commit bef64b011337fa60b27339a00c30303143b4397d
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Mar 28 09:30:00 2012 +0200

add name attribute to chart's layout dumper

diff --git a/chart2/source/view/main/ChartView.cxx 
b/chart2/source/view/main/ChartView.cxx
index bb49dce..77fe6ab 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -3070,7 +3070,15 @@ void dumpXShape( uno::Reference drawing::XShape  
xShape, xmlTextWriterPtr xmlW
 
 uno::Reference lang::XServiceInfo  xServiceInfo( xShape, 
uno::UNO_QUERY_THROW );
 uno::Sequence rtl::OUString  aServiceNames = 
xServiceInfo-getSupportedServiceNames();
-sal_Int32 nServices = aServiceNames.getLength();
+
+uno::Reference beans::XPropertySet  xPropSet(xShape, 
uno::UNO_QUERY_THROW);
+uno::Any aAny = xPropSet-getPropertyValue(Name);
+rtl::OUString aName;
+if (aAny = aName)
+{
+if (!aName.isEmpty())
+xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST(name), 
%s, rtl::OUStringToOString(aName, RTL_TEXTENCODING_UTF8).getStr());
+}
 if (xServiceInfo-supportsService(com.sun.star.drawing.Text))
 {
 uno::Reference text::XText  xText(xShape, uno::UNO_QUERY_THROW);
@@ -3078,19 +3086,20 @@ void dumpXShape( uno::Reference drawing::XShape  
xShape, xmlTextWriterPtr xmlW
 if(!aText.isEmpty())
 xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST(text), 
%s, rtl::OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr());
 }
-for (sal_Int32 i = 0; i  nServices; ++i)
+else if(xServiceInfo-supportsService(com.sun.star.drawing.GroupShape))
 {
-if 
(aServiceNames[i].equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(com.sun.star.drawing.GroupShape)))
-{
-uno::Reference drawing::XShapes  xShapes(xShape, 
uno::UNO_QUERY_THROW);
-dumpXShapes(xShapes, xmlWriter);
-}
+uno::Reference drawing::XShapes  xShapes(xShape, 
uno::UNO_QUERY_THROW);
+dumpXShapes(xShapes, xmlWriter);
+}
 #if DEBUG_DUMPER
+sal_Int32 nServices = aServiceNames.getLength();
+for (sal_Int32 i = 0; i  nServices; ++i)
+{
 xmlTextWriterStartElement(xmlWriter, BAD_CAST( ServiceName ));
 xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST( name ), %s, 
rtl::OUStringToOString(aServiceNames[i], RTL_TEXTENCODING_UTF8).getStr());
 xmlTextWriterEndElement( xmlWriter );
-#endif
 }
+#endif
 
 xmlTextWriterEndElement( xmlWriter );
 }
commit f084ac6556ab2374e7cbde5c426feeca0c3b9b9d
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Mar 28 09:01:56 2012 +0200

add drawing.Text to chart's dumper

diff --git a/chart2/source/view/main/ChartView.cxx 
b/chart2/source/view/main/ChartView.cxx
index 250f1c8..bb49dce 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -100,6 +100,7 @@
 #include com/sun/star/awt/Size.hpp
 #include com/sun/star/awt/Point.hpp
 #include com/sun/star/drawing/XShapeDescriptor.hpp
+#include com/sun/star/text/XText.hpp
 
 #include com/sun/star/style/XStyleFamiliesSupplier.hpp
 #include com/sun/star/text/XTextDocument.hpp
@@ -3027,7 +3028,7 @@ uno::Sequence ::rtl::OUString  
ChartView::getAvailableServiceNames() throw (un
 
 namespace {
 
-#define DEBUG_DUMPER 0
+#define DEBUG_DUMPER 1
 
 int writeCallback(void* pContext, const char* sBuffer, int nLen)
 {
@@ -3070,6 +3071,13 @@ void dumpXShape( uno::Reference drawing::XShape  
xShape, xmlTextWriterPtr xmlW
 uno::Reference lang::XServiceInfo  xServiceInfo( xShape, 
uno::UNO_QUERY_THROW );
 uno::Sequence rtl::OUString  aServiceNames = 
xServiceInfo-getSupportedServiceNames();
 sal_Int32 nServices = aServiceNames.getLength();
+if (xServiceInfo-supportsService(com.sun.star.drawing.Text))
+{
+uno::Reference text::XText  xText(xShape, uno::UNO_QUERY_THROW);
+rtl::OUString aText = xText-getString();
+if(!aText.isEmpty())
+xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST(text), 
%s, rtl::OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr());
+}
 for (sal_Int32 i = 0; i  nServices; ++i)
 {
 if 
(aServiceNames[i].equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(com.sun.star.drawing.GroupShape)))
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/inc sc/source

2012-03-26 Thread Markus Mohrhard
 sc/inc/attarray.hxx|2 +-
 sc/inc/column.hxx  |2 +-
 sc/inc/document.hxx|1 +
 sc/inc/table.hxx   |2 +-
 sc/source/core/data/attarray.cxx   |4 ++--
 sc/source/core/data/column2.cxx|4 ++--
 sc/source/core/data/document.cxx   |   13 +
 sc/source/core/data/table1.cxx |4 ++--
 sc/source/filter/excel/xetable.cxx |2 +-
 9 files changed, 24 insertions(+), 10 deletions(-)

New commits:
commit 5d123a0b0e827aba59ddb50ef1b961a529a34a15
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Mar 27 05:14:06 2012 +0200

export all style information to xls/xlsx, fdo#46738

Fixes that if more than 84 empty but formatted rows at the end of a file
have been found the export skipped those rows.

diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx
index 706a1c0..c6d2aff 100644
--- a/sc/inc/attarray.hxx
+++ b/sc/inc/attarray.hxx
@@ -173,7 +173,7 @@ public:
 boolIsEmpty() const;
 
 boolGetFirstVisibleAttr( SCROW rFirstRow ) const;
-boolGetLastVisibleAttr( SCROW rLastRow, SCROW nLastData ) const;
+boolGetLastVisibleAttr( SCROW rLastRow, SCROW nLastData, bool 
bFullFormattedArea = false ) const;
 boolHasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const;
 boolIsVisibleEqual( const ScAttrArray rOther,
 SCROW nStartRow, SCROW nEndRow ) const;
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index e503005..4988ffc 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -182,7 +182,7 @@ public:
 boolHasSelectionMatrixFragment(const ScMarkData rMark) const;
 
 boolGetFirstVisibleAttr( SCROW rFirstRow ) const;
-boolGetLastVisibleAttr( SCROW rLastRow ) const;
+boolGetLastVisibleAttr( SCROW rLastRow, bool bFullFormattedArea = 
false ) const;
 boolHasVisibleAttrIn( SCROW nStartRow, SCROW nEndRow ) const;
 boolIsVisibleAttrEqual( const ScColumn rCol, SCROW nStartRow = 0,
 SCROW nEndRow = MAXROW ) const;
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 0d63e3b..bc48fab 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -935,6 +935,7 @@ public:
 SCCOL rEndCol, SCROW rEndRow, bool 
bIncludeOld, bool bOnlyDown ) const;
 SC_DLLPUBLIC bool   GetCellArea( SCTAB nTab, SCCOL rEndCol, 
SCROW rEndRow ) const;
 SC_DLLPUBLIC bool   GetTableArea( SCTAB nTab, SCCOL rEndCol, 
SCROW rEndRow ) const;
+SC_DLLPUBLIC void   GetFormattedAndUsedArea( SCTAB nTab, SCCOL 
rEndCol, SCROW rEndRow ) const;
 SC_DLLPUBLIC bool   GetPrintArea( SCTAB nTab, SCCOL rEndCol, 
SCROW rEndRow,
 bool bNotes = true ) const;
 SC_DLLPUBLIC bool   GetPrintAreaHor( SCTAB nTab, SCROW nStartRow, 
SCROW nEndRow,
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index b99caf8..cec3676 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -401,7 +401,7 @@ public:
 
 boolGetCellArea( SCCOL rEndCol, SCROW rEndRow ) const;   
 // FALSE = empty
 boolGetTableArea( SCCOL rEndCol, SCROW rEndRow ) const;
-boolGetPrintArea( SCCOL rEndCol, SCROW rEndRow, bool bNotes ) 
const;
+boolGetPrintArea( SCCOL rEndCol, SCROW rEndRow, bool bNotes, 
bool bFullFormattedArea = false ) const;
 boolGetPrintAreaHor( SCROW nStartRow, SCROW nEndRow,
 SCCOL rEndCol, bool bNotes ) const;
 boolGetPrintAreaVer( SCCOL nStartCol, SCCOL nEndCol,
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 3b0c923..72d08fc 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -1760,7 +1760,7 @@ bool ScAttrArray::GetFirstVisibleAttr( SCROW rFirstRow ) 
const
 
 const SCROW SC_VISATTR_STOP = 84;
 
-bool ScAttrArray::GetLastVisibleAttr( SCROW rLastRow, SCROW nLastData ) const
+bool ScAttrArray::GetLastVisibleAttr( SCROW rLastRow, SCROW nLastData, bool 
bFullFormattedArea ) const
 {
 //  #i30830# changed behavior:
 //  ignore all attributes starting with the first run of SC_VISATTR_STOP 
equal rows
@@ -1791,7 +1791,7 @@ bool ScAttrArray::GetLastVisibleAttr( SCROW rLastRow, 
SCROW nLastData ) const
 if ( nAttrStartRow = nLastData )
 nAttrStartRow = nLastData + 1;
 SCROW nAttrSize = pData[nEndPos].nRow + 1 - nAttrStartRow;
-if ( nAttrSize = SC_VISATTR_STOP )
+if ( nAttrSize = SC_VISATTR_STOP  !bFullFormattedArea )
 {
 bFound = false;// ignore this range and below
 }
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 1ca582d..393e18e 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1429,14 +1429,14 @@ bool ScColumn::GetFirstVisibleAttr( SCROW

[Libreoffice-commits] .: sc/source

2012-03-25 Thread Markus Mohrhard
 sc/source/ui/docshell/dbdocfun.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit b138edfab8908cf70c5a90aa9fa2b5dc5675dda7
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 25 16:13:05 2012 +0200

WaE: one more newly unused variable

diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index bb635bb..13b484a 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1461,7 +1461,6 @@ sal_uLong ScDBDocFunc::RefreshPivotTables(ScDPObject* 
pDPObj, bool bApi)
 if (!pDPs)
 return 0;
 
-ScDPSaveData* pSaveData = pDPObj-GetSaveData();
 std::setScDPObject* aRefs;
 sal_uLong nErrId = pDPs-ReloadCache(pDPObj, aRefs);
 if (nErrId)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - solenv/inc sw/qa

2012-03-25 Thread Markus Mohrhard
 solenv/inc/gbuildbridge.mk |4 ++--
 sw/qa/extras/rtftok/rtftok.cxx |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 83561ac5bb5200ec87183a951445d9592c37e888
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 25 16:31:42 2012 +0200

disable failing test

missing test document

diff --git a/sw/qa/extras/rtftok/rtftok.cxx b/sw/qa/extras/rtftok/rtftok.cxx
index 472e775..59390a5 100644
--- a/sw/qa/extras/rtftok/rtftok.cxx
+++ b/sw/qa/extras/rtftok/rtftok.cxx
@@ -89,7 +89,7 @@ public:
 CPPUNIT_TEST(testN751020);
 CPPUNIT_TEST(testFdo47326);
 CPPUNIT_TEST(testFdo47036);
-CPPUNIT_TEST(testFdo46955);
+//CPPUNIT_TEST(testFdo46955);
 #endif
 CPPUNIT_TEST_SUITE_END();
 
commit b566229371cb72aaa4511fdaee0b50ce89423095
Author: Matúš Kukan matus.ku...@gmail.com
Date:   Sun Mar 25 16:31:16 2012 +0200

enable slowcheck for top level make all again

diff --git a/solenv/inc/gbuildbridge.mk b/solenv/inc/gbuildbridge.mk
index b9b1264..529d6e2 100644
--- a/solenv/inc/gbuildbridge.mk
+++ b/solenv/inc/gbuildbridge.mk
@@ -34,8 +34,8 @@ TARGET=prj
 all:
 .ELIF $(VERBOSE)!=
 all:
-   cd $(PRJ)  $(GNUMAKE) -r -j$(GMAKE_MODULE_PARALLELISM)
+   cd $(PRJ)  $(GNUMAKE) -r -j$(GMAKE_MODULE_PARALLELISM) all slowcheck
 .ELSE
 all:
-   @cd $(PRJ)  $(GNUMAKE) -rs -j$(GMAKE_MODULE_PARALLELISM)
+   @cd $(PRJ)  $(GNUMAKE) -rs -j$(GMAKE_MODULE_PARALLELISM) all slowcheck
 .END
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 3 commits - sc/inc sc/qa sc/source

2012-03-25 Thread Markus Mohrhard
 sc/inc/dociter.hxx |   70 -
 sc/qa/extras/macros-test.cxx   |   33 +--
 sc/qa/unit/subsequent_filters-test.cxx |2 
 sc/source/core/data/dociter.cxx|   92 -
 4 files changed, 85 insertions(+), 112 deletions(-)

New commits:
commit 549a68159c3faa7bc698cd980c5c589931643549
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Mar 26 03:10:24 2012 +0200

sal_Bool - bool in dociter.[ch]xx

diff --git a/sc/inc/dociter.hxx b/sc/inc/dociter.hxx
index febd041..79495e1 100644
--- a/sc/inc/dociter.hxx
+++ b/sc/inc/dociter.hxx
@@ -73,15 +73,15 @@ private:
 SCSIZE  nColPos;
 SCSIZE  nAttrPos;
 
-sal_BoolGetThis();
-sal_BoolGetThisCol();
+boolGetThis();
+boolGetThisCol();
 
 public:
 ScDocumentIterator( ScDocument* pDocument, SCTAB nStartTable, 
SCTAB nEndTable );
 ~ScDocumentIterator();
 
-sal_BoolGetFirst();
-sal_BoolGetNext();
+boolGetFirst();
+boolGetNext();
 
 ScBaseCell* GetCell();
 const ScPatternAttr*GetPattern();
@@ -109,27 +109,27 @@ private:
 SCROW   nNextRow;
 SCROW   nAttrEndRow;
 short   nNumFmtType;
-sal_BoolbNumValid;
-sal_BoolbSubTotal;
-sal_BoolbNextValid;
-sal_BoolbCalcAsShown;
-sal_BoolbTextAsZero;
+boolbNumValid;
+boolbSubTotal;
+boolbNextValid;
+boolbCalcAsShown;
+boolbTextAsZero;
 
-sal_BoolGetThis(double rValue, sal_uInt16 rErr);
+boolGetThis(double rValue, sal_uInt16 rErr);
 public:
 
 ScValueIterator(ScDocument* pDocument,
-const ScRange rRange, sal_Bool bSTotal = 
false,
-sal_Bool bTextAsZero = false );
+const ScRange rRange, bool bSTotal = 
false,
+bool bTextAsZero = false );
 voidGetCurNumFmtInfo( short nType, sal_uLong nIndex );
 /// Does NOT reset rValue if no value found!
-sal_BoolGetFirst(double rValue, sal_uInt16 rErr);
+boolGetFirst(double rValue, sal_uInt16 rErr);
 /// Does NOT reset rValue if no value found!
-sal_BoolGetNext(double rValue, sal_uInt16 rErr)
+boolGetNext(double rValue, sal_uInt16 rErr)
 {
 return bNextValid ? ( bNextValid = false, rValue = 
fNextValue,
 rErr = 0, nRow = nNextRow,
-++nColRow, bNumValid = false, 
sal_True )
+++nColRow, bNumValid = false, 
true )
   : ( ++nRow, GetThis(rValue, rErr) );
 }
 };
@@ -233,16 +233,16 @@ private:
 SCROW   nRow;
 SCTAB   nTab;
 SCSIZE  nColRow;
-sal_BoolbSubTotal;
+boolbSubTotal;
 
 ScBaseCell* GetThis();
 public:
 ScCellIterator(ScDocument* pDocument,
SCCOL nSCol, SCROW nSRow, SCTAB nSTab,
SCCOL nECol, SCROW nERow, SCTAB nETab,
-   sal_Bool bSTotal = false);
+   bool bSTotal = false);
 ScCellIterator(ScDocument* pDocument,
-   const ScRange rRange, sal_Bool bSTotal = 
false);
+   const ScRange rRange, bool bSTotal = 
false);
 ScBaseCell* GetFirst();
 ScBaseCell* GetNext();
 SCCOL   GetCol() const { return nCol; }
@@ -281,8 +281,8 @@ private:
 SCROW   nAttrEndRow;
 sal_uInt8nStopOnMismatch;
 sal_uInt8nTestEqualCondition;
-sal_BoolbAdvanceQuery;
-sal_BoolbIgnoreMismatchOnLeadingStrings;
+boolbAdvanceQuery;
+boolbIgnoreMismatchOnLeadingStrings;
 
 ScBaseCell* GetThis();
 
@@ -299,7 +299,7 @@ private:
 
 public:
 ScQueryCellIterator(ScDocument* pDocument, SCTAB nTable,
-const ScQueryParam aParam, sal_Bool 
bMod = true);
+const ScQueryParam aParam, bool bMod 
= true);
 // for bMod = FALSE the QueryParam has 
to be filled
 // (bIsString)
 ScBaseCell* GetFirst();
@@ -309,7 +309,7 @@ public

[Libreoffice-commits] .: 2 commits - sc/source

2012-03-25 Thread Markus Mohrhard
 sc/source/ui/cctrl/checklistmenu.cxx  |2 ++
 sc/source/ui/namedlg/namemgrtable.cxx |2 ++
 2 files changed, 4 insertions(+)

New commits:
commit cb2c9eb114d3a76096fd404d733f86702246b60e
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Mar 26 05:03:52 2012 +0200

prevent update during init in name dlgs, related fdo#45679

diff --git a/sc/source/ui/namedlg/namemgrtable.cxx 
b/sc/source/ui/namedlg/namemgrtable.cxx
index d806d3b..6b52369 100644
--- a/sc/source/ui/namedlg/namemgrtable.cxx
+++ b/sc/source/ui/namedlg/namemgrtable.cxx
@@ -127,6 +127,7 @@ void ScRangeManagerTable::GetLine(ScRangeNameLine rLine, 
SvLBoxEntry* pEntry)
 
 void ScRangeManagerTable::Init()
 {
+SetUpdateMode(false);
 Clear();
 for (boost::ptr_maprtl::OUString, ScRangeName::const_iterator itr = 
mrRangeMap.begin();
 itr != mrRangeMap.end(); ++itr)
@@ -147,6 +148,7 @@ void ScRangeManagerTable::Init()
 }
 }
 }
+SetUpdateMode(true);
 }
 
 const ScRangeData* ScRangeManagerTable::findRangeData(const ScRangeNameLine 
rLine)
commit bd20b48795df0e23ac76d516d56366250157515f
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Mar 26 04:58:47 2012 +0200

prevent update during init in new autofilter dlg, fdo#45679

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index fc6dd9a..6db410c 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1164,6 +1164,7 @@ void ScCheckListMenuWindow::initMembers()
 {
 size_t n = maMembers.size();
 size_t nVisMemCount = 0;
+maChecks.SetUpdateMode(false);
 for (size_t i = 0; i  n; ++i)
 {
 maChecks.InsertEntry(maMembers[i].maName);
@@ -1188,6 +1189,7 @@ void ScCheckListMenuWindow::initMembers()
 maChkToggleAll.SetState(STATE_DONTKNOW);
 mePrevToggleAllState = STATE_DONTKNOW;
 }
+maChecks.SetUpdateMode(true);
 }
 
 void ScCheckListMenuWindow::setConfig(const Config rConfig)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 5 commits - sc/source

2012-03-24 Thread Markus Mohrhard
 sc/source/ui/unoobj/chart2uno.cxx |  111 +-
 1 file changed, 62 insertions(+), 49 deletions(-)

New commits:
commit 8269e88b9b9ba508f53489269031e5d41074fc60
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 25 04:38:20 2012 +0200

Revert simplify code - remove unnecessary and complicated allocation

This reverts commit 3ffdb45ae047f12480e73fdd4b28fe35f1e8d48c.

diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 1c637fb..5ff808b 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -717,6 +717,7 @@ void Chart2Positioner::createPositionMap()
 bool bNoGlue = (meGlue == GLUETYPE_NONE);
 SAL_WNODEPRECATED_DECLARATIONS_PUSH
 auto_ptrTable pCols(new Table);
+auto_ptrFormulaToken pNewAddress;
 auto_ptrTable pNewRowTable(new Table);
 SAL_WNODEPRECATED_DECLARATIONS_POP
 Table* pCol = NULL;
@@ -783,18 +784,19 @@ void Chart2Positioner::createPositionMap()
 aCellData.nRow = nRow;
 aCellData.nTab = nTab;
 
-if (pCol-Get(nInsRow) == NULL)
-{
-if (bExternal)
-pCol-Insert(nInsRow, new 
ScExternalSingleRefToken(nFileId, aTabName, aCellData));
-else
-pCol-Insert(nInsRow, new 
ScSingleRefToken(aCellData));
-}
+if (bExternal)
+pNewAddress.reset(new 
ScExternalSingleRefToken(nFileId, aTabName, aCellData));
+else
+pNewAddress.reset(new ScSingleRefToken(aCellData));
+
+if (pCol-Insert(nInsRow, pNewAddress.get()))
+pNewAddress.release(); // To prevent the instance from 
being destroyed.
 }
 }
 }
 nNoGlueRow += nRow2 - nRow1 + 1;
 }
+pNewAddress.reset(NULL);
 pNewRowTable.reset(NULL);
 
 bool bFillRowHeader = mbRowHeaders;
commit 3079cebfe62a482cb82a67a77e436b85f6249b9c
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 25 04:38:02 2012 +0200

Revert restructure insert code as a precursor to further simplification

This reverts commit 4aa72e0dee42c80667083c0b86a3d0ec5381c1ae.

diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index e2f7059..1c637fb 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -761,13 +761,13 @@ void Chart2Positioner::createPositionMap()
 }
 else
 {
-pCol = static_castTable*(pCols-Get(nInsCol));
-if (!pCol)
+if (pCols-Insert(nInsCol, pNewRowTable.get()))
 {
-pCol = pNewRowTable.get();
-pCols-Insert(nInsCol, pNewRowTable.release());
+pCol = pNewRowTable.release();
 pNewRowTable.reset(new Table);
 }
+else
+pCol = static_castTable*(pCols-Get(nInsCol));
 }
 
 sal_uInt32 nInsRow = static_castsal_uInt32(bNoGlue ? 
nNoGlueRow : nRow1);
@@ -786,7 +786,7 @@ void Chart2Positioner::createPositionMap()
 if (pCol-Get(nInsRow) == NULL)
 {
 if (bExternal)
-pCol-Insert(nInsRow, new 
ScExternalSingleRefToken(nFileId, aTabName, aCellData))
+pCol-Insert(nInsRow, new 
ScExternalSingleRefToken(nFileId, aTabName, aCellData));
 else
 pCol-Insert(nInsRow, new 
ScSingleRefToken(aCellData));
 }
commit d1fcea677a0d814ca92a00717a4ff7090291f6cd
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 25 04:37:41 2012 +0200

Revert if/else branches contain same code

This reverts commit 13bf19769e6e0522d920594225b9baa2c1b7dd63.

diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 1a04ce4..e2f7059 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -749,12 +749,25 @@ void Chart2Positioner::createPositionMap()
 
 for (SCCOL nCol = nCol1; nCol = nCol2; ++nCol, ++nInsCol)
 {
-pCol = static_castTable*(pCols-Get(nInsCol));
-if (!pCol)
+if (bNoGlue || meGlue == GLUETYPE_ROWS)
 {
-pCol = pNewRowTable.get();
-pCols-Insert(nInsCol, pNewRowTable.release());
-pNewRowTable.reset(new Table);
+pCol = static_castTable*(pCols-Get(nInsCol));
+if (!pCol)
+{
+pCol

[Libreoffice-commits] .: sc/Module_sc.mk sc/source

2012-03-24 Thread Markus Mohrhard
 sc/Module_sc.mk|3 +--
 sc/source/ui/docshell/dbdocfun.cxx |4 
 2 files changed, 1 insertion(+), 6 deletions(-)

New commits:
commit e4eca6763ee4967b64a219c744d9673f16382415
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 25 05:06:57 2012 +0200

remove newly unused variable

diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index 8f51646..bd61ce6 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -42,8 +42,7 @@ $(eval $(call gb_Module_add_targets,sc,\
 endif
 
 $(eval $(call gb_Module_add_check_targets,sc,\
-CppunitTest_sc_ucalc \
-CppunitTest_sc_filters_test \
+CppunitTest_sc_chart_regression_test \
 ))
 
 $(eval $(call gb_Module_add_slowcheck_targets,sc,\
diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index 5bc66c9..bb635bb 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1461,11 +1461,7 @@ sal_uLong ScDBDocFunc::RefreshPivotTables(ScDPObject* 
pDPObj, bool bApi)
 if (!pDPs)
 return 0;
 
-bool bHasGroups = false;
 ScDPSaveData* pSaveData = pDPObj-GetSaveData();
-if (pSaveData  pSaveData-GetExistingDimensionData())
-bHasGroups = true;
-
 std::setScDPObject* aRefs;
 sal_uLong nErrId = pDPs-ReloadCache(pDPObj, aRefs);
 if (nErrId)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/Module_sc.mk

2012-03-24 Thread Markus Mohrhard
 sc/Module_sc.mk |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 78cd54c09d4951fdde851507a731aba261e03e70
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 25 07:13:41 2012 +0200

revert accidently commited lines

diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index bd61ce6..8f51646 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -42,7 +42,8 @@ $(eval $(call gb_Module_add_targets,sc,\
 endif
 
 $(eval $(call gb_Module_add_check_targets,sc,\
-CppunitTest_sc_chart_regression_test \
+CppunitTest_sc_ucalc \
+CppunitTest_sc_filters_test \
 ))
 
 $(eval $(call gb_Module_add_slowcheck_targets,sc,\
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: chart2/source

2012-03-23 Thread Markus Mohrhard
 chart2/source/view/charttypes/Splines.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8a6552c0c0464d467a785cfd9c864301b81591cb
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 23 22:54:12 2012 +0100

use fabs for double values, not abs, fdo#47632

diff --git a/chart2/source/view/charttypes/Splines.cxx 
b/chart2/source/view/charttypes/Splines.cxx
index 2005c1c..6c0c877 100644
--- a/chart2/source/view/charttypes/Splines.cxx
+++ b/chart2/source/view/charttypes/Splines.cxx
@@ -465,7 +465,7 @@ bool createParameterT(const tPointVecType aUniquePoints, 
double* t)
 {
 dx = aUniquePoints[i].first - aUniquePoints[i-1].first;
 dy = aUniquePoints[i].second - aUniquePoints[i-1].second;
-fDiffMax = (abs(dx)abs(dy)) ? abs(dx) : abs(dy);
+fDiffMax = (fabs(dx)fabs(dy)) ? fabs(dx) : fabs(dy);
 // same as above, so should not be zero
 dx /= fDiffMax;
 dy /= fDiffMax;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-22 Thread Markus Mohrhard
 sc/source/core/tool/scmatrix.cxx |   33 -
 1 file changed, 16 insertions(+), 17 deletions(-)

New commits:
commit bbe088bc757fa120f50e4e104bdcd46c90f1feb1
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 23 02:05:36 2012 +0100

cache calls to mdds:mixed_type_matrix::size, related fdo#47299

diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index 5256e9a..47ed6e9 100644
--- a/sc/source/core/tool/scmatrix.cxx
+++ b/sc/source/core/tool/scmatrix.cxx
@@ -170,6 +170,7 @@ class ScMatrixImpl
 ScMatrix::DensityType meType;
 ScInterpreter* pErrorInterpreter;
 boolmbCloneIfConst; // Whether the matrix is cloned with a 
CloneIfConst() call.
+MatrixImplType::size_pair_type  maCachedSize;
 
 ScMatrixImpl();
 ScMatrixImpl(const ScMatrixImpl);
@@ -243,6 +244,7 @@ ScMatrixImpl::ScMatrixImpl(SCSIZE nC, SCSIZE nR, 
ScMatrix::DensityType eType) :
 pErrorInterpreter(NULL),
 mbCloneIfConst(true)
 {
+maCachedSize = maMat.size();
 }
 
 ScMatrixImpl::~ScMatrixImpl()
@@ -253,6 +255,7 @@ ScMatrixImpl::~ScMatrixImpl()
 void ScMatrixImpl::Clear()
 {
 maMat.clear();
+maCachedSize = maMat.size();
 }
 
 void ScMatrixImpl::SetImmutable(bool bVal)
@@ -268,6 +271,7 @@ bool ScMatrixImpl::IsImmutable() const
 void ScMatrixImpl::Resize(SCSIZE nC, SCSIZE nR)
 {
 maMat.resize(nR, nC);
+maCachedSize = maMat.size();
 }
 
 ScMatrix::DensityType ScMatrixImpl::GetDensityType() const
@@ -282,40 +286,35 @@ void ScMatrixImpl::SetErrorInterpreter( ScInterpreter* p)
 
 void ScMatrixImpl::GetDimensions( SCSIZE rC, SCSIZE rR) const
 {
-MatrixImplType::size_pair_type aDims = maMat.size();
-rR = aDims.first;
-rC = aDims.second;
+rR = maCachedSize.first;
+rC = maCachedSize.second;
 }
 
 SCSIZE ScMatrixImpl::GetElementCount() const
 {
-MatrixImplType::size_pair_type aDims = maMat.size();
-return aDims.first * aDims.second;
+return maCachedSize.first * maCachedSize.second;
 }
 
 bool ScMatrixImpl::ValidColRow( SCSIZE nC, SCSIZE nR) const
 {
-MatrixImplType::size_pair_type aDims = maMat.size();
-return nR  aDims.first  nC  aDims.second;
+return nR  maCachedSize.first  nC  maCachedSize.second;
 }
 
 bool ScMatrixImpl::ValidColRowReplicated( SCSIZE  rC, SCSIZE  rR ) const
 {
-pairsize_t, size_t aDims = maMat.size();
-
-if (aDims.second == 1  aDims.first == 1)
+if (maCachedSize.second == 1  maCachedSize.first == 1)
 {
 rC = 0;
 rR = 0;
 return true;
 }
-else if (aDims.second == 1  rR  aDims.first)
+else if (maCachedSize.second == 1  rR  maCachedSize.first)
 {
 // single column matrix.
 rC = 0;
 return true;
 }
-else if (aDims.first == 1  rC  aDims.second)
+else if (maCachedSize.first == 1  rC  maCachedSize.second)
 {
 // single row matrix.
 rR = 0;
@@ -639,8 +638,7 @@ bool ScMatrixImpl::IsNumeric() const
 
 void ScMatrixImpl::MatCopy(ScMatrixImpl mRes) const
 {
-MatrixImplType::size_pair_type s1 = maMat.size(), s2 = mRes.maMat.size();
-if (s1.first  s2.first || s1.second  s2.second)
+if (maCachedSize.first  mRes.maCachedSize.first || maCachedSize.second  
mRes.maCachedSize.second)
 {
 // destination matrix is not large enough.
 OSL_FAIL(ScMatrixImpl::MatCopy: dimension error);
@@ -648,12 +646,14 @@ void ScMatrixImpl::MatCopy(ScMatrixImpl mRes) const
 }
 
 mRes.maMat.assign(maMat);
+mRes.maCachedSize = mRes.maMat.size();
 }
 
 void ScMatrixImpl::MatTrans(ScMatrixImpl mRes) const
 {
 mRes.maMat = maMat;
 mRes.maMat.transpose();
+mRes.maCachedSize = mRes.maMat.size();
 }
 
 void ScMatrixImpl::FillDouble( double fVal, SCSIZE nC1, SCSIZE nR1, SCSIZE 
nC2, SCSIZE nR2 )
@@ -720,8 +720,7 @@ template typename _Evaluator
 bool EvalMatrix(const MatrixImplType rMat)
 {
 _Evaluator aEval;
-pairsize_t,size_t aDim = rMat.size();
-size_t nRows = aDim.first, nCols = aDim.second;
+size_t nRows = rMat.size().first, nCols = rMat.size().second;
 for (size_t i = 0; i  nRows; ++i)
 {
 for (size_t j = 0; j  nCols; ++j)
@@ -911,7 +910,7 @@ size_t ScMatrixImpl::Count(bool bCountStrings) const
 
 void ScMatrixImpl::CalcPosition(SCSIZE nIndex, SCSIZE rC, SCSIZE rR) const
 {
-SCSIZE nRowSize = maMat.size().first;
+SCSIZE nRowSize = maCachedSize.first;
 rC = nIndex / nRowSize;
 rR = nIndex - rC*nRowSize;
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: svtools/source

2012-03-22 Thread Markus Mohrhard
 svtools/source/control/valueacc.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit ffc7968ef27d662bdb2b7418eb0344039312f0bb
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 23 02:56:41 2012 +0100

Memcheck: Jump depends on unitialised variable

diff --git a/svtools/source/control/valueacc.cxx 
b/svtools/source/control/valueacc.cxx
index 22680c4..37c48c2 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -48,6 +48,7 @@ ValueSetItem::ValueSetItem( ValueSet rParent )
 : mrParent(rParent)
 , mnId(0)
 , meType(VALUESETITEM_NONE)
+, mbVisible(true)
 , mpData(NULL)
 , mpxAcc(NULL)
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-22 Thread Markus Mohrhard
 sc/source/filter/html/htmlexp.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit c4744121f12fde51de2d92d2442d590d93725ffc
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 23 04:27:45 2012 +0100

increase nCol before next iteratation to prevent loop, fdo#46220

diff --git a/sc/source/filter/html/htmlexp.cxx 
b/sc/source/filter/html/htmlexp.cxx
index 538eb09..af0689a 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -769,7 +769,11 @@ void ScHTMLExport::WriteTables()
 while( nCol = nEndCol )
 {
 if( pDoc-ColHidden(nCol, nTab) )
+{
+++nCol;
 continue;
+}
+
 if( nWidth != ToPixel( pDoc-GetColWidth( nCol, nTab ) ) )
 {
 if( nSpan != 0 )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 4 commits - formula/inc formula/source reportdesign/source sc/source sfx2/source

2012-03-21 Thread Markus Mohrhard
 formula/inc/formula/formula.hxx|   13 ++
 formula/source/ui/dlg/formula.cxx  |   42 ++---
 reportdesign/source/ui/dlg/Formula.cxx |4 ++-
 reportdesign/source/ui/inc/Formula.hxx |2 -
 sc/source/ui/formdlg/formula.cxx   |3 +-
 sc/source/ui/inc/formula.hxx   |7 -
 sfx2/source/appl/childwin.cxx  |6 +---
 7 files changed, 45 insertions(+), 32 deletions(-)

New commits:
commit 278c53c9bed24a74c4c1931e725b64deef02
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Mar 21 21:44:01 2012 +0100

restructure the code a bit more

diff --git a/formula/inc/formula/formula.hxx b/formula/inc/formula/formula.hxx
index 55cc0bc..7a16b3d 100644
--- a/formula/inc/formula/formula.hxx
+++ b/formula/inc/formula/formula.hxx
@@ -33,6 +33,7 @@
 #include memory
 #include formula/formuladllapi.h
 #include formula/omoduleclient.hxx
+#include formula/IFunctionDescription.hxx
 
 namespace formula
 {
@@ -48,7 +49,6 @@ enum FormulaDlgMode { FORMULA_FORMDLG_FORMULA, 
FORMULA_FORMDLG_ARGS, FORMULA_FOR
 
 //
 
-class IFormulaEditorHelper;
 class FormulaDlg_Impl;
 class IControlReferenceHandler;
 class IFunctionDescription;
@@ -58,7 +58,7 @@ class RefEdit;
 class RefButton;
 class FormEditData;
 //
-class FORMULA_DLLPUBLIC FormulaModalDialog :   public ModalDialog
+class FORMULA_DLLPUBLIC FormulaModalDialog :   public ModalDialog, public 
formula::IFormulaEditorHelper
 {
 friend class FormulaDlg_Impl;
 public:
@@ -66,7 +66,6 @@ public:
 , bool _bSupportFunctionResult
 , bool _bSupportResult
 , bool _bSupportMatrix
-,IFormulaEditorHelper* _pHelper
 ,IFunctionManager* _pFunctionMgr
 ,IControlReferenceHandler* _pDlg = 
NULL );
 virtual ~FormulaModalDialog();
@@ -92,7 +91,7 @@ protected:
 };
 
 class FORMULA_DLLPUBLIC FormulaDlg:
-private OModuleClient, public SfxModelessDialog
+private OModuleClient, public SfxModelessDialog, public 
IFormulaEditorHelper
 // order of base classes is important, as OModuleClient controls the
 // lifecycle of the ResMgr passed into SfxModelessDialog (via
 // formula::ModuleRes), and at least with DBG_UTIL calling TestRes in
@@ -107,7 +106,6 @@ public:
 , bool _bSupportFunctionResult
 , bool _bSupportResult
 , bool _bSupportMatrix
-, IFormulaEditorHelper* _pHelper
 , IFunctionManager* _pFunctionMgr
 , IControlReferenceHandler* _pDlg = NULL );
 virtual ~FormulaDlg();
diff --git a/formula/source/ui/dlg/formula.cxx 
b/formula/source/ui/dlg/formula.cxx
index 70eccb3..ac0cac6 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -1657,14 +1657,13 @@ FormulaModalDialog::FormulaModalDialog( Window* pParent
 , bool _bSupportFunctionResult
 , bool _bSupportResult
 , bool _bSupportMatrix
-, IFormulaEditorHelper* _pHelper
 , IFunctionManager* _pFunctionMgr
 , IControlReferenceHandler* _pDlg 
) :
 ModalDialog( pParent, ModuleRes(RID_FORMULADLG_FORMULA_MODAL) ),
 m_pImpl( new FormulaDlg_Impl(this,_bSupportFunctionResult
 , _bSupportResult
 , _bSupportMatrix
-,_pHelper,_pFunctionMgr,_pDlg))
+,this,_pFunctionMgr,_pDlg))
 {
 FreeResource();
 SetText(m_pImpl-aTitle1);
@@ -1745,12 +1744,12 @@ FormulaDlg::FormulaDlg( SfxBindings* pB, 
SfxChildWindow* pCW,
 , bool _bSupportFunctionResult
 , bool _bSupportResult
 , bool _bSupportMatrix
-, IFormulaEditorHelper* _pHelper,IFunctionManager* 
_pFunctionMgr,IControlReferenceHandler* _pDlg ) :
+, IFunctionManager* _pFunctionMgr, 
IControlReferenceHandler* _pDlg ) :
 SfxModelessDialog( pB, pCW, pParent, ModuleRes(RID_FORMULADLG_FORMULA) 
),
 m_pImpl( new FormulaDlg_Impl(this, _bSupportFunctionResult

[Libreoffice-commits] .: 3 commits - sc/qa sc/source

2012-03-18 Thread Markus Mohrhard
 sc/qa/unoapi/sc.sce   |4 ++--
 sc/source/filter/xml/xmldrani.cxx |   10 +++---
 sc/source/filter/xml/xmldrani.hxx |2 ++
 sc/source/ui/app/transobj.cxx |   15 ++-
 4 files changed, 25 insertions(+), 6 deletions(-)

New commits:
commit 0ee518863337fba9bce019e05e24f527617a4321
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 18 18:34:51 2012 +0100

also shrink used area for HTML in some cases, fdo#46230, n#677811

Hopefully this will allow pasting to external applications with whole
column/row selected while not affecting calc itself.

diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index b52ca6f..cb1fa54 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -310,7 +310,20 @@ sal_Bool ScTransferObj::GetData( const 
datatransfer::DataFlavor rFlavor )
 
 sal_Bool bIncludeFiltered = pDoc-IsCutMode() || bUsedForLink;
 
-ScImportExport aObj( pDoc, aBlock );
+ScRange aReducedBlock = aBlock;
+if ( nFormat == SOT_FORMATSTR_ID_HTML  (aBlock.aEnd.Col() == 
MAXCOL || aBlock.aEnd.Row() == MAXROW)  aBlock.aStart.Tab() == 
aBlock.aEnd.Tab() )
+{
+bool bShrunk = false;
+//shrink the area to allow pasting to external applications
+SCCOL aStartCol = aReducedBlock.aStart.Col();
+SCROW aStartRow = aReducedBlock.aStart.Row();
+SCCOL aEndCol = aReducedBlock.aEnd.Col();
+SCROW aEndRow = aReducedBlock.aEnd.Row();
+pDoc-ShrinkToUsedDataArea( bShrunk, 
aReducedBlock.aStart.Tab(), aStartCol, aStartRow, aEndCol, aEndRow, false);
+aReducedBlock = ScRange(aStartCol, aStartRow, 
aReducedBlock.aStart.Tab(), aEndCol, aEndRow, aReducedBlock.aEnd.Tab());
+}
+
+ScImportExport aObj( pDoc, aReducedBlock );
 ScExportTextOptions aTextOptions(ScExportTextOptions::None, 0, 
true);
 if ( bUsedForLink )
 {
commit 90d84c6dcb48886f697b7b29f9673f782994ae95
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 18 18:01:50 2012 +0100

disable two slow java based subsequenttests, fdo#45337

These two tests are not well designed and need 5 and 10 minute just to
check that we really return every row. This is not a good trade-off
between test coverage and execution time.

Enable them again with a better concept.

diff --git a/sc/qa/unoapi/sc.sce b/sc/qa/unoapi/sc.sce
index 28b2cf7..4d6b1d4 100644
--- a/sc/qa/unoapi/sc.sce
+++ b/sc/qa/unoapi/sc.sce
@@ -13,7 +13,7 @@
 -o sc.ScAccessiblePreviewCell
 -o sc.ScAccessiblePreviewHeaderCell
 -o sc.ScAccessiblePreviewTable
--o sc.ScAccessibleSpreadsheet
+# fdo#45337 -o sc.ScAccessibleSpreadsheet
 -o sc.ScAnnotationObj
 -o sc.ScAnnotationShapeObj
 -o sc.ScAnnotationsObj
@@ -80,7 +80,7 @@
 -o sc.ScIndexEnumeration_TableChartsEnumeration
 -o sc.ScIndexEnumeration_TableColumnsEnumeration
 -o sc.ScIndexEnumeration_TableConditionalEntryEnumeration
--o sc.ScIndexEnumeration_TableRowsEnumeration
+# fdo#45337 -o sc.ScIndexEnumeration_TableRowsEnumeration
 -o sc.ScIndexEnumeration_TextFieldEnumeration
 -o sc.ScLabelRangeObj
 -o sc.ScLabelRangesObj
commit ed88b144ce24b9a733d4a9ab6614307c96537baa
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 18 17:44:00 2012 +0100

add all imported properties to ScDBData, fdo#40426

diff --git a/sc/source/filter/xml/xmldrani.cxx 
b/sc/source/filter/xml/xmldrani.cxx
index 3ac0fe2..37c4471 100644
--- a/sc/source/filter/xml/xmldrani.cxx
+++ b/sc/source/filter/xml/xmldrani.cxx
@@ -148,6 +148,8 @@ ScXMLDatabaseRangeContext::ScXMLDatabaseRangeContext( 
ScXMLImport rImport,
 bSubTotalsEnabledUserList(false),
 bSubTotalsAscending(true),
 bFilterConditionSourceRange(false),
+bHasHeader(true),
+bByRow(false),
 meRangeType(ScDBCollection::GlobalNamed)
 {
 nSourceType = sheet::DataImportMode_NONE;
@@ -190,12 +192,14 @@ ScXMLDatabaseRangeContext::ScXMLDatabaseRangeContext( 
ScXMLImport rImport,
 break;
 case XML_TOK_DATABASE_RANGE_ATTR_ORIENTATION :
 {
-mpQueryParam-bByRow = !IsXMLToken(sValue, XML_COLUMN);
+bByRow = !IsXMLToken(sValue, XML_COLUMN);
+mpQueryParam-bByRow = bByRow;
 }
 break;
 case XML_TOK_DATABASE_RANGE_ATTR_CONTAINS_HEADER :
 {
-mpQueryParam-bHasHeader = IsXMLToken(sValue, XML_TRUE);
+bHasHeader = IsXMLToken(sValue, XML_TRUE);
+mpQueryParam-bHasHeader = bHasHeader;
 }
 break;
 case XML_TOK_DATABASE_RANGE_ATTR_DISPLAY_FILTER_BUTTONS :
@@ -303,7 +307,7 @@ ScDBData* ScXMLDatabaseRangeContext::ConvertToDBData(const 
OUString rName)
 
 SAL_WNODEPRECATED_DECLARATIONS_PUSH
 ::std::auto_ptrScDBData pData

[Libreoffice-commits] .: 2 commits - sc/qa sc/source

2012-03-18 Thread Markus Mohrhard
 sc/qa/unit/data/ods/bug-fixes.ods  |binary
 sc/qa/unit/subsequent_filters-test.cxx |   21 ++---
 sc/source/ui/app/transobj.cxx  |   26 +-
 3 files changed, 31 insertions(+), 16 deletions(-)

New commits:
commit d58421c2cc5199e9892627b894eaab64265c82e7
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 18 19:20:06 2012 +0100

add test case for fdo#40426

diff --git a/sc/qa/unit/data/ods/bug-fixes.ods 
b/sc/qa/unit/data/ods/bug-fixes.ods
index 6864235..b7c0539 100644
Binary files a/sc/qa/unit/data/ods/bug-fixes.ods and 
b/sc/qa/unit/data/ods/bug-fixes.ods differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx 
b/sc/qa/unit/subsequent_filters-test.cxx
index f5f1eaf..4aac0fc 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -41,6 +41,7 @@
 
 #include editeng/brshitem.hxx
 #include editeng/justifyitem.hxx
+#include dbdata.hxx
 
 #define CALC_DEBUG_OUTPUT 0
 #define TEST_BUG_FILES 0
@@ -483,9 +484,23 @@ void ScFiltersTest::testBugFixesODS()
 CPPUNIT_ASSERT_MESSAGE(Failed to load bugFixes.ods, xDocSh.Is());
 ScDocument* pDoc = xDocSh-GetDocument();
 
-rtl::OUString aCSVFileName;
-
createCSVPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(bugFix_Sheet2.)), 
aCSVFileName);
-testFile(aCSVFileName, pDoc, 1);
+{
+// fdo
+rtl::OUString aCSVFileName;
+
createCSVPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(bugFix_Sheet2.)), 
aCSVFileName);
+testFile(aCSVFileName, pDoc, 1);
+}
+
+{
+// fdo#40426
+ScDBData* pDBData = 
pDoc-GetDBCollection()-getNamedDBs().findByName(DBRange1);
+CPPUNIT_ASSERT(pDBData);
+CPPUNIT_ASSERT(pDBData-HasHeader());
+// no header
+pDBData = 
pDoc-GetDBCollection()-getNamedDBs().findByName(DBRange2);
+CPPUNIT_ASSERT(pDBData);
+CPPUNIT_ASSERT(!pDBData-HasHeader());
+}
 
 xDocSh-DoClose();
 }
commit 521456068d8a848e4e5a358b1ff7e8659c94a353
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 18 19:19:43 2012 +0100

some sal_Bool to bool in transobj.cxx

diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index cb1fa54..dbcfc54 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -150,7 +150,7 @@ ScTransferObj::ScTransferObj( ScDocument* pClipDoc, const 
TransferableObjectDesc
 SCCOL nCol2;
 SCROW nRow2;
 pDoc-GetClipStart( nCol1, nRow1 );
-pDoc-GetClipArea( nCol2, nRow2, sal_True );// real source area - 
include filtered rows
+pDoc-GetClipArea( nCol2, nRow2, true );// real source area - include 
filtered rows
 nCol2 = sal::static_int_castSCCOL( nCol2 + nCol1 );
 nRow2 = sal::static_int_castSCROW( nRow2 + nRow1 );
 
@@ -161,7 +161,7 @@ ScTransferObj::ScTransferObj( ScDocument* pClipDoc, const 
TransferableObjectDesc
 
 SCTAB nTab1=0;
 SCTAB nTab2=0;
-sal_Bool bFirst = sal_True;
+bool bFirst = true;
 for (SCTAB i=0; i pDoc-GetTableCount(); i++)
 if (pDoc-HasTable(i))
 {
@@ -260,7 +260,7 @@ void ScTransferObj::AddSupportedFormats()
 sal_Bool ScTransferObj::GetData( const datatransfer::DataFlavor rFlavor )
 {
 sal_uInt32  nFormat = SotExchange::GetFormat( rFlavor );
-sal_BoolbOK = false;
+boolbOK = false;
 
 if( HasFormat( nFormat ) )
 {
@@ -308,7 +308,7 @@ sal_Bool ScTransferObj::GetData( const 
datatransfer::DataFlavor rFlavor )
 if ( nFormat == SOT_FORMATSTR_ID_LINK )
 bUsedForLink = true;
 
-sal_Bool bIncludeFiltered = pDoc-IsCutMode() || bUsedForLink;
+bool bIncludeFiltered = pDoc-IsCutMode() || bUsedForLink;
 
 ScRange aReducedBlock = aBlock;
 if ( nFormat == SOT_FORMATSTR_ID_HTML  (aBlock.aEnd.Col() == 
MAXCOL || aBlock.aEnd.Row() == MAXROW)  aBlock.aStart.Tab() == 
aBlock.aEnd.Tab() )
@@ -481,7 +481,7 @@ sal_Bool ScTransferObj::WriteObject( SotStorageStreamRef 
rxOStm, void* pUserObj
 delete pSrcStm;
 }
 
-bRet = sal_True;
+bRet = true;
 
 xWorkStore-dispose();
 xWorkStore = uno::Reference  embed::XStorage ();
@@ -558,7 +558,7 @@ void ScTransferObj::SetDragSourceFlags( sal_uInt16 nFlags )
 
 void ScTransferObj::SetDragWasInternal()
 {
-bDragWasInternal = sal_True;
+bDragWasInternal = true;
 }
 
 void ScTransferObj::SetUseInApi( bool bSet )
@@ -610,7 +610,7 @@ void ScTransferObj::InitDocShell()
 
 ScDocument* pDestDoc = pDocSh-GetDocument();
 ScMarkData aDestMark;
-aDestMark.SelectTable( 0, sal_True );
+aDestMark.SelectTable( 0, true );
 
 pDestDoc-SetDocOptions( pDoc-GetDocOptions() );   // #i42666#
 
@@ -663,16 +663,16 @@ void ScTransferObj::InitDocShell()
 //  pDoc is always a Clipboard-document
 
 ScRange aDestRange( nStartX

[Libreoffice-commits] .: 2 commits - sc/inc test/source

2012-03-18 Thread Markus Mohrhard
 sc/inc/clipdata.hxx  |3 +++
 test/source/sheet/xdatabaserange.cxx |2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit fc95d20500997a1a460be6f3553727299a5080eb
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Mar 19 05:30:07 2012 +0100

adjust test for the correct dbdata import

diff --git a/test/source/sheet/xdatabaserange.cxx 
b/test/source/sheet/xdatabaserange.cxx
index 486f09f..381e892 100644
--- a/test/source/sheet/xdatabaserange.cxx
+++ b/test/source/sheet/xdatabaserange.cxx
@@ -93,7 +93,7 @@ void XDatabaseRange::testGetSortDescriptor()
 {
 sal_Bool bIsSortColumns = true;
 xProp.Value = bIsSortColumns;
-CPPUNIT_ASSERT(bIsSortColumns == false);
+CPPUNIT_ASSERT(bIsSortColumns == true);
 }
 else if (xProp.Name == 
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ContainsHeader)))
 {
commit 97c06429b8b45b9ed69f365339be4317e5ce5905
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Mar 19 05:28:21 2012 +0100

add missing forward declarations

diff --git a/sc/inc/clipdata.hxx b/sc/inc/clipdata.hxx
index 2e8567a..4d4be6a 100644
--- a/sc/inc/clipdata.hxx
+++ b/sc/inc/clipdata.hxx
@@ -29,6 +29,9 @@
 #ifndef __SC_CLIPDATA_HXX__
 #define __SC_CLIPDATA_HXX__
 
+class ScTransferObj;
+class ScDrawTransferObj;
+
 struct ScClipData
 {
 ScTransferObj*  pCellClipboard;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-16 Thread Markus Mohrhard
 sc/source/ui/view/viewfun5.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit bd8be4eae82525434454cc3c7274f7a7a44158c0
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 16 10:45:01 2012 +0100

don't paste content if user cancels html import, fdo#47393

diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index fa305a5..2456402 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -323,9 +323,15 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId,
 
aOptions.SetDetectSpecialNumber(pDlg-IsDateConversionSet());
 aObj.SetExtOptions(aOptions);
 }
+else
+{
+// prevent error dialog for user cancel action
+bRet = true;
+}
 }
+if(!bRet)
+bRet = aObj.ImportStream( *xStream, String(), nFormatId );
 // mba: clipboard always must contain absolute URLs (could be 
from alien source)
-bRet = aObj.ImportStream( *xStream, String(), nFormatId );
 }
 else if (nFormatId == FORMAT_STRING  aDataHelper.GetString( 
nFormatId, aStr ))
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/source

2012-03-16 Thread Markus Mohrhard
 sw/source/core/layout/dumpfilter.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 1a6b52a1bfc184524fc63d4a9d0b51055bf9af23
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 16 14:24:22 2012 +0100

add indentation to sw's layout dumper

diff --git a/sw/source/core/layout/dumpfilter.cxx 
b/sw/source/core/layout/dumpfilter.cxx
index b5ee4ee..75c2f0e 100644
--- a/sw/source/core/layout/dumpfilter.cxx
+++ b/sw/source/core/layout/dumpfilter.cxx
@@ -146,6 +146,7 @@ namespace sw
 writeCallback, closeCallback, ( void* ) xOut.get(), NULL );
 
 xmlTextWriterPtr writer = xmlNewTextWriter( outBuffer );
+xmlTextWriterSetIndent(writer, 1);
 xmlTextWriterStartDocument( writer, NULL, NULL, NULL );
 
 // TODO This doesn't export the whole XML file, whereas 
dumpAsXML() does it nicely
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - sc/source

2012-03-15 Thread Markus Mohrhard
 sc/source/core/data/cell.cxx  |6 +++---
 sc/source/ui/inc/namepast.hxx |1 +
 sc/source/ui/namedlg/namepast.cxx |5 ++---
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 2118ec3630fe12ff2a663c94421780870f264e83
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Mar 15 22:22:10 2012 +0100

update the relatice refs after the absolute refs, fdo#47285

The algoithm for updating absolute refs needs to calculate the old
position based on the information before any updates to the RefData

diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 6d5baaf..f191c5d 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -788,9 +788,6 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell rCell, 
ScDocument rDoc, cons
 {
 pCode = rCell.pCode-Clone();
 
-if ( nCloneFlags  SC_CLONECELL_ADJUST3DREL )
-pCode-ReadjustRelative3DReferences( rCell.aPos, aPos );
-
 // evtl. Fehler zuruecksetzen und neu kompilieren
 //  nicht im Clipboard - da muss das Fehlerflag erhalten bleiben
 //  Spezialfall Laenge=0: als Fehlerzelle erzeugt, dann auch Fehler 
behalten
@@ -827,6 +824,9 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell rCell, 
ScDocument rDoc, cons
 pCode-AdjustAbsoluteRefs( rCell.pDocument, rCell.aPos, aPos );
 }
 
+if ( nCloneFlags  SC_CLONECELL_ADJUST3DREL )
+pCode-ReadjustRelative3DReferences( rCell.aPos, aPos );
+
 if( !bCompile )
 {   // Name references with references and ColRowNames
 pCode-Reset();
commit bd43abc94d30332d06fad7964bd01dc5f70c22e7
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Mar 15 15:57:54 2012 +0100

ScNameMgrTable takes a reference, fdo#47307

diff --git a/sc/source/ui/inc/namepast.hxx b/sc/source/ui/inc/namepast.hxx
index b2abb45..77e3712 100644
--- a/sc/source/ui/inc/namepast.hxx
+++ b/sc/source/ui/inc/namepast.hxx
@@ -57,6 +57,7 @@ private:
 ScRangeManagerTable* mpTable;
 
 std::vectorrtl::OUString maSelectedNames;
+boost::ptr_maprtl::OUString, ScRangeName maRangeMap;
 public:
 ScNamePasteDlg( Window * pParent, ScDocShell* pShell, bool bInsList=true );
 
diff --git a/sc/source/ui/namedlg/namepast.cxx 
b/sc/source/ui/namedlg/namepast.cxx
index 68a406f..8b4f78b 100644
--- a/sc/source/ui/namedlg/namepast.cxx
+++ b/sc/source/ui/namedlg/namepast.cxx
@@ -54,18 +54,17 @@ ScNamePasteDlg::ScNamePasteDlg( Window * pParent, 
ScDocShell* pShell, bool )
 {
 ScDocument* pDoc = pShell-GetDocument();
 std::maprtl::OUString, ScRangeName* aCopyMap;
-boost::ptr_maprtl::OUString, ScRangeName aRangeMap;
 pDoc-GetRangeNameMap(aCopyMap);
 std::maprtl::OUString, ScRangeName*::iterator itr = aCopyMap.begin(), 
itrEnd = aCopyMap.end();
 for (; itr != itrEnd; ++itr)
 {
 rtl::OUString aTemp(itr-first);
-aRangeMap.insert(aTemp, new ScRangeName(*itr-second));
+maRangeMap.insert(aTemp, new ScRangeName(*itr-second));
 }
 
 ScViewData* pViewData = pShell-GetViewData();
 ScAddress aPos(pViewData-GetCurX(), pViewData-GetCurY(), 
pViewData-GetTabNo());
-mpTable = new ScRangeManagerTable(maCtrl, aRangeMap, aPos);
+mpTable = new ScRangeManagerTable(maCtrl, maRangeMap, aPos);
 
 maBtnPaste.SetClickHdl( LINK( this, ScNamePasteDlg, ButtonHdl) );
 maBtnPasteAll.SetClickHdl( LINK( this, ScNamePasteDlg, ButtonHdl));
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: chart2/source

2012-03-13 Thread Markus Mohrhard
 chart2/source/view/inc/ShapeFactory.hxx  |   31 ++-
 chart2/source/view/main/ShapeFactory.cxx |  300 +++
 2 files changed, 329 insertions(+), 2 deletions(-)

New commits:
commit 6974cc9a83bee80e81d27794293a4adc25731206
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Mar 13 18:05:08 2012 +0100

first part for new chart test concept

Idea:
- write the layout data to a xml file

still missing:
- xml export part
- some more properties need to be exported
- some more structure information need to be dumped
- find a way to start dumping after importing

diff --git a/chart2/source/view/inc/ShapeFactory.hxx 
b/chart2/source/view/inc/ShapeFactory.hxx
index 176f76a..480736a 100644
--- a/chart2/source/view/inc/ShapeFactory.hxx
+++ b/chart2/source/view/inc/ShapeFactory.hxx
@@ -42,17 +42,41 @@
 #include com/sun/star/lang/XMultiServiceFactory.hpp
 #include com/sun/star/graphic/XGraphic.hpp
 
+#define ENABLE_DUMP 0
+
 //.
 namespace chart
 {
 //.
 
+class DumpHelper
+{
+private:
+//XmlTextWriterPtr pWriter;
+
+public:
+   //void writeStripe(const Stripe rStripe);
+
+   void writeElement(const char*);
+   void writeAttribute(const char* pAttrName, const char* pAttrValue);
+   void writeAttribute(const char* pAttrName, const 
com::sun::star::drawing::Position3D rPosition);
+   void writeAttribute(const char* pAttrName, const rtl::OUString rName);
+   void writeAttribute(const char* pAttrName, const sal_Int32);
+   void writeAttribute(const char* pAttrName, const 
com::sun::star::drawing::Direction3D rPosition);
+   void writeAttribute(const char* pAttrName, const 
com::sun::star::drawing::PointSequenceSequence rPoints);
+   void endElement();
+};
+
+
 class Stripe;
 class ShapeFactory
 {
 public:
-ShapeFactory(::com::sun::star::uno::Reference 
::com::sun::star::lang::XMultiServiceFactory xFactory)
-{m_xShapeFactory = xFactory;}
+ShapeFactory(::com::sun::star::uno::Reference 
::com::sun::star::lang::XMultiServiceFactory xFactory):
+m_xShapeFactory(xFactory),
+mbDump(ENABLE_DUMP)
+{
+}
 
 ::com::sun::star::uno::Reference ::com::sun::star::drawing::XShapes 
 createGroup2D(
@@ -247,6 +271,9 @@ private:
 //member:
 ::com::sun::star::uno::Reference 
::com::sun::star::lang::XMultiServiceFactory
 m_xShapeFactory;
+
+bool mbDump;
+DumpHelper maDumpHerlper;
 };
 
 //.
diff --git a/chart2/source/view/main/ShapeFactory.cxx 
b/chart2/source/view/main/ShapeFactory.cxx
index 47da6f6..08e8e17 100644
--- a/chart2/source/view/main/ShapeFactory.cxx
+++ b/chart2/source/view/main/ShapeFactory.cxx
@@ -60,6 +60,8 @@
 #include basegfx/matrix/b3dhommatrix.hxx
 
 #include algorithm
+#include iostream
+#include rtl/oustringostreaminserter.hxx
 
 using namespace ::com::sun::star;
 using ::com::sun::star::uno::Reference;
@@ -67,6 +69,52 @@ using ::com::sun::star::uno::Reference;
 //.
 namespace chart
 {
+/*
+void DumpHelper::writeStripe(const Stripe rStripe)
+{
+std::cout  Stripe  std::endl;
+}*/
+
+void DumpHelper::writeElement(const char* pName)
+{
+std::cout  pName  std::endl;
+}
+
+void DumpHelper::writeAttribute(const char* pAttrName, const rtl::OUString 
rName)
+{
+std::cout  pAttrName rName  std::endl;
+}
+
+void DumpHelper::writeAttribute(const char* pAttrName, const char* pAttrValue)
+{
+std::cout  pAttrName pAttrValue  std::endl;
+}
+
+void DumpHelper::writeAttribute(const char* pAttrName, const 
drawing::Position3D rPos)
+{
+std::cout  pAttrName rPos.PositionX  ,  rPos.PositionY 
 ,  rPos.PositionZ  std::endl;
+}
+
+void DumpHelper::writeAttribute(const char* pAttrName, const 
drawing::Direction3D rDirection)
+{
+std::cout  pAttrName rDirection.DirectionX  ,  
rDirection.DirectionY  ,  rDirection.DirectionZ  std::endl;
+}
+
+void DumpHelper::writeAttribute(const char* pAttrName, const sal_Int32 nValue)
+{
+std::cout  pAttrName nValue  std::endl;
+}
+
+void DumpHelper::writeAttribute(const char* pAttrName, const 
drawing::PointSequenceSequence )
+{
+std::cout  pAttrName std::endl;
+}
+
+void DumpHelper::endElement()
+{
+std::cout  EndElement  std::endl;
+}
+
 //.
 
 //-
@@ -461,8 +509,20 @@ uno::Referencedrawing::XShape
 ASSERT_EXCEPTION( e );
 }
 }
+
+if(mbDump)
+{
+maDumpHerlper.writeElement(Cube);
+}
+
 uno::Referencedrawing::XShape xShape = impl_createCube( xTarget, 
rPosition, rSize, nRotateZAngleHundredthDegree

[Libreoffice-commits] .: chart2/source

2012-03-13 Thread Markus Mohrhard
 chart2/source/view/inc/ShapeFactory.hxx  |3 +
 chart2/source/view/main/ShapeFactory.cxx |   64 ---
 2 files changed, 45 insertions(+), 22 deletions(-)

New commits:
commit 3edbc2cf8d3ea3417d97fd278585178d55eacff8
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Mar 13 22:15:27 2012 +0100

add some more dump output + WaE unitialized values

diff --git a/chart2/source/view/inc/ShapeFactory.hxx 
b/chart2/source/view/inc/ShapeFactory.hxx
index 480736a..8fe7ba0 100644
--- a/chart2/source/view/inc/ShapeFactory.hxx
+++ b/chart2/source/view/inc/ShapeFactory.hxx
@@ -36,6 +36,7 @@
 #include com/sun/star/drawing/HomogenMatrix.hpp
 #include com/sun/star/drawing/PointSequenceSequence.hpp
 #include com/sun/star/drawing/PolyPolygonShape3D.hpp
+#include com/sun/star/drawing/PolyPolygonBezierCoords.hpp
 #include com/sun/star/drawing/Position3D.hpp
 #include com/sun/star/drawing/XDrawPage.hpp
 #include com/sun/star/drawing/XShapes.hpp
@@ -64,6 +65,8 @@ public:
void writeAttribute(const char* pAttrName, const sal_Int32);
void writeAttribute(const char* pAttrName, const 
com::sun::star::drawing::Direction3D rPosition);
void writeAttribute(const char* pAttrName, const 
com::sun::star::drawing::PointSequenceSequence rPoints);
+   void writeAttribute(const char* pAttrName, const 
com::sun::star::drawing::PolyPolygonShape3D rPoints);
+   void writeAttribute(const char* pAttrName, const 
com::sun::star::drawing::PolyPolygonBezierCoords rCoords);
void endElement();
 };
 
diff --git a/chart2/source/view/main/ShapeFactory.cxx 
b/chart2/source/view/main/ShapeFactory.cxx
index 08e8e17..f9589c2 100644
--- a/chart2/source/view/main/ShapeFactory.cxx
+++ b/chart2/source/view/main/ShapeFactory.cxx
@@ -42,7 +42,6 @@
 #include com/sun/star/drawing/NormalsKind.hpp
 #include com/sun/star/drawing/PointSequence.hpp
 #include com/sun/star/drawing/PolygonKind.hpp
-#include com/sun/star/drawing/PolyPolygonBezierCoords.hpp
 #include com/sun/star/drawing/ProjectionMode.hpp
 #include com/sun/star/drawing/ShadeMode.hpp
 #include com/sun/star/drawing/TextFitToSizeType.hpp
@@ -110,6 +109,16 @@ void DumpHelper::writeAttribute(const char* pAttrName, 
const drawing::PointSeque
 std::cout  pAttrName std::endl;
 }
 
+void DumpHelper::writeAttribute(const char* pAttrName, const 
drawing::PolyPolygonShape3D )
+{
+std::cout  pAttrName std::endl;
+}
+
+void DumpHelper::writeAttribute(const char* pAttrName, const 
drawing::PolyPolygonBezierCoords )
+{
+std::cout  pAttrName std::endl;
+}
+
 void DumpHelper::endElement()
 {
 std::cout  EndElement  std::endl;
@@ -564,8 +573,9 @@ uno::Referencedrawing::XShape
 , uno::makeAny( nPercentDiagonal ) );
 
 //Polygon
+uno::Any aAny = createPolyPolygon_Cube( rSize, 
double(nPercentDiagonal)/200.0, bRounded);
 xProp-setPropertyValue( C2U( UNO_NAME_3D_POLYPOLYGON3D )
-, createPolyPolygon_Cube( rSize, 
double(nPercentDiagonal)/200.0,bRounded) );
+, aAny );
 
 //Matrix for position
 {
@@ -584,7 +594,9 @@ uno::Referencedrawing::XShape
 {
 
maDumpHerlper.writeAttribute(depth,static_castsal_Int32(fDepth));
 
maDumpHerlper.writeAttribute(PercentDiagonal,nPercentDiagonal);
-maDumpHerlper.writeAttribute(Polygon,);
+drawing::PolyPolygonShape3D aPP;
+aAny = aPP;
+maDumpHerlper.writeAttribute(Polygon, aPP);
 maDumpHerlper.writeAttribute(Matrix,);
 }
 }
@@ -860,7 +872,9 @@ uno::Referencedrawing::XShape
 if(mbDump)
 {
 maDumpHerlper.writeAttribute(PercentDiagonal, 
nPercentDiagonal);
-maDumpHerlper.writeAttribute(Polygon,);
+drawing::PolyPolygonShape3D aPP;
+aPPolygon = aPP;
+maDumpHerlper.writeAttribute(Polygon, aPP);
 maDumpHerlper.writeAttribute(Matrix,);
 
maDumpHerlper.writeAttribute(SegmentsHor,CHART_3DOBJECT_SEGMENTCOUNT);
 maDumpHerlper.writeAttribute(SegmentsVert, 
static_castsal_Int32(nVerticalSegmentCount));
@@ -1100,7 +1114,7 @@ uno::Reference drawing::XShape 
 
 if(mbDump)
 {
-maDumpHerlper.writeAttribute(PolyPolygonBezier, );
+maDumpHerlper.writeAttribute(PolyPolygonBezier, aCoords);
 }
 }
 catch( const uno::Exception e )
@@ -1200,11 +1214,11 @@ uno::Reference drawing::XShape 
 {
 
maDumpHerlper.writeAttribute(depth,static_castsal_Int32(fDepth));
 
maDumpHerlper.writeAttribute(PercentDiagonal,nPercentDiagonal);
-maDumpHerlper.writeAttribute(Polygon, );
+maDumpHerlper.writeAttribute(Polygon, aPoly);
 maDumpHerlper.writeAttribute(DoubleSided, true

[Libreoffice-commits] .: 2 commits - chart2/Library_chartview.mk chart2/source

2012-03-13 Thread Markus Mohrhard
 chart2/Library_chartview.mk  |1 
 chart2/source/view/charttypes/AreaChart.cxx  |6 
 chart2/source/view/charttypes/VSeriesPlotter.cxx |   37 +++
 chart2/source/view/inc/DumpHelper.hxx|   71 ++
 chart2/source/view/inc/ShapeFactory.hxx  |   25 --
 chart2/source/view/inc/VSeriesPlotter.hxx|4 
 chart2/source/view/main/DumpHelper.cxx   |  137 +
 chart2/source/view/main/ShapeFactory.cxx |  234 +--
 8 files changed, 352 insertions(+), 163 deletions(-)

New commits:
commit fe01a68eaa55fa1ec32384be4c7b6b1863586dd0
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Mar 14 02:38:06 2012 +0100

refactor the chart test code a bit

diff --git a/chart2/Library_chartview.mk b/chart2/Library_chartview.mk
index e6d524c..f9e9703 100644
--- a/chart2/Library_chartview.mk
+++ b/chart2/Library_chartview.mk
@@ -97,6 +97,7 @@ $(eval $(call gb_Library_add_exception_objects,chartview,\
 chart2/source/view/main/Clipping \
 chart2/source/view/main/DataPointSymbolSupplier \
 chart2/source/view/main/DrawModelWrapper \
+chart2/source/view/main/DumpHelper \
 chart2/source/view/main/LabelPositionHelper \
 chart2/source/view/main/Linear3DTransformation \
 chart2/source/view/main/PlotterBase \
diff --git a/chart2/source/view/charttypes/AreaChart.cxx 
b/chart2/source/view/charttypes/AreaChart.cxx
index 35f7033..8aaaf23 100644
--- a/chart2/source/view/charttypes/AreaChart.cxx
+++ b/chart2/source/view/charttypes/AreaChart.cxx
@@ -598,6 +598,9 @@ void AreaChart::createShapes()
 if(!(m_pShapeFactorym_xLogicTarget.is()m_xFinalTarget.is()))
 return;
 
+if(mbDump)
+maDumpHelper.writeElement(AreaChart-Shapes);
+
 //the text labels should be always on top of the other series shapes
 //for area chart the error bars should be always on top of the other 
series shapes
 
@@ -987,6 +990,9 @@ void AreaChart::createShapes()
 }
 */
 
+if(mbDump)
+maDumpHelper.endElement();
+
 //remove and delete series-group-shape if empty
 
 //... todo
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx 
b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 8dfef2e..901e22a 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -158,6 +158,7 @@ VSeriesPlotter::VSeriesPlotter( const 
uno::ReferenceXChartType xChartTypeMode
 , m_xColorScheme()
 , m_pExplicitCategoriesProvider(0)
 , m_bPointsWereSkipped(false)
+, mbDump(ENABLE_DUMP)
 {
 OSL_POSTCOND(m_xChartTypeModel.is(),no XChartType available in view, 
fallback to default values may be wrong);
 }
@@ -431,6 +432,14 @@ uno::Reference drawing::XShape  
VSeriesPlotter::createDataLabel( const uno::Re
 {
 uno::Reference drawing::XShape  xTextShape;
 
+if(mbDump)
+{
+maDumpHelper.writeElement(DataLabel);
+maDumpHelper.writeAttribute(Value, fValue);
+maDumpHelper.writeAttribute(SumValue, fSumValue);
+maDumpHelper.writePointElement(rScreenPosition2D);
+}
+
 try
 {
 awt::Point aScreenPosition2D(rScreenPosition2D);
@@ -2161,10 +2170,19 @@ Reference drawing::XShape  
VSeriesPlotter::createLegendSymbolForSeries(
 default:
 break;
 };
+
+if(mbDump)
+{
+maDumpHelper.writeElement(LegendSymbolForSeries);
+}
+
 Reference drawing::XShape  xShape( VLegendSymbolFactory::createSymbol( 
rEntryKeyAspectRatio,
 xTarget, eLegendSymbolStyle, xShapeFactory
 , rSeries.getPropertiesOfSeries(), ePropType, aExplicitSymbol ));
 
+if(mbDump)
+maDumpHelper.endElement();
+
 return xShape;
 }
 
@@ -2217,9 +2235,19 @@ Reference drawing::XShape  
VSeriesPlotter::createLegendSymbolForPoint(
 }
 }
 
+if (mbDump)
+{
+maDumpHelper.writeElement(LegendSymbolForPoint);
+}
+
 Reference drawing::XShape  xShape( VLegendSymbolFactory::createSymbol( 
rEntryKeyAspectRatio,
 xTarget, eLegendSymbolStyle, xShapeFactory, xPointSet, ePropType, 
aExplicitSymbol ));
 
+if (mbDump)
+{
+maDumpHelper.endElement();
+}
+
 return xShape;
 }
 
@@ -2237,6 +2265,11 @@ std::vector ViewLegendEntry  
VSeriesPlotter::createLegendEntriesForSeries(
 if( ! ( xShapeFactory.is()  xTarget.is()  xContext.is() ) )
 return aResult;
 
+if(mbDump)
+{
+maDumpHelper.writeElement(LegendEntriesForSeries);
+}
+
 try
 {
 ViewLegendEntry aEntry;
@@ -2353,6 +2386,10 @@ std::vector ViewLegendEntry  
VSeriesPlotter::createLegendEntriesForSeries(
 {
 ASSERT_EXCEPTION( ex );
 }
+
+if(mbDump)
+maDumpHelper.endElement();
+
 return aResult;
 }
 
diff --git a/chart2/source/view/inc/DumpHelper.hxx 
b/chart2/source/view/inc/DumpHelper.hxx
new file mode 100644
index 000..a083d34
--- /dev/null
+++ b

[Libreoffice-commits] .: sc/source

2012-03-12 Thread Markus Mohrhard
 sc/source/ui/app/transobj.cxx   |3 ---
 sc/source/ui/docshell/impex.cxx |   20 ++--
 2 files changed, 14 insertions(+), 9 deletions(-)

New commits:
commit 2a26fe4a39b6f3b2af269b801340c32c28806250
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Mar 13 01:19:48 2012 +0100

only shrink to used area in text export, fdo#46230, related n#677811

diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 38afe52..b52ca6f 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -172,9 +172,6 @@ ScTransferObj::ScTransferObj( ScDocument* pClipDoc, const 
TransferableObjectDesc
 }
 OSL_ENSURE(!bFirst, no sheet selected);
 
-if (!pDoc-GetClipParam().isMultiRange()  nTab1 == nTab2)
-pDoc-ShrinkToDataArea( nTab1, nCol1, nRow1, nCol2, nRow2 );
-
 //  only limit to used cells if whole sheet was marked
 //  (so empty cell areas can be copied)
 if ( nCol2=MAXCOL  nRow2=MAXROW )
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 7bb959e..d4a8f80 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -70,6 +70,7 @@ class StarBASIC;
 #include editable.hxx
 #include compiler.hxx
 #include warnbox.hxx
+#include clipparam.hxx
 
 #include impex.hxx
 
@@ -1437,26 +1438,33 @@ sal_Bool ScImportExport::Doc2Text( SvStream rStrm )
 SCROW nRow;
 SCCOL nStartCol = aRange.aStart.Col();
 SCROW nStartRow = aRange.aStart.Row();
+SCTAB nStartTab = aRange.aStart.Tab();
 SCCOL nEndCol = aRange.aEnd.Col();
 SCROW nEndRow = aRange.aEnd.Row();
+SCTAB nEndTab = aRange.aEnd.Tab();
+
+if (!pDoc-GetClipParam().isMultiRange()  nStartTab == nEndTab)
+pDoc-ShrinkToDataArea( nStartTab, nStartCol, nStartRow, nEndCol, 
nEndRow );
+
 String aCell;
+
 bool bConvertLF = (GetSystemLineEnd() != LINEEND_LF);
 
 for (nRow = nStartRow; nRow = nEndRow; nRow++)
 {
-if (bIncludeFiltered || !pDoc-RowFiltered( nRow, aRange.aStart.Tab() 
))
+if (bIncludeFiltered || !pDoc-RowFiltered( nRow, nStartTab ))
 {
 for (nCol = nStartCol; nCol = nEndCol; nCol++)
 {
 CellType eType;
-pDoc-GetCellType( nCol, nRow, aRange.aStart.Tab(), eType );
+pDoc-GetCellType( nCol, nRow, nStartTab, eType );
 switch (eType)
 {
 case CELLTYPE_FORMULA:
 {
 if (bFormulas)
 {
-pDoc-GetFormula( nCol, nRow, aRange.aStart.Tab(), 
aCell );
+pDoc-GetFormula( nCol, nRow, nStartTab, aCell );
 if( aCell.Search( cSep ) != STRING_NOTFOUND )
 lcl_WriteString( rStrm, aCell, cStr, cStr );
 else
@@ -1464,7 +1472,7 @@ sal_Bool ScImportExport::Doc2Text( SvStream rStrm )
 }
 else
 {
-pDoc-GetString( nCol, nRow, aRange.aStart.Tab(), 
aCell );
+pDoc-GetString( nCol, nRow, nStartTab, aCell );
 
 bool bMultiLineText = ( aCell.Search( _LF ) != 
STRING_NOTFOUND );
 if( bMultiLineText )
@@ -1487,7 +1495,7 @@ sal_Bool ScImportExport::Doc2Text( SvStream rStrm )
 break;
 case CELLTYPE_VALUE:
 {
-pDoc-GetString( nCol, nRow, aRange.aStart.Tab(), 
aCell );
+pDoc-GetString( nCol, nRow, nStartTab, aCell );
 lcl_WriteSimpleString( rStrm, aCell );
 }
 break;
@@ -1496,7 +1504,7 @@ sal_Bool ScImportExport::Doc2Text( SvStream rStrm )
 break;
 default:
 {
-pDoc-GetString( nCol, nRow, aRange.aStart.Tab(), 
aCell );
+pDoc-GetString( nCol, nRow, nStartTab, aCell );
 
 bool bMultiLineText = ( aCell.Search( _LF ) != 
STRING_NOTFOUND );
 if( bMultiLineText )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sw/CppunitTest_sw_regression_test.mk sw/qa unotest/inc unotest/source

2012-03-09 Thread Markus Mohrhard
 sw/CppunitTest_sw_regression_test.mk |  141 ++
 sw/qa/extras/data/odt/test.odt   |binary
 sw/qa/extras/regression-test.cxx |  173 +++
 unotest/inc/unotest/bootstrapfixturebase.hxx |3 
 unotest/source/cpp/bootstrapfixturebase.cxx  |5 
 5 files changed, 322 insertions(+)

New commits:
commit b8d86729799d0494ca0a4d5ee659541d3d81f775
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 9 15:33:55 2012 +0100

add regression test for writer

use the hidden layout dump export filter to export the state of the
layout and compare it against a reference file

Still a work in progress.

diff --git a/sw/CppunitTest_sw_regression_test.mk 
b/sw/CppunitTest_sw_regression_test.mk
new file mode 100644
index 000..2e989ec
--- /dev/null
+++ b/sw/CppunitTest_sw_regression_test.mk
@@ -0,0 +1,141 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the License); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an AS IS basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# Major Contributor(s):
+# Copyright (C) 2011 Red Hat, Inc., Caolán McNamara caol...@redhat.com
+#  (initial developer)
+#
+# All Rights Reserved.
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the GPLv3+), or
+# the GNU Lesser General Public License Version 3 or later (the LGPLv3+),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+#*
+
+$(eval $(call gb_CppunitTest_CppunitTest,sw_regression_test))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_regression_test, \
+sw/qa/extras/regression-test \
+))
+
+$(eval $(call gb_CppunitTest_add_linked_libs,sw_regression_test, \
+avmedia \
+basegfx \
+comphelper \
+cppu \
+cppuhelper \
+drawinglayer \
+editeng \
+fileacc \
+for \
+forui \
+i18nisolang1 \
+msfilter \
+oox \
+sal \
+salhelper \
+sax \
+sb \
+sw \
+sfx \
+sot \
+svl \
+svt \
+svx \
+svxcore \
+   test \
+tl \
+tk \
+ucbhelper \
+   unotest \
+utl \
+vbahelper \
+vcl \
+xo \
+   $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sw_regression_test,\
+-I$(realpath $(SRCDIR)/sw/source/ui/inc) \
+-I$(realpath $(SRCDIR)/sw/inc) \
+$$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_add_api,sw_regression_test,\
+offapi \
+oovbaapi \
+udkapi \
+))
+
+$(eval $(call gb_CppunitTest_uses_ure,sw_regression_test))
+
+$(eval $(call gb_CppunitTest_add_type_rdbs,sw_regression_test,\
+oovbaapi \
+types \
+))
+
+$(eval $(call gb_CppunitTest_add_components,sw_regression_test,\
+basic/util/sb \
+comphelper/util/comphelp \
+configmgr/source/configmgr \
+dbaccess/util/dba \
+fileaccess/source/fileacc \
+filter/source/config/cache/filterconfig1 \
+forms/util/frm \
+framework/util/fwk \
+i18npool/util/i18npool \
+oox/util/oox \
+package/source/xstor/xstor \
+package/util/package2 \
+sax/source/expatwrap/expwrap \
+sax/source/fastparser/fastsax \
+sw/util/sw \
+sw/util/swd \
+sw/util/msword \
+sw/util/vbaswobj \
+scripting/source/basprov/basprov \
+scripting/util/scriptframe \
+sfx2/util/sfx \
+sot/util/sot \
+svl/source/fsstor/fsstorage \
+toolkit/util/tk \
+ucb/source/core/ucb1 \
+ucb/source/ucp/file/ucpfile1 \
+ucb/source/ucp/tdoc/ucptdoc1 \
+unotools/util/utl \
+unoxml/source/rdf/unordf \
+unoxml/source/service/unoxml \
+))
+
+$(eval $(call gb_CppunitTest_set_args,sw_regression_test,\
+--headless \
+--protector unoexceptionprotector$(gb_Library_DLLEXT) 
unoexceptionprotector \
+-env:CONFIGURATION_LAYERS=xcsxcu:$(call 
gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry) module:$(call 
gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry/spool) xcsxcu:$(call 
gb_CppunitTarget__make_url,$(OUTDIR)/unittest/registry) \
+))
+# .../spool is required for the (somewhat strange) filter configuration
+
+# we need to
+# a) explicitly depend on library msword because it is not implied by a link
+#relation
+# b) explicitly depend on the sw resource files

[Libreoffice-commits] .: 2 commits - sc/source sdext/source

2012-03-08 Thread Markus Mohrhard
 sc/source/ui/docshell/docfunc.cxx |5 -
 sdext/source/pdfimport/test/tests.cxx |  124 +-
 2 files changed, 67 insertions(+), 62 deletions(-)

New commits:
commit ccfbb8647503e9e2531c4fc1fb03354a82401e3d
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Mar 8 13:16:07 2012 +0100

use better assertion macros in pdfimport unit test

diff --git a/sdext/source/pdfimport/test/tests.cxx 
b/sdext/source/pdfimport/test/tests.cxx
index 78d0a5e..c4d7fc5 100644
--- a/sdext/source/pdfimport/test/tests.cxx
+++ b/sdext/source/pdfimport/test/tests.cxx
@@ -81,6 +81,7 @@
 #include boost/unordered_map.hpp
 
 #include cassert
+#include rtl/oustringostreaminserter.hxx
 
 using namespace ::pdfparse;
 using namespace ::pdfi;
@@ -88,6 +89,14 @@ using namespace ::com::sun::star;
 
 namespace
 {
+
+template typename charT, typename traits  std::basic_ostreamcharT, 
traits 
+operator (
+std::basic_ostreamcharT, traits  stream, rtl::OString const 
 string)
+{
+return stream  string.getStr();
+}
+
 class TestSink : public ContentSink
 {
 public:
@@ -109,17 +118,16 @@ namespace
 
 ~TestSink()
 {
-CPPUNIT_ASSERT_MESSAGE( A4 page size (in 100th of points),
-m_aPageSize.Width == 79400  
m_aPageSize.Height == 59500 );
+CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( A4 page size (in 100th of 
points): Width, m_aPageSize.Width, 79400, 0.0001);
+CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( A4 page size (in 100th of 
points): Height , m_aPageSize.Height, 59500, 0.001 );
 CPPUNIT_ASSERT_MESSAGE( endPage() called, m_bPageEnded );
-CPPUNIT_ASSERT_MESSAGE( Num pages equal one, m_nNumPages == 1 );
+CPPUNIT_ASSERT_EQUAL_MESSAGE( Num pages equal one, m_nNumPages, 
1 );
 CPPUNIT_ASSERT_MESSAGE( Correct hyperlink bounding box,
 
rtl::math::approxEqual(m_aHyperlinkBounds.X1,34.7 ) 
 
rtl::math::approxEqual(m_aHyperlinkBounds.Y1,386.0) 
 
rtl::math::approxEqual(m_aHyperlinkBounds.X2,166.7) 
 
rtl::math::approxEqual(m_aHyperlinkBounds.Y2,406.2) );
-CPPUNIT_ASSERT_MESSAGE( Correct hyperlink URI,
-m_aURI == 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(http://download.openoffice.org/;)) 
);
+CPPUNIT_ASSERT_EQUAL_MESSAGE( Correct hyperlink URI, m_aURI, 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(http://download.openoffice.org/;)) 
);
 
 const char* sText =  \n \nThis is a testtext\nNew paragraph,\nnew 
line\n
 Hyperlink, this is\n?\nThis is more text\noutline 
mode\n?\nNew paragraph\n;
@@ -127,9 +135,9 @@ namespace
 m_aTextOut.makeStringAndClear().convertToString( aTmp,
  
RTL_TEXTENCODING_ASCII_US,
  
OUSTRING_TO_OSTRING_CVTFLAGS );
-CPPUNIT_ASSERT_MESSAGE( Imported text is \This is a testtext New 
paragraph, new line
+CPPUNIT_ASSERT_EQUAL_MESSAGE( Imported text is \This is a 
testtext New paragraph, new line
  Hyperlink, this is * This is more text 
outline mode * New paragraph\,
-sText == aTmp );
+rtl::OString(sText), aTmp );
 
 CPPUNIT_ASSERT_MESSAGE( red circle seen in input, 
m_bRedCircleSeen );
 CPPUNIT_ASSERT_MESSAGE( green stroke seen in input, 
m_bGreenStrokeSeen );
@@ -185,7 +193,7 @@ namespace
 GraphicsContext rContext( getCurrentContext() );
 if( dashes.getLength() )
 comphelper::sequenceToContainer(rContext.DashArray,dashes);
-CPPUNIT_ASSERT_MESSAGE( line dashing start offset, start == 0.0 
);
+CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( line dashing start offset, 
start, 0.0, 0.1 );
 }
 
 virtual void setFlatness( double nFlatness )
@@ -250,11 +258,10 @@ namespace
 
 if( rContext.DashArray.empty() )
 {
-CPPUNIT_ASSERT_MESSAGE( Line color is green,
-rContext.LineColor.Alpha == 1.0 
-rContext.LineColor.Red == 0.0 
-rContext.LineColor.Green == 1.0 
-rContext.LineColor.Blue == 0.0 );
+CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( Line color is green, 
rContext.LineColor.Alpha, 1.0, 0.0001);
+CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( Line color is green, 
rContext.LineColor.Blue, 0.0, 0.0001);
+CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( Line color is green

[Libreoffice-commits] .: sc/source

2012-03-08 Thread Markus Mohrhard
 sc/source/ui/attrdlg/condfrmt.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit f361431f944abd9e12fad80f4880fa111214ff06
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 9 01:17:13 2012 +0100

Set entries correctly visible, fdo#47102

diff --git a/sc/source/ui/attrdlg/condfrmt.cxx 
b/sc/source/ui/attrdlg/condfrmt.cxx
index 54d7a4b..ca41c8f 100644
--- a/sc/source/ui/attrdlg/condfrmt.cxx
+++ b/sc/source/ui/attrdlg/condfrmt.cxx
@@ -647,6 +647,8 @@ IMPL_LINK_NOARG(ScConditionalFormatDlg, ChangeCond11Hdl)
 aRbCond12.Hide();
 aRbCond11.SetPosPixel( aRBtn1Pos2 );
 aEdtCond11.SetPosSizePixel( aCond1Pos1, aCond1Size1 );
+aEdtCond11.Show();
+aRbCond11.Show();
 }
 
 ChangeCond12Hdl( NULL );
@@ -742,6 +744,8 @@ IMPL_LINK_NOARG(ScConditionalFormatDlg, ChangeCond21Hdl)
 aRbCond22.Hide();
 aRbCond21.SetPosPixel( aRBtn2Pos2 );
 aEdtCond21.SetPosSizePixel( aCond2Pos1, aCond2Size1 );
+aEdtCond21.Show();
+aRbCond21.Show();
 }
 
 ChangeCond22Hdl( NULL );
@@ -839,6 +843,8 @@ IMPL_LINK_NOARG(ScConditionalFormatDlg, ChangeCond31Hdl)
 aRbCond32.Hide();
 aRbCond31.SetPosPixel( aRBtn3Pos2 );
 aEdtCond31.SetPosSizePixel( aCond3Pos1, aCond3Size1 );
+aEdtCond31.Show();
+aRbCond31.Show();
 }
 
 ChangeCond32Hdl( NULL );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - sc/source

2012-03-08 Thread Markus Mohrhard
 sc/source/ui/dbgui/filtdlg.cxx  |2 --
 sc/source/ui/dbgui/foptmgr.cxx  |   30 ++
 sc/source/ui/dbgui/sfiltdlg.cxx |2 --
 sc/source/ui/inc/filtdlg.hxx|1 -
 sc/source/ui/inc/foptmgr.hxx|2 --
 5 files changed, 18 insertions(+), 19 deletions(-)

New commits:
commit ecdc626d91d723c9861345008d6563b118a92a7a
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 9 01:51:54 2012 +0100

don't show the anonymous db string, it is for internal use only

diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx
index eec3c88..61bd2ce 100644
--- a/sc/source/ui/dbgui/foptmgr.cxx
+++ b/sc/source/ui/dbgui/foptmgr.cxx
@@ -196,9 +196,17 @@ void ScFilterOptionsMgr::Init()
 }
 }
 
-theDbArea.appendAscii(RTL_CONSTASCII_STRINGPARAM( ());
-theDbArea.append(theDbName).append(')');
-rFtDbArea.SetText( theDbArea.makeStringAndClear() );
+if ( 
!theDbName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STR_DB_LOCAL_NONAME)) )
+{
+theDbArea.appendAscii(RTL_CONSTASCII_STRINGPARAM( ());
+theDbArea.append(theDbName).append(')');
+rFtDbArea.SetText( theDbArea.makeStringAndClear() );
+}
+else
+{
+rFtDbAreaLabel.SetText( rtl::OUString() );
+rFtDbArea.SetText( rtl::OUString() );
+}
 
 //--
 // Kopierposition:
commit 259839dcb9ee74c3a24bbec12de4ec92b56ad62e
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 9 01:40:03 2012 +0100

use new anonymous db name in filter dlg, fdo#47105

diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index d3dc905..94776ce 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -114,7 +114,6 @@ ScFilterDlg::ScFilterDlg( SfxBindings* pB, SfxChildWindow* 
pCW, Window* pParent,
 aFtDbAreaLabel  ( this, ScResId( FT_DBAREA_LABEL ) ),
 aFtDbArea   ( this, ScResId( FT_DBAREA ) ),
 aStrUndefined   ( ResId::toString(ScResId(SCSTR_UNDEFINED)) ),
-aStrNoName  ( ScGlobal::GetRscString(STR_DB_NONAME) ),
 aStrNone( ResId::toString(ScResId(SCSTR_NONE)) ),
 aStrEmpty   ( ResId::toString(ScResId(SCSTR_EMPTY)) ),
 aStrNotEmpty( ResId::toString(ScResId(SCSTR_NOTEMPTY)) ),
@@ -289,7 +288,6 @@ void ScFilterDlg::Init( const SfxItemSet rArgSet )
 aFtDbAreaLabel,
 aFtDbArea,
 aFlOptions,
-aStrNoName,
 aStrUndefined );
 
 // Read in field lists and select entries
diff --git a/sc/source/ui/dbgui/foptmgr.cxx b/sc/source/ui/dbgui/foptmgr.cxx
index a7b2a80..eec3c88 100644
--- a/sc/source/ui/dbgui/foptmgr.cxx
+++ b/sc/source/ui/dbgui/foptmgr.cxx
@@ -42,6 +42,7 @@
 #include viewdata.hxx
 #include document.hxx
 #include queryparam.hxx
+#include globalnames.hxx
 
 #define _FOPTMGR_CXX
 #include foptmgr.hxx
@@ -66,7 +67,6 @@ ScFilterOptionsMgr::ScFilterOptionsMgr(
 FixedText  refFtDbAreaLabel,
 FixedInfo  refFtDbArea,
 FixedLine  refFlOptions,
-const String   refStrNoName,
 const String   refStrUndefined )
 
 :   pDlg( ptrDlg ),
@@ -85,7 +85,6 @@ ScFilterOptionsMgr::ScFilterOptionsMgr(
 rFtDbAreaLabel  ( refFtDbAreaLabel ),
 rFtDbArea   ( refFtDbArea ),
 rFlOptions  ( refFlOptions ),
-rStrNoName  ( refStrNoName ),
 rStrUndefined   ( refStrUndefined ),
 rQueryData  ( refQueryData )
 {
@@ -136,7 +135,7 @@ void ScFilterOptionsMgr::Init()
 
 if ( pViewData  pDoc )
 {
-String  theAreaStr;
+rtl::OUString theAreaStr;
 ScRange theCurArea ( ScAddress( rQueryData.nCol1,
 rQueryData.nRow1,
 pViewData-GetTabNo() ),
@@ -144,8 +143,8 @@ void ScFilterOptionsMgr::Init()
 rQueryData.nRow2,
 pViewData-GetTabNo() ) );
 ScDBCollection* pDBColl = pDoc-GetDBCollection();
-String  theDbArea;
-String  theDbName   = rStrNoName;
+rtl::OUStringBuffer theDbArea;
+rtl::OUString   
theDbName(RTL_CONSTASCII_USTRINGPARAM(STR_DB_LOCAL_NONAME));
 const formula::FormulaGrammar::AddressConvention eConv = 
pDoc-GetAddressConvention();
 
 theCurArea.Format( theAreaStr, SCR_ABS_3D, pDoc, eConv );
@@ -190,17 +189,16 @@ void ScFilterOptionsMgr::Init()
 rBtnHeader.Check( pDBData-HasHeader

[Libreoffice-commits] .: 3 commits - sc/inc sc/source

2012-03-08 Thread Markus Mohrhard
 sc/inc/globstr.hrc  |2 --
 sc/source/ui/dbgui/dbnamdlg.cxx |7 ---
 sc/source/ui/src/globstr.src|4 
 3 files changed, 4 insertions(+), 9 deletions(-)

New commits:
commit 59dcb5918dbcb93173afcd5bc4f3b01fa7bef1ee
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 9 02:16:06 2012 +0100

prevent creating new db ranges with the internal anonymous db name

diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index 0f32a4d..493b2db 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -469,7 +469,7 @@ IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl)
 
 if ( aNewName.Len()  0  aNewArea.Len()  0 )
 {
-if ( ScRangeData::IsNameValid( aNewName, pDoc ) )
+if ( ScRangeData::IsNameValid( aNewName, pDoc )  
!aNewName.EqualsAscii(STR_DB_LOCAL_NONAME) )
 {
 //  weil jetzt editiert werden kann, muss erst geparst werden
 ScRange aTmpRange;
commit 66fbd3a48ac5608eeb45629b9d285790cfcefff6
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 9 02:08:40 2012 +0100

remove one more reference to the anonymous db string

diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index 18850f8..0f32a4d 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -245,7 +245,6 @@ void ScDbNameDlg::Init()
 pDBData = pDBColl-GetDBAtCursor( nStartCol, nStartRow, nStartTab, 
sal_True );
 if ( pDBData )
 {
-::rtl::OUString theDbName;
 ScAddress  rStart = theCurArea.aStart;
 ScAddress  rEnd   = theCurArea.aEnd;
 SCCOL nCol1;
@@ -260,7 +259,9 @@ void ScDbNameDlg::Init()
  (rStart.Col() == nCol1)  (rStart.Row() == nRow1)
  (rEnd.Col()   == nCol2)  (rEnd.Row()   == nRow2 ) )
 {
-aEdName.SetText(pDBData-GetName());
+rtl::OUString aDBName = pDBData-GetName();
+if 
(!aDBName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STR_DB_LOCAL_NONAME)))
+aEdName.SetText(aDBName);
 
 aBtnHeader.Check( pDBData-HasHeader() );
 aBtnDoSize.Check( pDBData-IsDoSize() );
commit 50ade1da6464c99bd9670dbaa2fc1a9dadf6b914
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 9 02:00:47 2012 +0100

remove old unnamed db string

diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index 48f4015..5157eb6 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -67,8 +67,6 @@
 #define STR_UNDO_IMPORTDATA 37
 #define STR_UNDO_REPEATDB   38
 
-#define STR_DB_NONAME   39
-
 #define STR_MSSG_DOSUBTOTALS_0  40
 #define STR_MSSG_DOSUBTOTALS_1  41
 #define STR_MSSG_DOSUBTOTALS_2  42
diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src
index 2e852ec..164e12d 100644
--- a/sc/source/ui/src/globstr.src
+++ b/sc/source/ui/src/globstr.src
@@ -365,10 +365,6 @@ Resource RID_GLOBSTR
 {
 Text [ en-US ] = ~Change Case;
 };
-String STR_DB_NONAME
-{
-Text [ en-US ] = unnamed ;
-};
 String STR_DBNAME_IMPORT
 {
 Text [ en-US ] = Import ;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 3 commits - chart2/source sc/source

2012-03-07 Thread Markus Mohrhard
 chart2/source/view/axes/VAxisBase.cxx |3 ++-
 chart2/source/view/axes/VCartesianGrid.cxx|4 ++--
 chart2/source/view/axes/VCoordinateSystem.cxx |2 +-
 chart2/source/view/axes/VPolarAngleAxis.cxx   |4 ++--
 chart2/source/view/axes/VPolarAxis.cxx|2 +-
 chart2/source/view/charttypes/PieChart.cxx|6 --
 chart2/source/view/inc/VCoordinateSystem.hxx  |3 ++-
 sc/source/core/data/table3.cxx|4 
 sc/source/filter/xml/xmlexprt.cxx |   17 +++--
 9 files changed, 17 insertions(+), 28 deletions(-)

New commits:
commit f5ef8396744966b9bd648bc0d1cb654db8c250be
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Mar 7 15:09:16 2012 +0100

export all row styles, fdo#44336

only exporting the used row styles is a loss of information since this
means that all following rows use the height of the default row style
 # Changes to be committed:

diff --git a/sc/source/filter/xml/xmlexprt.cxx 
b/sc/source/filter/xml/xmlexprt.cxx
index b246f73..6c9e7b8 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2449,16 +2449,10 @@ void ScXMLExport::_ExportAutoStyles()
 {
 sal_Int32 
nRows(pDoc-GetLastChangedRow(sal::static_int_castSCTAB(nTable)));
 pSharedData-SetLastRow(nTable, nRows);
-table::CellRangeAddress 
aCellAddress(GetEndAddress(xTable, nTable));
-if (aCellAddress.EndRow  nRows)
-{
-++nRows;
-pRowStyles-AddNewTable(nTable, 
aCellAddress.EndRow);
-}
-else
-pRowStyles-AddNewTable(nTable, nRows);
+
+pRowStyles-AddNewTable(nTable, MAXROW);
 sal_Int32 nRow = 0;
-while (nRow = nRows  nRow = MAXROW)
+while (nRow = MAXROW)
 {
 sal_Int32 nIndex = 0;
 Reference beans::XPropertySet 
xRowProperties(xTableRows-getByIndex(nRow), uno::UNO_QUERY);
@@ -2472,11 +2466,6 @@ void ScXMLExport::_ExportAutoStyles()
 if (nRow  nOld + 1)
 pRowStyles-AddFieldStyleName(nTable, nOld + 
1, nIndex, nRow - 1);
 }
-if (aCellAddress.EndRow  nRows)
-{
-sal_Int32 
nIndex(pRowStyles-GetStyleNameIndex(nTable, nRows));
-pRowStyles-AddFieldStyleName(nTable, nRows + 1, 
nIndex, aCellAddress.EndRow);
-}
 }
 }
 }
commit bea018a7040c36e91487b27c7b59c6c8a970bf5f
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Mar 6 17:53:50 2012 +0100

there should be no need any more for this check

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 613bd6d..d740a30 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -385,14 +385,10 @@ short ScTable::CompareCell( sal_uInt16 nSort,
 if (pCell1)
 {
 eType1 = pCell1-GetCellType();
-if (eType1 == CELLTYPE_NOTE)
-pCell1 = NULL;
 }
 if (pCell2)
 {
 eType2 = pCell2-GetCellType();
-if (eType2 == CELLTYPE_NOTE)
-pCell2 = NULL;
 }
 
 if (pCell1)
commit db5cdd9cb29e315df5aa5b30bfdf0262d7ee36d7
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Mar 6 02:30:55 2012 +0100

some more auto_ptr - scoped_ptr in chart2

diff --git a/chart2/source/view/axes/VAxisBase.cxx 
b/chart2/source/view/axes/VAxisBase.cxx
index a444be3..9f20430 100644
--- a/chart2/source/view/axes/VAxisBase.cxx
+++ b/chart2/source/view/axes/VAxisBase.cxx
@@ -34,6 +34,7 @@
 #include macros.hxx
 
 #include memory
+#include boost/scoped_ptr.hpp
 
 //.
 namespace chart
@@ -167,7 +168,7 @@ void VAxisBase::setExplicitScaleAndIncrement(
 
 void VAxisBase::createAllTickInfos( ::std::vector ::std::vector TickInfo  
 rAllTickInfos )
 {
-std::auto_ptr TickFactory  apTickFactory( this-createTickFactory() );
+boost::scoped_ptr TickFactory  apTickFactory( this-createTickFactory() 
);
 if( m_aScale.ShiftedCategoryPosition )
 apTickFactory-getAllTicksShifted( rAllTickInfos );
 else
diff --git a/chart2/source/view/axes/VCartesianGrid.cxx 
b/chart2/source/view/axes/VCartesianGrid.cxx
index 166ea93..362459d 100644
--- a/chart2/source/view/axes/VCartesianGrid.cxx
+++ b/chart2/source/view/axes/VCartesianGrid.cxx
@@ -38,7 +38,7 @@
 #include com/sun/star/drawing/LineStyle.hpp
 
 #include vector
-#include memory
+#include boost/scoped_ptr.hpp

[Libreoffice-commits] .: 2 commits - chart2/source sc/inc sc/source svl/inc svl/source

2012-03-05 Thread Markus Mohrhard
 chart2/source/view/axes/VCartesianAxis.cxx |   70 ++---
 chart2/source/view/axes/VCartesianAxis.hxx |4 
 sc/inc/cell.hxx|   18 +---
 sc/inc/compiler.hxx|1 
 sc/source/core/data/cell.cxx   |   55 +
 sc/source/core/data/cell2.cxx  |   32 +++
 sc/source/core/data/table6.cxx |   47 ++-
 sc/source/core/tool/cellform.cxx   |   38 -
 sc/source/core/tool/compiler.cxx   |8 +
 sc/source/core/tool/interpr1.cxx   |2 
 sc/source/filter/xml/XMLChangeTrackingExportHelper.cxx |2 
 sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx |   10 --
 sc/source/ui/docshell/impex.cxx|4 
 sc/source/ui/unoobj/cellsuno.cxx   |2 
 sc/source/ui/view/output2.cxx  |6 -
 sc/source/ui/view/viewfun4.cxx |4 
 svl/inc/svl/zforlist.hxx   |   11 ++
 svl/source/numbers/zforlist.cxx|   43 ++
 18 files changed, 197 insertions(+), 160 deletions(-)

New commits:
commit a1410ef073d2117cb2a3c9d9a4e9ecff7d911344
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Mar 5 22:05:51 2012 +0100

move some auto_ptr to boost::scoped_ptr

diff --git a/chart2/source/view/axes/VCartesianAxis.cxx 
b/chart2/source/view/axes/VCartesianAxis.cxx
index 8291efb..264450d 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -51,7 +51,7 @@
 #include svx/unoshtxt.hxx
 
 #include algorithm
-#include memory
+#include boost/scoped_ptr.hpp
 
 //.
 namespace chart
@@ -553,17 +553,14 @@ void VCartesianAxis::createAllTickInfos( ::std::vector 
::std::vector TickInfo
 VAxisBase::createAllTickInfos(rAllTickInfos);
 }
 
-SAL_WNODEPRECATED_DECLARATIONS_PUSH
-::std::auto_ptr TickIter  VCartesianAxis::createLabelTickIterator( sal_Int32 
nTextLevel )
+TickIter* VCartesianAxis::createLabelTickIterator( sal_Int32 nTextLevel )
 {
 if( nTextLevel=0  nTextLevel  static_cast sal_Int32 
(m_aAllTickInfos.size()) )
-return ::std::auto_ptr TickIter ( new PureTickIter( 
m_aAllTickInfos[nTextLevel] ) );
-return ::std::auto_ptr TickIter ();
+new PureTickIter( m_aAllTickInfos[nTextLevel] );
+return NULL;
 }
-SAL_WNODEPRECATED_DECLARATIONS_POP
 
-SAL_WNODEPRECATED_DECLARATIONS_PUSH
-::std::auto_ptr TickIter  VCartesianAxis::createMaximumLabelTickIterator( 
sal_Int32 nTextLevel )
+TickIter* VCartesianAxis::createMaximumLabelTickIterator( sal_Int32 nTextLevel 
)
 {
 if( isComplexCategoryAxis() || isDateAxis() )
 {
@@ -576,13 +573,12 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
 if( !m_aAllTickInfos.empty() )
 {
 sal_Int32 nLongestLabelIndex = m_bUseTextLabels ? 
this-getIndexOfLongestLabel( m_aTextLabels ) : 0;
-return ::std::auto_ptr TickIter ( new MaxLabelTickIter( 
m_aAllTickInfos[0], nLongestLabelIndex ) );
+new MaxLabelTickIter( m_aAllTickInfos[0], nLongestLabelIndex );
 }
 }
 }
-return ::std::auto_ptr TickIter ();
+return NULL;
 }
-SAL_WNODEPRECATED_DECLARATIONS_POP
 
 sal_Int32 VCartesianAxis::getTextLevelCount() const
 {
@@ -1332,16 +1328,14 @@ void VCartesianAxis::doStaggeringOfLabels( const 
AxisLabelProperties rAxisLabel
 B2DVector aCummulatedLabelsDistance(0,0);
 for( sal_Int32 nTextLevel=0; nTextLevelnTextLevelCount; nTextLevel++ )
 {
-SAL_WNODEPRECATED_DECLARATIONS_PUSH
-::std::auto_ptr TickIter  apTickIter = 
createLabelTickIterator( nTextLevel );
-SAL_WNODEPRECATED_DECLARATIONS_POP
-if(apTickIter.get())
-{
-double fRotationAngleDegree = 
m_aAxisLabelProperties.fRotationAngleDegree;
-aCummulatedLabelsDistance += lcl_getLabelsDistance( 
*apTickIter.get()
-, pTickFactory2D-getDistanceAxisTickToText( 
m_aAxisProperties )
-, fRotationAngleDegree );
-}
+boost::scoped_ptr TickIter  apTickIter(createLabelTickIterator( 
nTextLevel ));
+if(apTickIter)
+{
+double fRotationAngleDegree = 
m_aAxisLabelProperties.fRotationAngleDegree;
+aCummulatedLabelsDistance += lcl_getLabelsDistance( 
*apTickIter.get()
+, pTickFactory2D-getDistanceAxisTickToText( 
m_aAxisProperties )
+, fRotationAngleDegree );
+}
 }
 }
 else if( rAxisLabelProperties.getIsStaggered() )
@@ -1367,9 +1361,7 @@ void VCartesianAxis::createLabels

[Libreoffice-commits] .: sc/source

2012-03-05 Thread Markus Mohrhard
 sc/source/ui/app/inputwin.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 77a517a467b3aa944e31b170162518f70da3793d
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Mar 6 01:16:43 2012 +0100

don't crash when scrolling in input line, fdo#46975

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 3a53bb0..c60b6ff 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1613,6 +1613,10 @@ void ScTextWnd::Command( const CommandEvent rCEvt )
 rBindings.Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
 }
 }
+else if ( nCommand == COMMAND_WHEEL )
+{
+//don't call InputChanged for COMMAND_WHEEL
+}
 else
 SC_MOD()-InputChanged( pEditView );
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - chart2/source sc/source

2012-03-04 Thread Markus Mohrhard
 chart2/source/view/axes/VCartesianAxis.cxx |2 +-
 sc/source/ui/unoobj/chart2uno.cxx  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a769fd1ec076b61c1ce2f84da87283cc637dd5d5
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 4 17:06:49 2012 +0100

correctly set the position of the axis labels, related fdo#44832

There are still some more issues but at least they are now correctly
located in the right position

All advanced attributes are not yet applied.

diff --git a/chart2/source/view/axes/VCartesianAxis.cxx 
b/chart2/source/view/axes/VCartesianAxis.cxx
index fa20c2e..a6547ef 100644
--- a/chart2/source/view/axes/VCartesianAxis.cxx
+++ b/chart2/source/view/axes/VCartesianAxis.cxx
@@ -473,11 +473,11 @@ void 
VCartesianAxis::createAllTickInfosFromComplexCategories( ::std::vector ::s
 rAllTickInfos.clear();
 sal_Int32 nLevel=0;
 sal_Int32 nLevelCount = 
m_aAxisProperties.m_pExplicitCategoriesProvider-getCategoryLevelCount();
+sal_Int32 nCatIndex = 0;
 for( ; nLevelnLevelCount; nLevel++ )
 {
 ::std::vector TickInfo  aTickInfoVector;
 std::vector ComplexCategory  aComplexCategories( 
m_aAxisProperties.m_pExplicitCategoriesProvider-getCategoriesByLevel( nLevel ) 
);
-sal_Int32 nCatIndex = 0;
 std::vector ComplexCategory ::const_iterator 
aIt(aComplexCategories.begin());
 std::vector ComplexCategory ::const_iterator 
aEnd(aComplexCategories.end());
 for(;aIt!=aEnd;++aIt)
commit 6ba126ce26c83a0e6766e8dc8c38202d2a2ab238
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Mar 4 00:05:33 2012 +0100

don't crash for empty input data in charts, fdo#46885

diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 90d1b07..034d261 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1560,7 +1560,7 @@ ScChart2DataProvider::createDataSource(
 }
 Reference chart2::data::XLabeledDataSequence  xChartSeries = 
lcl_createLabeledDataSequenceFromTokens(
 pValueTokens, pLabelTokens, m_pDocument, this, 
m_bIncludeHiddenCells ); //ownership of pointers is transfered!
-if ( xChartSeries.is()  
xChartSeries-getValues()-getData().getLength() )
+if ( xChartSeries.is()  xChartSeries-getValues().is()  
xChartSeries-getValues()-getData().getLength() )
 {
 aSeqs.push_back( xChartSeries );
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - sc/source

2012-03-04 Thread Markus Mohrhard
 sc/source/core/data/table2.cxx |   10 ++
 sc/source/core/data/table6.cxx |6 ++
 2 files changed, 16 insertions(+)

New commits:
commit bbb80dfbfff998b55c665daf366499fdbd6605d0
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Mar 5 00:20:48 2012 +0100

add notes back to ScTable::SearchRangeForAllEmptyCells

diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index 1050413..3ef92e1 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -1027,6 +1027,12 @@ bool ScTable::SearchRangeForAllEmptyCells(
 {
 ScAddress aCellPos(nCol, nRow, nTab);
 pUndoDoc-PutCell(nCol, nRow, nTab, 
pCell-Clone(*pUndoDoc, aCellPos));
+ScNotes* pNotes = pUndoDoc-GetNotes(nTab);
+ScPostIt* pPostIt = maNotes.findByAddress(nCol, nRow);
+if (pPostIt)
+{
+pNotes-insert(nCol, nRow, 
pPostIt-Clone(ScAddress(nCol, nRow, nTab), *pUndoDoc, ScAddress(nCol, nRow, 
nTab), true));
+}
 }
 aCol[nCol].SetString(nRow, nTab, 
rSearchItem.GetReplaceString(), pDocument-GetAddressConvention());
 }
commit 50506b3840980c671fde55b82954d253bd9e4ac1
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Mar 5 00:12:33 2012 +0100

readd note handling to CopyUpdated

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index f058d07..69021ce 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1077,6 +1077,16 @@ void ScTable::CopyUpdated( const ScTable* pPosTab, 
ScTable* pDestTab ) const
 {
 for (SCCOL i=0; i=MAXCOL; i++)
 aCol[i].CopyUpdated( pPosTab-aCol[i], pDestTab-aCol[i] );
+
+// insert notes with captions
+for(ScNotes::iterator itr = pDestTab-maNotes.begin(); itr != 
pDestTab-maNotes.end(); ++itr)
+{
+SCCOL nCol = itr-first.first;
+SCROW nRow = itr-first.second;
+ScPostIt* pPostIt = itr-second;
+
+pDestTab-maNotes.insert(nCol, nRow, pPostIt-Clone( ScAddress(nCol, 
nRow, nTab),*pDestTab-pDocument, ScAddress(nCol, nRow, pDestTab-nTab), true 
));
+}
 }
 
 void ScTable::InvalidateTableArea()
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-04 Thread Markus Mohrhard
 sc/source/core/data/table2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 569e8b8a9ea68588d1ae2b32596f3ce57f36ccf8
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Mar 5 01:53:43 2012 +0100

fix copy/paste error

I can't express how dumb I feel after searching for hours for a bug in
the note handling and then it is just such a small copy/paste error

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 69021ce..4aa6dbe 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -374,7 +374,7 @@ void ScTable::InsertCol( SCCOL nStartCol, SCROW nStartRow, 
SCROW nEndRow, SCSIZE
 ScPostIt* pPostIt = itr-second;
 ++itr;
 
-if (nCol = nStartRow)
+if (nCol = nStartCol)
 {
 aNotes.insert(nCol + nSize, nRow, pPostIt);
 maNotes.ReleaseNote(nCol, nRow);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-04 Thread Markus Mohrhard
 sc/source/core/data/table2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d3ebd8340f781b3e51bce6b8eeb2123ac026bedf
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Mar 5 02:12:58 2012 +0100

well one copy/paste error is not enough

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 4aa6dbe..42f1b6e 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -184,7 +184,7 @@ void ScTable::InsertRow( SCCOL nStartCol, SCCOL nEndCol, 
SCROW nStartRow, SCSIZE
 ScPostIt* pPostIt = itr-second;
 ++itr;
 
-if (nCol = nStartRow)
+if (nRow = nStartRow)
 {
 aNotes.insert(nCol, nRow + nSize, pPostIt);
 maNotes.ReleaseNote(nCol, nRow);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-04 Thread Markus Mohrhard
 sc/source/core/data/table2.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c0e58cdcac9c5138d2d6f84e4da97110eb397621
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Mar 5 02:26:12 2012 +0100

and two more errors of the same kind

It is alarming that the Notes unit test did not fail for any of these
errors

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 42f1b6e..2b9d141 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -264,7 +264,7 @@ void ScTable::DeleteRow( SCCOL nStartCol, SCCOL nEndCol, 
SCROW nStartRow, SCSIZE
 ScPostIt* pPostIt = itr-second;
 ++itr;
 
-if (nCol = nStartRow)
+if (nRow = nStartRow)
 {
 aNotes.insert(nCol, nRow - nSize, pPostIt);
 maNotes.ReleaseNote(nCol, nRow);
@@ -483,7 +483,7 @@ void ScTable::DeleteCol( SCCOL nStartCol, SCROW nStartRow, 
SCROW nEndRow, SCSIZE
 ScPostIt* pPostIt = itr-second;
 ++itr;
 
-if (nCol = nStartRow)
+if (nCol = nStartCol)
 {
 aNotes.insert(nCol - nSize, nRow, pPostIt);
 maNotes.ReleaseNote(nCol, nRow);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] Changes to 'feature/stub_writer'

2012-03-02 Thread Markus Mohrhard
New branch 'feature/stub_writer' available with the following commits:
commit fa38d91786a5ec9504cf310748eda364c2427f88
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 2 09:33:10 2012 +0100

some more work on stubbing SwDoc

it compiles and links but executing filters-test will crash due to a
problem with a SfxPoolItem

commit e13f4d08f0bf4c97e649b234d6d3f1d391a73456
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sat Feb 25 00:13:01 2012 +0100

initial work for stubbed sw

___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-02 Thread Markus Mohrhard
 sc/source/core/data/table3.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 73e9eac0e86e4ab5dec09dfde890eca8760d298a
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 2 10:20:27 2012 +0100

add missing loop conditions

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index da43fbc..613bd6d 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -604,6 +604,7 @@ void ScTable::SwapCol(SCCOL nCol1, SCCOL nCol2)
 }
 
 itr = aNoteMap.begin();
+while(itr != aNoteMap.end())
 {
 //we can here assume that there is no note in the target location
 SCCOL nCol = itr-first.first;
@@ -667,6 +668,7 @@ void ScTable::SwapRow(SCROW nRow1, SCROW nRow2)
 }
 
 itr = aNoteMap.begin();
+while(itr != aNoteMap.end())
 {
 //we can here assume that there is no note in the target location
 SCCOL nCol = itr-first.first;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 4 commits - sc/source xmloff/source

2012-03-02 Thread Markus Mohrhard
 sc/source/ui/namedlg/namedefdlg.cxx|8 +++-
 sc/source/ui/view/cellsh1.cxx  |2 --
 xmloff/source/chart/SchXMLTableContext.cxx |   12 ++--
 xmloff/source/chart/transporttypes.hxx |   12 
 4 files changed, 17 insertions(+), 17 deletions(-)

New commits:
commit 8f2d3c47ad40039a842fa09d98137155dcfdfe9e
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sat Mar 3 00:56:04 2012 +0100

don't create uno::Sequence with new, fdo#46825

The uno::Sequence copy c'tor creates a flat copy and increments the ref
count. So if you use new and later delete together with the copy
constructor you get a double delete.

diff --git a/xmloff/source/chart/SchXMLTableContext.cxx 
b/xmloff/source/chart/SchXMLTableContext.cxx
index 2228ea6..57841fa 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -729,9 +729,9 @@ SvXMLImportContext* 
SchXMLTableCellContext::CreateChildContext(
 if( nPrefix == XML_NAMESPACE_TEXT  IsXMLToken( rLocalName, XML_LIST )  
mbReadText )
 {
 SchXMLCell rCell = mrTable.aData[ mrTable.nRowIndex ][ 
mrTable.nColumnIndex ];
-rCell.pComplexString = new Sequence OUString ();
+rCell.aComplexString = Sequence OUString ();
 rCell.eType = SCH_CELL_TYPE_COMPLEX_STRING;
-pContext = new SchXMLTextListContext( GetImport(), rLocalName, 
*rCell.pComplexString );
+pContext = new SchXMLTextListContext( GetImport(), rLocalName, 
rCell.aComplexString );
 mbReadText = sal_False;//don't apply text from text:p
 }
 // text:p element - read text (and range from text:id old version)
@@ -771,12 +771,12 @@ void lcl_ApplyCellToComplexLabel( const SchXMLCell 
rCell, Sequence uno::Any 
 rComplexLabel.realloc(1);
 rComplexLabel[0] = uno::makeAny( rCell.aString );
 }
-else if( rCell.pComplexString  rCell.eType == 
SCH_CELL_TYPE_COMPLEX_STRING )
+else if( rCell.aComplexString.getLength()  rCell.eType == 
SCH_CELL_TYPE_COMPLEX_STRING )
 {
-sal_Int32 nCount = rCell.pComplexString-getLength();
+sal_Int32 nCount = rCell.aComplexString.getLength();
 rComplexLabel.realloc( nCount );
 for( sal_Int32 nN=0; nNnCount; nN++)
-rComplexLabel[nN] = uno::makeAny((*rCell.pComplexString)[nN]);
+rComplexLabel[nN] = uno::makeAny((rCell.aComplexString)[nN]);
 }
 else if( rCell.eType == SCH_CELL_TYPE_FLOAT )
 {
diff --git a/xmloff/source/chart/transporttypes.hxx 
b/xmloff/source/chart/transporttypes.hxx
index ffa4111..cb03cbc 100644
--- a/xmloff/source/chart/transporttypes.hxx
+++ b/xmloff/source/chart/transporttypes.hxx
@@ -45,17 +45,17 @@ enum SchXMLCellType
 struct SchXMLCell
 {
 rtl::OUString aString;
-::com::sun::star::uno::Sequence rtl::OUString * pComplexString;
+::com::sun::star::uno::Sequence rtl::OUString  aComplexString;
 double fValue;
 SchXMLCellType eType;
 rtl::OUString aRangeId;
 
-SchXMLCell() : pComplexString(0), fValue( 0.0 ), eType( 
SCH_CELL_TYPE_UNKNOWN )
+SchXMLCell() : aComplexString(), fValue( 0.0 ), eType( 
SCH_CELL_TYPE_UNKNOWN )
 {}
 
 SchXMLCell( const SchXMLCell rOther )
 : aString( rOther.aString )
-, pComplexString( rOther.pComplexString ? new 
::com::sun::star::uno::Sequence rtl::OUString ( *rOther.pComplexString ) : 0 )
+, aComplexString( rOther.aComplexString )
 , fValue( rOther.fValue )
 , eType( rOther.eType )
 , aRangeId( rOther.aRangeId )
@@ -63,11 +63,7 @@ struct SchXMLCell
 
 ~SchXMLCell()
 {
-if(pComplexString)
-{
-delete pComplexString;
-pComplexString=0;
-}
+
 }
 };
 
commit 5e8628e45c162299f216f6a283cb126744d873ed
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sat Mar 3 00:30:43 2012 +0100

make this variable const

there are some lifetime problems related to SchXMLCell and therefore
this helps to limit the scope of possible problems

diff --git a/xmloff/source/chart/SchXMLTableContext.cxx 
b/xmloff/source/chart/SchXMLTableContext.cxx
index 6b2e988..2228ea6 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -124,7 +124,7 @@ void lcl_fillRangeMapping(
 const size_t nTableColCount( rRow.size());
 for( size_t nCol = 0; nCol  nTableColCount; ++nCol )
 {
-OUString aRangeId( rRow[nCol].aRangeId );
+const OUString aRangeId( rRow[nCol].aRangeId );
 if( !aRangeId.isEmpty())
 {
 if( eDataRowSource == chart::ChartDataRowSource_COLUMNS )
commit 2670516f2d4f385e364cc56855e12b086b1c5a76
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 2 23:54:55 2012 +0100

remove debug statement

diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 8f76bf6..ec5b8e8

[Libreoffice-commits] .: 3 commits - sc/source sw/qa

2012-03-01 Thread Markus Mohrhard
 sc/source/core/data/table2.cxx |  116 -
 sw/qa/core/filters-test.cxx|   51 --
 2 files changed, 82 insertions(+), 85 deletions(-)

New commits:
commit 58272b98319c5da2d433c0bc5e520a12ab73c71c
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Mar 1 11:07:16 2012 +0100

fix some iterator misuse in the new notes handling

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 1af4b49..9f24b47 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -175,18 +175,31 @@ void ScTable::InsertRow( SCCOL nStartCol, SCCOL nEndCol, 
SCROW nStartRow, SCSIZE
 aCol[j].InsertRow( nStartRow, nSize );
 
 ScNotes aNotes(pDocument);
-for ( ScNotes::iterator itr = maNotes.begin(); itr != maNotes.end(); ++itr)
+ScNotes::iterator itr = maNotes.begin();
+while( itr != maNotes.end() )
 {
-if (itr-first.second = nStartRow)
+SCCOL nCol = itr-first.first;
+SCROW nRow = itr-first.second;
+ScPostIt* pPostIt = itr-second;
+++itr;
+
+if (nCol = nStartRow)
 {
-aNotes.insert(itr-first.first, itr-first.second + nSize, 
itr-second);
-maNotes.ReleaseNote(itr-first.first, itr-first.second);
+aNotes.insert(nCol, nRow + nSize, pPostIt);
+maNotes.ReleaseNote(nCol, nRow);
 }
 }
-for ( ScNotes::iterator itr = aNotes.begin(); itr != aNotes.end(); ++itr)
+
+itr = aNotes.begin();
+while( itr != aNotes.end() )
 {
-maNotes.insert( itr-first.first, itr-first.second, itr-second);
-aNotes.ReleaseNote(itr-first.first, itr-first.second);
+SCCOL nCol = itr-first.first;
+SCROW nRow = itr-first.second;
+ScPostIt* pPostIt = itr-second;
+++itr;
+
+maNotes.insert( nCol, nRow, pPostIt);
+aNotes.ReleaseNote( nCol, nRow);
 }
 
 DecRecalcLevel( false );
@@ -242,18 +255,31 @@ void ScTable::DeleteRow( SCCOL nStartCol, SCCOL nEndCol, 
SCROW nStartRow, SCSIZE
 }
 
 ScNotes aNotes(pDocument);
-for ( ScNotes::iterator itr = maNotes.begin(); itr != maNotes.end(); ++itr)
+ScNotes::iterator itr = maNotes.begin();
+while( itr != maNotes.end() )
 {
-if (itr-first.second = nStartRow)
+SCCOL nCol = itr-first.first;
+SCROW nRow = itr-first.second;
+ScPostIt* pPostIt = itr-second;
+++itr;
+
+if (nCol = nStartRow)
 {
-aNotes.insert(itr-first.first, itr-first.second - nSize, 
itr-second);
-maNotes.ReleaseNote(itr-first.first, itr-first.second);
+aNotes.insert(nCol, nRow - nSize, pPostIt);
+maNotes.ReleaseNote(nCol, nRow);
 }
 }
-for ( ScNotes::iterator itr = aNotes.begin(); itr != aNotes.end(); ++itr)
+
+itr = aNotes.begin();
+while( itr != aNotes.end() )
 {
-maNotes.insert( itr-first.first, itr-first.second, itr-second);
-aNotes.ReleaseNote(itr-first.first, itr-first.second);
+SCCOL nCol = itr-first.first;
+SCROW nRow = itr-first.second;
+ScPostIt* pPostIt = itr-second;
+++itr;
+
+maNotes.insert( nCol, nRow, pPostIt);
+aNotes.ReleaseNote( nCol, nRow);
 }
 
 {   // scope for bulk broadcast
@@ -339,20 +365,31 @@ void ScTable::InsertCol( SCCOL nStartCol, SCROW 
nStartRow, SCROW nEndRow, SCSIZE
 }
 
 ScNotes aNotes(pDocument);
-for ( ScNotes::iterator itr = maNotes.begin(); itr != maNotes.end(); ++itr)
+ScNotes::iterator itr = maNotes.begin();
+while( itr != maNotes.end() )
 {
-if (itr-first.first  nStartCol)
+SCCOL nCol = itr-first.first;
+SCROW nRow = itr-first.second;
+ScPostIt* pPostIt = itr-second;
+++itr;
+
+if (nCol = nStartRow)
 {
-aNotes.insert(itr-first.first + nSize, itr-first.second, 
itr-second);
-maNotes.ReleaseNote(itr-first.first, itr-first.second);
+aNotes.insert(nCol + nSize, nRow, pPostIt);
+maNotes.ReleaseNote(nCol, nRow);
 }
-else
-aNotes.insert( itr-first.first, itr-first.second, itr-second);
 }
-for ( ScNotes::iterator itr = aNotes.begin(); itr != aNotes.end(); ++itr)
+
+itr = aNotes.begin();
+while( itr != aNotes.end() )
 {
-maNotes.insert( itr-first.first, itr-first.second, itr-second);
-aNotes.ReleaseNote(itr-first.first, itr-first.second);
+SCCOL nCol = itr-first.first;
+SCROW nRow = itr-first.second;
+ScPostIt* pPostIt = itr-second;
+++itr;
+
+maNotes.insert( nCol, nRow, pPostIt);
+aNotes.ReleaseNote( nCol, nRow);
 }
 
 if (nStartCol0)// copy old attributes
@@ -437,20 +474,31 @@ void ScTable::DeleteCol( SCCOL nStartCol, SCROW 
nStartRow, SCROW nEndRow, SCSIZE
 }
 
 ScNotes aNotes(pDocument

[Libreoffice-commits] .: 2 commits - sc/source

2012-03-01 Thread Markus Mohrhard
 sc/source/core/data/documen2.cxx |   81 ---
 1 file changed, 1 insertion(+), 80 deletions(-)

New commits:
commit 1b93146d442bb8396126d6106f05a5bb0ee9fffa
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Mar 1 12:36:10 2012 +0100

don't try to update the range names twice

the update process is now done in cell.cxx:adjustRangeNames

diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index f082069..7cd70c8 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -991,80 +991,6 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, 
SCTAB nSrcPos,
 
 if ( !bResultsOnly )
 {
-bool bNamesLost = false;
-// array containing range names which might need update of indices.
-// The instances inserted into this vector are managed by the
-// range name container of this document, so no need to delete
-// them afterward.
-::std::vectorScRangeData* aSrcRangeNames;
-
-// the index mapping thereof
-ScRangeData::IndexMap aSrcRangeMap;
-bool bRangeNameReplace = false;
-
-// find named ranges that are used in the source sheet
-std::setsal_uInt16 aUsedNames;
-pSrcDoc-maTabs[nSrcPos]-FindRangeNamesInUse( 0, 0, MAXCOL, 
MAXROW, aUsedNames );
-
-if (pSrcDoc-pRangeName)
-{
-ScRangeName::const_iterator itr = 
pSrcDoc-pRangeName-begin(), itrEnd = pSrcDoc-pRangeName-end();
-for (; itr != itrEnd; ++itr)//! DB-Bereiche 
Pivot-Bereiche auch !!!
-{
-sal_uInt16 nOldIndex = itr-second-GetIndex();
-bool bInUse = ( aUsedNames.find(nOldIndex) != 
aUsedNames.end() );
-if (bInUse)
-{
-const ScRangeData* pExistingData = 
GetRangeName()-findByUpperName(itr-second-GetUpperName());
-if (pExistingData)
-{
-// the name exists already in the destination 
document
-// - use the existing name, but show a warning
-// (when refreshing links, the existing name is 
used and the warning not shown)
-
-sal_uInt16 nExistingIndex = 
pExistingData-GetIndex();
-
-// don't modify the named range
-aSrcRangeMap.insert(
-ScRangeData::IndexMap::value_type(nOldIndex, 
nExistingIndex));
-bRangeNameReplace = true;
-bNamesLost = true;
-}
-else
-{
-ScRangeData* pData = new ScRangeData( *itr-second 
);
-pData-SetDocument(this);
-if ( pRangeName-findByIndex( pData-GetIndex() ) )
-pData-SetIndex(0); // need new index, 
done in Insert
-if (!pRangeName-insert(pData))
-{
-OSL_FAIL(can't insert name); // 
shouldn't happen
-pData = NULL;
-}
-else
-{
-pData-TransferTabRef( nSrcPos, nDestPos );
-aSrcRangeNames.push_back(pData);
-sal_uInt16 nNewIndex = pData-GetIndex();
-aSrcRangeMap.insert(
-
ScRangeData::IndexMap::value_type(nOldIndex, nNewIndex));
-if ( !bRangeNameReplace )
-bRangeNameReplace = ( nOldIndex != 
nNewIndex );
-}
-}
-}
-}
-}
-if ( bRangeNameReplace )
-{
-// first update all inserted named formulas if they contain 
other
-// range names and used indices changed
-for (size_t i = 0, n = aSrcRangeNames.size(); i  n; ++i)  
 //! DB-Bereiche Pivot-Bereiche auch
-aSrcRangeNames[i]-ReplaceRangeNamesInUse( aSrcRangeMap );
-
-// then update the formulas, they might need the just updated 
range names
-maTabs[nDestPos]-ReplaceRangeNamesInUse( 0, 0, MAXCOL, 
MAXROW, aSrcRangeMap );
-}
 
 SCsTAB nDz = ((SCsTAB)nDestPos) - (SCsTAB)nSrcPos;
 maTabs[nDestPos]-UpdateReference(URM_COPY, 0, 0, nDestPos,
@@ -1072,11 +998,6 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, 
SCTAB nSrcPos

[Libreoffice-commits] .: sc/source

2012-03-01 Thread Markus Mohrhard
 sc/source/core/data/cell.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f7fbeac4cbb764ccd153f9aea37a07e66e96b809
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Mar 1 12:59:14 2012 +0100

use the correct db range for the copy, fdo#46712

diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 37285e7..bd616b1 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -218,7 +218,7 @@ void adjustDBRange(ScToken* pToken, ScDocument rNewDoc, 
const ScDocument* pOldD
 ScDBData* pNewDBData = aNewNamedDBs.findByName(aDBName);
 if (!pNewDBData)
 {
-pNewDBData = new ScDBData(*pNewDBData);
+pNewDBData = new ScDBData(*pDBData);
 aNewNamedDBs.insert(pNewDBData);
 }
 pToken-SetIndex(pNewDBData-GetIndex());
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - sc/inc sc/source

2012-03-01 Thread Markus Mohrhard
 sc/inc/column.hxx  |2 +-
 sc/inc/postit.hxx  |4 ++--
 sc/source/core/data/column.cxx |5 ++---
 sc/source/core/data/postit.cxx |   11 +++
 sc/source/core/data/table2.cxx |6 +++---
 5 files changed, 15 insertions(+), 13 deletions(-)

New commits:
commit 921fb226d2836673c1d3ef0f254708a5c5c0b313
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 2 01:59:01 2012 +0100

fix crashs in undo/redo realted to note captions

diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx
index 16746d6..1b370ce 100644
--- a/sc/inc/postit.hxx
+++ b/sc/inc/postit.hxx
@@ -297,7 +297,7 @@ public:
 bool insert( SCCOL nCol, SCROW nRow, ScPostIt* );
 bool insert( const ScAddress rPos, ScPostIt* );
 
-void erase(SCCOL, SCROW);
+void erase(SCCOL, SCROW, bool bForgetCaption = false);
 void erase(const ScAddress rPos);
 
 /** Returns and forgets the cell note object at the passed cell address. */
@@ -311,7 +311,7 @@ public:
 ScNotes* clone(ScDocument* pDoc, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, 
SCROW nRow2, bool bCloneNoteCaption, SCTAB nTab);
 void CopyFromClip(const ScNotes maNotes, ScDocument* pDoc, SCCOL nCol1, 
SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCsCOL nDx, SCsROW nDy, SCTAB nTab, bool 
bCloneCaption);
 
-void erase(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
+void erase(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool 
bForgetCaption = false);
 
 
 };
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 8ecacfa..8a0677f 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -1009,11 +1009,14 @@ bool ScNotes::insert(const ScAddress rPos, ScPostIt* 
pPostIt)
 return insert(rPos.Col(), rPos.Row(), pPostIt);
 }
 
-void ScNotes::erase(SCCOL nCol, SCROW nRow)
+void ScNotes::erase(SCCOL nCol, SCROW nRow, bool bForgetCaption)
 {
 iterator itr = maNoteMap.find(std::pairSCCOL, SCROW(nCol, nRow));
 if (itr != maNoteMap.end())
 {
+if (bForgetCaption)
+itr-second-ForgetCaption();
+
 delete itr-second;
 maNoteMap.erase(itr);
 }
@@ -1088,12 +1091,12 @@ void ScNotes::CopyFromClip(const ScNotes rNotes, 
ScDocument* pDoc, SCCOL nCol1,
 if (nCol+nDx = nCol1  nCol+nDx = nCol2  nRow+nDy = nRow1  
nRow+nDy = nRow2)
 {
 erase(nCol+nDx, nRow+nDy);
-insert(nCol+nDx, nRow+nDy, itr-second-Clone( ScAddress(nCol, 
nRow, nTab), *pDoc, ScAddress(nCol, nRow, nTab), bCloneCaption ));
+insert(nCol+nDx, nRow+nDy, itr-second-Clone( ScAddress(nCol, 
nRow, nTab), *pDoc, ScAddress(nCol+nDx, nRow+nDy, nTab), bCloneCaption ));
 }
 }
 }
 
-void ScNotes::erase(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
+void ScNotes::erase(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool 
bForgetCaption)
 {
 ScNotes::iterator itr = maNoteMap.begin();
 while(itr != maNoteMap.end())
@@ -1103,7 +1106,7 @@ void ScNotes::erase(SCCOL nCol1, SCROW nRow1, SCCOL 
nCol2, SCROW nRow2)
 ++itr;
 if (nCol = nCol1  nCol = nCol2  nRow = nRow1  nRow = nRow2)
 {
-erase(nCol, nRow);
+erase(nCol, nRow, bForgetCaption);
 }
 }
 }
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 4cc42f6..19fa547 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -537,7 +537,7 @@ void ScTable::DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL 
nCol2, SCROW nRow2, sal
 }
 
 if (nDelFlag  IDF_NOTE)
-maNotes.erase( nCol1, nRow1, nCol2, nRow2);
+maNotes.erase( nCol1, nRow1, nCol2, nRow2, true );
 
 if (IsStreamValid())
 // TODO: In the future we may want to check if the table has been
@@ -561,7 +561,7 @@ void ScTable::DeleteSelection( sal_uInt16 nDelFlag, const 
ScMarkData rMark )
 {
 ScRange* pRange = aRangeList[i];
 if (nDelFlag  IDF_NOTE  pRange)
-maNotes.erase(pRange-aStart.Col(), pRange-aStart.Row(), 
pRange-aEnd.Col(), pRange-aEnd.Row());
+maNotes.erase(pRange-aStart.Col(), pRange-aStart.Row(), 
pRange-aEnd.Col(), pRange-aEnd.Row(), true);
 }
 
 //
commit 1d1141cd06fcdbadd008744a28674d4b50457923
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 2 01:09:56 2012 +0100

remove unnecessary parameter

diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 8d715fb..e503005 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -194,7 +194,7 @@ public:
 voidDeleteRow( SCROW nStartRow, SCSIZE nSize );
 voidDeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 
nDelFlag );
 voidDeleteArea(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nDelFlag 
);
-voidCopyToClip(SCROW nRow1, SCROW nRow2, ScColumn rColumn, bool 
bKeepScenarioFlags, bool bCloneNoteCaptions);
+voidCopyToClip(SCROW nRow1, SCROW nRow2, ScColumn

[Libreoffice-commits] .: 2 commits - sc/inc sc/source

2012-03-01 Thread Markus Mohrhard
 sc/inc/document.hxx|   14 ---
 sc/source/core/data/column.cxx |4 +-
 sc/source/core/data/documen5.cxx   |1 
 sc/source/core/data/table2.cxx |1 
 sc/source/filter/excel/excdoc.cxx  |1 
 sc/source/ui/docshell/dbdocimp.cxx |1 
 sc/source/ui/docshell/docsh.cxx|2 +
 sc/source/ui/docshell/docsh8.cxx   |1 
 sc/source/ui/docshell/impex.cxx|1 
 sc/source/ui/unoobj/cellsuno.cxx   |1 
 sc/source/ui/unoobj/docuno.cxx |1 
 sc/source/ui/view/formatsh.cxx |   67 ++---
 12 files changed, 55 insertions(+), 40 deletions(-)

New commits:
commit 26ea23b6b5f1d80df688e4c7e325971709c3c4a6
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 2 03:46:50 2012 +0100

some sal_Bool to bool

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 1ab4940..bc72117 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -181,11 +181,11 @@ void ScFormatShell::GetStyleState( SfxItemSet rSet )
 ScTabViewShell* pTabViewShell   = GetViewData()-GetViewShell();
 SfxStyleSheetBasePool*  pStylePool  = pDoc-GetStyleSheetPool();
 
-sal_Bool bProtected = false;
+bool bProtected = false;
 SCTAB nTabCount = pDoc-GetTableCount();
 for (SCTAB i=0; inTabCount; i++)
 if (pDoc-IsTabProtected(i))// ueberhaupt eine Tabelle 
geschuetzt?
-bProtected = sal_True;
+bProtected = true;
 
 SfxWhichIteraIter(rSet);
 sal_uInt16  nWhich = aIter.FirstWhich();
@@ -240,7 +240,7 @@ void ScFormatShell::GetStyleState( SfxItemSet rSet )
 {
 ISfxTemplateCommon* pDesigner = SFX_APP()-
 
GetCurrentTemplateCommon(pTabViewShell-GetViewFrame()-GetBindings());
-sal_Bool bPage = pDesigner  SFX_STYLE_FAMILY_PAGE == 
pDesigner-GetActualFamily();
+bool bPage = pDesigner  SFX_STYLE_FAMILY_PAGE == 
pDesigner-GetActualFamily();
 
 if ( bProtected || bPage )
 rSet.DisableItem( nSlotId );
@@ -252,7 +252,7 @@ void ScFormatShell::GetStyleState( SfxItemSet rSet )
 {
 ISfxTemplateCommon* pDesigner = SFX_APP()-
 
GetCurrentTemplateCommon(pTabViewShell-GetViewFrame()-GetBindings());
-sal_Bool bPage = pDesigner  SFX_STYLE_FAMILY_PAGE == 
pDesigner-GetActualFamily();
+bool bPage = pDesigner  SFX_STYLE_FAMILY_PAGE == 
pDesigner-GetActualFamily();
 
 if ( bProtected  !bPage )
 rSet.DisableItem( nSlotId );
@@ -289,7 +289,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest rReq )
 ScMarkData rMark   = GetViewData()-GetMarkData();
 ScModule*   pScMod  = SC_MOD();
 String  aRefName;
-sal_BoolbUndo   = pDoc-IsUndoEnabled();
+boolbUndo   = pDoc-IsUndoEnabled();
 
 if (   (nSlotId == SID_STYLE_NEW)
 || (nSlotId == SID_STYLE_EDIT)
@@ -303,9 +303,9 @@ void ScFormatShell::ExecuteStyle( SfxRequest rReq )
 SfxStyleSheetBasePool*  pStylePool  = pDoc-GetStyleSheetPool();
 SfxStyleSheetBase*  pStyleSheet = NULL;
 
-sal_Bool bStyleToMarked = false;
-sal_Bool bListAction = false;
-sal_Bool bAddUndo = false;  // add ScUndoModifyStyle (style 
modified)
+bool bStyleToMarked = false;
+bool bListAction = false;
+bool bAddUndo = false;  // add ScUndoModifyStyle (style 
modified)
 ScStyleSaveData aOldData;   // for undo/redo
 ScStyleSaveData aNewData;
 
@@ -391,7 +391,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest rReq )
 
 case SID_STYLE_WATERCAN:
 {
-sal_Bool bWaterCan = pScMod-GetIsWaterCan();
+bool bWaterCan = pScMod-GetIsWaterCan();
 
 if( !bWaterCan )
 {
@@ -418,7 +418,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest rReq )
 
 if ( !bWaterCan  pStyleSheet )
 {
-pScMod-SetWaterCan( sal_True );
+pScMod-SetWaterCan( true );
 pTabViewShell-SetActivePointer( Pointer(POINTER_FILL) );
 rReq.Done();
 }
@@ -452,8 +452,8 @@ void ScFormatShell::ExecuteStyle( SfxRequest rReq )
 pTabViewShell-RemoveStyleSheetInUse( pStyleSheet 
);
 pStylePool-Remove( pStyleSheet );
 pTabViewShell-InvalidateAttribs();
-nRetMask = sal_True;
-bAddUndo = sal_True;
+nRetMask = true;
+bAddUndo = true;
 rReq.Done();
 }
 else
@@ -508,10 +508,10

[Libreoffice-commits] .: sc/source

2012-03-01 Thread Markus Mohrhard
 sc/source/core/data/table3.cxx |   65 +++--
 1 file changed, 57 insertions(+), 8 deletions(-)

New commits:
commit d7db93f5f4972a94ab3157578e9c8795dc089caa
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 2 04:49:27 2012 +0100

implement SwapCol and SwapRow for note handling again

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index db0c249..da43fbc 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -580,14 +580,39 @@ void ScTable::SwapCol(SCCOL nCol1, SCCOL nCol2)
 }
 }
 }
-for (ScNotes::iterator itr = maNotes.begin(); itr != maNotes.end(); ++itr)
+
+ScNotes aNoteMap(pDocument);
+ScNotes::iterator itr = maNotes.begin();
+while(itr != maNotes.end())
 {
-if (itr-first.first == nCol1 || itr-first.first == nCol2)
+SCCOL nCol = itr-first.first;
+SCROW nRow = itr-first.second;
+ScPostIt* pPostIt = itr-second;
+++itr;
+
+if (nCol == nCol1)
 {
-//only then we need to swap
-//TODO: implement it
+aNoteMap.insert(nCol, nRow, pPostIt);
+maNotes.ReleaseNote(nCol2, nRow);
+}
+else if (nCol == nCol2)
+{
+aNoteMap.insert(nCol, nRow, pPostIt);
+maNotes.ReleaseNote(nCol1, nRow);
+
 }
 }
+
+itr = aNoteMap.begin();
+{
+//we can here assume that there is no note in the target location
+SCCOL nCol = itr-first.first;
+SCROW nRow = itr-first.second;
+ScPostIt* pPostIt = itr-second;
+
+maNotes.insert(nCol, nRow, pPostIt);
+aNoteMap.ReleaseNote(nCol, nRow);
+}
 }
 
 void ScTable::SwapRow(SCROW nRow1, SCROW nRow2)
@@ -619,14 +644,38 @@ void ScTable::SwapRow(SCROW nRow1, SCROW nRow2)
 SetRowFiltered(nRow2, nRow2, bRow1Filtered);
 }
 
-for (ScNotes::iterator itr = maNotes.begin(); itr != maNotes.end(); ++itr)
+ScNotes aNoteMap(pDocument);
+ScNotes::iterator itr = maNotes.begin();
+while(itr != maNotes.end())
 {
-if (itr-first.second == nRow1 || itr-first.second == nRow2)
+SCCOL nCol = itr-first.first;
+SCROW nRow = itr-first.second;
+ScPostIt* pPostIt = itr-second;
+++itr;
+
+if (nRow == nRow1)
+{
+aNoteMap.insert(nCol, nRow, pPostIt);
+maNotes.ReleaseNote(nCol, nRow2);
+}
+else if (nRow == nRow2)
 {
-//only then we need to swap
-//TODO:implement it
+aNoteMap.insert(nCol, nRow, pPostIt);
+maNotes.ReleaseNote(nCol, nRow1);
+
 }
 }
+
+itr = aNoteMap.begin();
+{
+//we can here assume that there is no note in the target location
+SCCOL nCol = itr-first.first;
+SCROW nRow = itr-first.second;
+ScPostIt* pPostIt = itr-second;
+
+maNotes.insert(nCol, nRow, pPostIt);
+aNoteMap.ReleaseNote(nCol, nRow);
+}
 }
 
 short ScTable::Compare(SCCOLROW nIndex1, SCCOLROW nIndex2)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sc/source

2012-02-27 Thread Markus Mohrhard
 sc/source/filter/excel/xichart.cxx |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 0c78ff5de2ac1e10e68876ef586c0f2d9d5d626a
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Fri Feb 24 20:42:09 2012 +

fdo#40320: Insert only a placeholder since the caller relies on this 
behavior.

Signed-off-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/sc/source/filter/excel/xichart.cxx 
b/sc/source/filter/excel/xichart.cxx
index 7d5f7d9..e83b8d8 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -2135,8 +2135,9 @@ XclImpChTextRef* XclImpChSeries::GetDataLabelRef( 
sal_uInt16 nPointIdx )
 XclImpChTextMap::iterator itr = maLabels.lower_bound(nPointIdx);
 if (itr == maLabels.end() || maLabels.key_comp()(nPointIdx, 
itr-first))
 {
-// No object exists at this point index position.  Insert a new 
one.
-XclImpChTextRef p(new XclImpChText(GetChRoot()));
+// No object exists at this point index position.  Insert a new
+// placeholder.
+XclImpChTextRef p;
 itr = maLabels.insert(itr, XclImpChTextMap::value_type(nPointIdx, 
p));
 }
 return itr-second;
commit 1f2cf45c6f423c3ad1e12307e8f02a5014a3b913
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Fri Feb 24 19:44:43 2012 +

fdo#40320: Correctly import data point formats in data series.

Signed-off-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/sc/source/filter/excel/xichart.cxx 
b/sc/source/filter/excel/xichart.cxx
index 8cf884d..7d5f7d9 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -2118,8 +2118,9 @@ XclImpChDataFormatRef* XclImpChSeries::GetDataFormatRef( 
sal_uInt16 nPointIdx )
 XclImpChDataFormatMap::iterator itr = 
maPointFmts.lower_bound(nPointIdx);
 if (itr == maPointFmts.end() || maPointFmts.key_comp()(nPointIdx, 
itr-first))
 {
-// No object exists at this point index position.  Insert a new 
one.
-XclImpChDataFormatRef p(new XclImpChDataFormat(GetChRoot()));
+// No object exists at this point index position.  Insert a new
+// placeholder.
+XclImpChDataFormatRef p;
 itr = maPointFmts.insert(itr, 
XclImpChDataFormatMap::value_type(nPointIdx, p));
 }
 return itr-second;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

2012-02-26 Thread Markus Mohrhard
 sc/source/ui/namedlg/namedlg.cxx |   18 ++
 1 file changed, 18 insertions(+)

New commits:
commit 393bd0eebe09230ef90c5b343c93338526f3f4b7
Author: Noel Power noel.po...@novell.com
Date:   Fri Feb 24 12:27:37 2012 +

fix core when clicking on entries in Manage Names dialog in calc fdo#46568

diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index 56c50e8..06ad128 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -269,10 +269,28 @@ void ScNameDlg::SetActive()
 
 void ScNameDlg::UpdateChecks(ScRangeData* pData)
 {
+// remove handlers, we only want the handlers to process
+// user input and not when we are syncing the controls  with our internal
+// model ( also UpdateChecks is called already from some other event
+// handlers, triggering handlers while already processing a handler can
+// ( and does in this case ) corrupt the internal data
+
+maBtnCriteria.SetToggleHdl( Link() );
+maBtnPrintArea.SetToggleHdl( Link() );
+maBtnColHeader.SetToggleHdl( Link() );
+maBtnRowHeader.SetToggleHdl( Link() );
+
 maBtnCriteria .Check( pData-HasType( RT_CRITERIA ) );
 maBtnPrintArea.Check( pData-HasType( RT_PRINTAREA ) );
 maBtnColHeader.Check( pData-HasType( RT_COLHEADER ) );
 maBtnRowHeader.Check( pData-HasType( RT_ROWHEADER ) );
+
+// Restore handlers so user input is processed again
+Link aToggleHandler = LINK( this, ScNameDlg, EdModifyHdl );
+maBtnCriteria.SetToggleHdl( aToggleHandler );
+maBtnPrintArea.SetToggleHdl( aToggleHandler );
+maBtnColHeader.SetToggleHdl( aToggleHandler );
+maBtnRowHeader.SetToggleHdl( aToggleHandler );
 }
 
 bool ScNameDlg::IsNameValid()
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 3 commits - chart2/source sc/source

2012-02-20 Thread Markus Mohrhard
 chart2/source/tools/ExplicitCategoriesProvider.cxx |   10 +-
 sc/source/ui/unoobj/chart2uno.cxx  |2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit e4f14d089d81459ac2bf3c40e75e6cfd348b58c5
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Feb 21 03:06:27 2012 +0100

don't add empty categories, fdo#46332

diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 0317f94..7e42f8d 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1560,7 +1560,7 @@ ScChart2DataProvider::createDataSource(
 }
 Reference chart2::data::XLabeledDataSequence  xChartSeries = 
lcl_createLabeledDataSequenceFromTokens(
 pValueTokens, pLabelTokens, m_pDocument, this, 
m_bIncludeHiddenCells ); //ownership of pointers is transfered!
-if ( xChartSeries.is() )
+if ( xChartSeries.is()  
xChartSeries-getValues()-getData().getLength() )
 {
 aSeqs.push_back( xChartSeries );
 }
commit fc8a69bd337a8523eebe5f47a4fe49519cfc3fbc
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Feb 21 02:44:50 2012 +0100

fix typo

diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx 
b/chart2/source/tools/ExplicitCategoriesProvider.cxx
index b174912..73f5801 100644
--- a/chart2/source/tools/ExplicitCategoriesProvider.cxx
+++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx
@@ -86,19 +86,19 @@ ExplicitCategoriesProvider::ExplicitCategoriesProvider( 
const Reference chart2:
 {
 uno::Reference data::XDataProvider  xDataProvider( 
xChartDoc-getDataProvider() );
 
-OUString aCatgoriesRange( 
DataSourceHelper::getRangeFromValues( m_xOriginalCategories ) );
-if( xDataProvider.is()  !aCatgoriesRange.isEmpty() )
+OUString aCategoriesRange( 
DataSourceHelper::getRangeFromValues( m_xOriginalCategories ) );
+if( xDataProvider.is()  !aCategoriesRange.isEmpty() )
 {
 const bool bFirstCellAsLabel = false;
 const bool bHasCategories = false;
 const uno::Sequence sal_Int32  aSequenceMapping;
 
 uno::Reference data::XDataSource  
xColumnCategoriesSource( xDataProvider-createDataSource(
- DataSourceHelper::createArguments( aCatgoriesRange, 
aSequenceMapping, true /*bUseColumns*/
+ DataSourceHelper::createArguments( aCategoriesRange, 
aSequenceMapping, true /*bUseColumns*/
 , bFirstCellAsLabel, bHasCategories ) ) );
 
 uno::Reference data::XDataSource  xRowCategoriesSource( 
xDataProvider-createDataSource(
- DataSourceHelper::createArguments( aCatgoriesRange, 
aSequenceMapping, false /*bUseColumns*/
+ DataSourceHelper::createArguments( aCategoriesRange, 
aSequenceMapping, false /*bUseColumns*/
 , bFirstCellAsLabel, bHasCategories ) ) );
 
 if( xColumnCategoriesSource.is()   
xRowCategoriesSource.is() )
commit b57137d1ca3902e4c191fa0e3a87219380a0
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Feb 20 16:05:42 2012 +0100

use const_iterator for begin and end

diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx 
b/chart2/source/tools/ExplicitCategoriesProvider.cxx
index 80f2808..b174912 100644
--- a/chart2/source/tools/ExplicitCategoriesProvider.cxx
+++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx
@@ -321,7 +321,7 @@ std::vector ComplexCategory  
lcl_DataSequenceToComplexCategoryVector(
 sal_Int32 lcl_getCategoryCount( std::vector ComplexCategory  
rComplexCategories )
 {
 sal_Int32 nCount = 0;
-std::vector ComplexCategory ::iterator aIt( rComplexCategories.begin() );
+std::vector ComplexCategory ::const_iterator aIt( 
rComplexCategories.begin() );
 std::vector ComplexCategory ::const_iterator aEnd( 
rComplexCategories.end() );
 for( ; aIt != aEnd; ++aIt )
 nCount+=aIt-Count;
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 3 commits - sc/qa test/inc test/source

2012-02-19 Thread Markus Mohrhard
 sc/qa/extras/scdatabaserangeobj.cxx   |3 -
 sc/qa/extras/testdocuments/ScDatabaseRangeObj.ods |binary
 test/inc/test/sheet/xdatabaserange.hxx|1 
 test/source/sheet/xdatabaserange.cxx  |   47 ++
 test/source/sheet/xspreadsheets2.cxx  |2 
 5 files changed, 51 insertions(+), 2 deletions(-)

New commits:
commit d9653ee2f3bc1f77a31df6978e9d4ed4e74dbfb0
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Feb 19 15:50:32 2012 +0100

add testRefresh to ScDatabaseRangeObj, related fdo#44167

diff --git a/sc/qa/extras/scdatabaserangeobj.cxx 
b/sc/qa/extras/scdatabaserangeobj.cxx
index e9f09c6..03cf4d5 100644
--- a/sc/qa/extras/scdatabaserangeobj.cxx
+++ b/sc/qa/extras/scdatabaserangeobj.cxx
@@ -37,7 +37,7 @@
 
 namespace sc_apitest {
 
-#define NUMBER_OF_TESTS 5
+#define NUMBER_OF_TESTS 6
 
 class ScDatabaseRangeObj : public UnoApiTest, apitest::XDatabaseRange
 {
@@ -53,6 +53,7 @@ public:
 CPPUNIT_TEST(testGetSubtotalDescriptor);
 CPPUNIT_TEST(testGetImportDescriptor);
 CPPUNIT_TEST(testGetFilterDescriptor);
+CPPUNIT_TEST(testRefresh);
 CPPUNIT_TEST_SUITE_END();
 private:
 static sal_Int32 nTest;
diff --git a/sc/qa/extras/testdocuments/ScDatabaseRangeObj.ods 
b/sc/qa/extras/testdocuments/ScDatabaseRangeObj.ods
index 0561655..48f001c 100644
Binary files a/sc/qa/extras/testdocuments/ScDatabaseRangeObj.ods and 
b/sc/qa/extras/testdocuments/ScDatabaseRangeObj.ods differ
commit 92009abe68c180aa3c66b5159e3324665cf3c709
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Feb 19 15:49:35 2012 +0100

add testRefresh to XDatabaseRange

XDatabase range test case is now finished

diff --git a/test/inc/test/sheet/xdatabaserange.hxx 
b/test/inc/test/sheet/xdatabaserange.hxx
index d388aa3..3e38056 100644
--- a/test/inc/test/sheet/xdatabaserange.hxx
+++ b/test/inc/test/sheet/xdatabaserange.hxx
@@ -45,6 +45,7 @@ public:
 void testGetSubtotalDescriptor();
 void testGetImportDescriptor();
 void testGetFilterDescriptor();
+void testRefresh();
 };
 
 }
diff --git a/test/source/sheet/xdatabaserange.cxx 
b/test/source/sheet/xdatabaserange.cxx
index 51e3c32..486f09f 100644
--- a/test/source/sheet/xdatabaserange.cxx
+++ b/test/source/sheet/xdatabaserange.cxx
@@ -37,6 +37,10 @@
 #include com/sun/star/table/CellRangeAddress.hpp
 #include com/sun/star/util/XCloseable.hpp
 #include com/sun/star/beans/XPropertySet.hpp
+#include com/sun/star/sheet/XCellRangeReferrer.hpp
+#include com/sun/star/table/XCell.hpp
+#include com/sun/star/table/XTableRows.hpp
+#include com/sun/star/table/XColumnRowRange.hpp
 
 #include rtl/oustringostreaminserter.hxx
 #include cppunit/extensions/HelperMacros.h
@@ -153,6 +157,49 @@ void XDatabaseRange::testGetImportDescriptor()
 uno::Sequence beans::PropertyValue  xImportDescr = 
xDBRange-getImportDescriptor();
 }
 
+void XDatabaseRange::testRefresh()
+{
+uno::Reference sheet::XDatabaseRange  xDBRange( 
init(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(Refresh))), UNO_QUERY_THROW);
+
+const sal_Int32 nCol = 0;
+rtl::OUString aHidden(RTL_CONSTASCII_USTRINGPARAM(IsVisible));
+uno::Reference sheet::XCellRangeReferrer  xCellRangeReferrer(xDBRange, 
UNO_QUERY_THROW);
+uno::Reference table::XCellRange  xCellRange = 
xCellRangeReferrer-getReferredCells();
+
+for (sal_Int32 i = 1; i  5; ++i)
+{
+uno::Reference table::XCell  xCell = 
xCellRange-getCellByPosition(nCol, i);
+xCell-setValue(0);
+}
+
+for (sal_Int32 i = 2; i  5; ++i)
+{
+uno::Reference table::XColumnRowRange  xColRowRange(xCellRange, 
UNO_QUERY_THROW);
+uno::Reference table::XTableRows  xRows = xColRowRange-getRows();
+uno::Reference table::XCellRange  xRow(xRows-getByIndex(i), 
UNO_QUERY_THROW);
+uno::Reference beans::XPropertySet  xPropRow(xRow, UNO_QUERY_THROW);
+Any aAny = xPropRow-getPropertyValue( aHidden );
+
+CPPUNIT_ASSERT( aAny.getsal_Bool() == true);
+}
+
+xDBRange-refresh();
+std::cout  after refresh  std::endl;
+
+for (sal_Int32 i = 1; i  5; ++i)
+{
+uno::Reference table::XColumnRowRange  xColRowRange(xCellRange, 
UNO_QUERY_THROW);
+uno::Reference table::XTableRows  xRows = xColRowRange-getRows();
+uno::Reference table::XCellRange  xRow(xRows-getByIndex(i), 
UNO_QUERY_THROW);
+uno::Reference beans::XPropertySet  xPropRow(xRow, UNO_QUERY_THROW);
+Any aAny = xPropRow-getPropertyValue( aHidden );
+
+CPPUNIT_ASSERT( aAny.getsal_Bool() == false);
+}
+
+
+}
+
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit e521ac1a7304dead6557b15ecc24ee60be93cc48
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Feb 19 15:02:27 2012 +0100

this test uses ScNamedRangeObj.ods too

TODO: remove the explicit test file dependency from the interface test
code
don't use one of the test files

[Libreoffice-commits] .: 3 commits - sc/source svtools/inc svtools/source unusedcode.easy

2012-02-19 Thread Markus Mohrhard
::__debug::vectorXclFormatRun, 
std::allocatorXclFormatRun  const)
-XclRoot::GetDatabaseRanges() const
-XclRoot::GetPixelXFromHmm(int) const
-XclRoot::GetPixelYFromHmm(int) const
 XclTokenArray::XclTokenArray(std::__debug::vectorunsigned char, 
std::allocatorunsigned char , bool)
 XclTokenArrayIterator::Init()
 XclXFBase::HasUsedFlags() const
commit 1c9f0a6ddb48f7b6d62670901e117b25a0e59713
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Feb 20 06:31:12 2012 +0100

move SvListView from Table to ptr_map, related fdo#45679

diff --git a/svtools/inc/svtools/treelist.hxx b/svtools/inc/svtools/treelist.hxx
index 9db33bb..b2a7173 100644
--- a/svtools/inc/svtools/treelist.hxx
+++ b/svtools/inc/svtools/treelist.hxx
@@ -32,6 +32,7 @@
 #include svtools/svtdllapi.h
 #include tools/solar.h
 #include vector
+#include boost/ptr_container/ptr_map.hpp
 
 #include tools/table.hxx
 #include tools/link.hxx
@@ -280,7 +281,7 @@ class SVT_DLLPUBLIC SvTreeList
 sal_BoolIsEntryVisible( const SvListView*,SvListEntry* pEntry 
) const;
 SvListEntry*GetEntryAtVisPos( const SvListView*,sal_uLong nVisPos 
) const;
 sal_uLong   GetVisiblePos( const SvListView*,SvListEntry* pEntry ) 
const;
-sal_uLong   GetVisibleCount( const SvListView* ) const;
+sal_uLong   GetVisibleCount( SvListView* ) const;
 sal_uLong   GetVisibleChildCount( const SvListView*,SvListEntry* 
pParent ) const;
 
 SvListEntry*FirstSelected( const SvListView*) const;
@@ -421,6 +422,8 @@ class SVT_DLLPUBLIC SvListView
 {
 friend class SvTreeList;
 
+typedef boost::ptr_mapSvListEntry*, SvViewData SvDataTable;
+
 sal_uLong   nVisibleCount;
 sal_uLong   nSelectionCount;
 sal_BoolbVisPositionsValid;
@@ -430,7 +433,7 @@ class SVT_DLLPUBLIC SvListView
 SVT_DLLPRIVATE void RemoveViewData( SvListEntry* pParent );
 
 protected:
-Table   aDataTable;  // Mapping SvListEntry - ViewData
+SvDataTable maDataTable;  // Mapping SvListEntry - ViewData
 SvTreeList* pModel;
 
 voidActionMoving( SvListEntry* pEntry,SvListEntry* 
pTargetPrnt,sal_uLong nChildPos);
@@ -527,10 +530,11 @@ public:
 sal_BoolIsExpanded( SvListEntry* pEntry ) const;
 sal_BoolIsSelected( SvListEntry* pEntry ) const;
 sal_BoolHasEntryFocus( SvListEntry* pEntry ) const;
-voidSetEntryFocus( SvListEntry* pEntry, sal_Bool bFocus ) 
const;
-SvViewData* GetViewData( SvListEntry* pEntry ) const;
+voidSetEntryFocus( SvListEntry* pEntry, sal_Bool bFocus );
+const SvViewData* GetViewData( SvListEntry* pEntry ) const;
+SvViewData* GetViewData( SvListEntry* pEntry );
 sal_BoolHasViewData() const
-{ return aDataTable.Count()  1; }  // eine ROOT gibts immer
+{ return maDataTable.size()  1; }  // eine ROOT gibts immer
 
 virtual SvViewData* CreateViewData( SvListEntry* pEntry );
 virtual voidInitViewData( SvViewData*, SvListEntry* pEntry );
@@ -552,43 +556,54 @@ public:
 inline sal_Bool SvListView::IsExpanded( SvListEntry* pEntry ) const
 {
 DBG_ASSERT(pEntry,IsExpanded:No Entry);
-SvViewData* pData = (SvViewData*)aDataTable.Get( (sal_uLong)pEntry );
-DBG_ASSERT(pData,Entry not in Table);
-return pData-IsExpanded();
+SvDataTable::const_iterator itr = maDataTable.find(pEntry);
+DBG_ASSERT(itr != maDataTable.end(),Entry not in Table);
+return itr-second-IsExpanded();
 }
 
 inline sal_Bool SvListView::IsSelected( SvListEntry* pEntry ) const
 {
 DBG_ASSERT(pEntry,IsExpanded:No Entry);
-SvViewData* pData = (SvViewData*)aDataTable.Get( (sal_uLong)pEntry );
-DBG_ASSERT(pData,Entry not in Table);
-return pData-IsSelected();
+SvDataTable::const_iterator itr = maDataTable.find(pEntry );
+DBG_ASSERT(itr != maDataTable.end(),Entry not in Table);
+return itr-second-IsSelected();
 }
 
 inline sal_Bool SvListView::HasEntryFocus( SvListEntry* pEntry ) const
 {
 DBG_ASSERT(pEntry,IsExpanded:No Entry);
-SvViewData* pData = (SvViewData*)aDataTable.Get( (sal_uLong)pEntry );
-DBG_ASSERT(pData,Entry not in Table);
-return pData-HasFocus();
+SvDataTable::const_iterator itr = maDataTable.find(pEntry );
+DBG_ASSERT(itr != maDataTable.end(),Entry not in Table);
+return itr-second-HasFocus();
 }
 
-inline void SvListView::SetEntryFocus( SvListEntry* pEntry, sal_Bool bFocus ) 
const
+inline void SvListView::SetEntryFocus( SvListEntry* pEntry, sal_Bool bFocus )
 {
 DBG_ASSERT(pEntry,SetEntryFocus:No Entry);
-SvViewData* pData = (SvViewData*)aDataTable.Get( (sal_uLong)pEntry );
-DBG_ASSERT(pData,Entry not in Table);
-pData-SetFocus(bFocus);
+SvDataTable::iterator itr = maDataTable.find(pEntry);
+DBG_ASSERT(itr != maDataTable.end(),Entry not in Table);
+itr-second-SetFocus(bFocus

[Libreoffice-commits] .: 7 commits - sc/qa test/inc test/Library_subsequenttest.mk test/Package_inc.mk test/source

2012-02-18 Thread Markus Mohrhard
 dev/null   |binary
 sc/qa/extras/scdatapilottableobj.cxx   |   13 ++
 sc/qa/extras/scnamedrangeobj.cxx   |   48 ---
 sc/qa/extras/scnamedrangesobj.cxx  |2 
 sc/qa/extras/testdocuments/ScNamedRangeObj.ods |binary
 sc/qa/unoapi/knownissues.xcl   |4 
 test/Library_subsequenttest.mk |1 
 test/Package_inc.mk|1 
 test/inc/test/sheet/xcellrangereferrer.hxx |   52 +++
 test/inc/test/sheet/xdatapilottable2.hxx   |7 +
 test/source/sheet/xcellrangereferrer.cxx   |   56 
 test/source/sheet/xdatapilottable2.cxx |  109 +++--
 12 files changed, 271 insertions(+), 22 deletions(-)

New commits:
commit 4681bacef161d3a44e01b928035d9f30717527ae
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sat Feb 18 23:36:07 2012 +0100

adapt ScDataPilotTableObj test to XDataPilotTable2 changes

diff --git a/sc/qa/extras/scdatapilottableobj.cxx 
b/sc/qa/extras/scdatapilottableobj.cxx
index 6fedec0..18a26d0 100644
--- a/sc/qa/extras/scdatapilottableobj.cxx
+++ b/sc/qa/extras/scdatapilottableobj.cxx
@@ -40,7 +40,7 @@
 
 namespace sc_apitest {
 
-#define NUMBER_OF_TESTS 13
+#define NUMBER_OF_TESTS 16
 
 class ScDataPilotTableObj : public UnoApiTest, apitest::XDataPilotDescriptor, 
apitest::XDataPilotTable,
 apitest::XNamed, apitest::XDataPilotTable2
@@ -52,6 +52,7 @@ public:
 virtual void tearDown();
 virtual uno::Reference uno::XInterface  init();
 virtual uno::Reference uno::XInterface  initDP2();
+virtual uno::Reference uno::XInterface  getSheets();
 
 CPPUNIT_TEST_SUITE(ScDataPilotTableObj);
 CPPUNIT_TEST(testRefresh);
@@ -68,6 +69,9 @@ public:
 CPPUNIT_TEST(testGetName);
 CPPUNIT_TEST(testSetName);
 CPPUNIT_TEST(testGetDrillDownData);
+CPPUNIT_TEST(testInsertDrillDownSheet);
+CPPUNIT_TEST(testGetPositionData);
+CPPUNIT_TEST(testGetOutputRangeByType);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -114,6 +118,13 @@ uno::Reference uno::XInterface  
ScDataPilotTableObj::init()
 return xDPTable;
 }
 
+uno::Reference uno::XInterface  ScDataPilotTableObj::getSheets()
+{
+uno::Reference sheet::XSpreadsheetDocument  xDoc(mxComponent, 
UNO_QUERY_THROW);
+uno::Reference uno::XInterface  xSheets = xDoc-getSheets();
+return xSheets;
+}
+
 uno::Reference uno::XInterface  ScDataPilotTableObj::initDP2()
 {
 rtl::OUString aFileURL;
commit 7e14aa7af070418f5694277eb1614f6f12c60d74
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sat Feb 18 18:26:04 2012 +0100

complete the XDataPilotTable2 tests

diff --git a/test/inc/test/sheet/xdatapilottable2.hxx 
b/test/inc/test/sheet/xdatapilottable2.hxx
index e81de86..7b82bf8 100644
--- a/test/inc/test/sheet/xdatapilottable2.hxx
+++ b/test/inc/test/sheet/xdatapilottable2.hxx
@@ -30,6 +30,8 @@
 #include com/sun/star/table/CellRangeAddress.hpp
 #include com/sun/star/table/CellAddress.hpp
 #include com/sun/star/sheet/XDataPilotTable2.hpp
+#include com/sun/star/sheet/XSpreadsheet.hpp
+#include com/sun/star/uno/Sequence.h
 
 #include test/testdllapi.hxx
 
@@ -47,13 +49,16 @@ public:
 void testGetPositionData();
 void testGetDrillDownData();
 void testGetOutputRangeByType();
-void testInsertDrillData();
+void testInsertDrillDownSheet();
 
 virtual uno::Reference uno::XInterface  initDP2() = 0;
+virtual uno::Reference uno::XInterface  getSheets() = 0;
 
 protected:
 
 private:
+bool checkDrillDownSheetContent(uno::Reference sheet::XSpreadsheet , 
uno::Sequence uno::Sequence  uno::Any   aData);
+
 void getOutputRanges(uno::Reference sheet::XDataPilotTable2 );
 void buildDataFields(uno::Reference sheet::XDataPilotTable2 );
 void buildResultCells(uno::Reference sheet::XDataPilotTable2 );
diff --git a/test/source/sheet/xdatapilottable2.cxx 
b/test/source/sheet/xdatapilottable2.cxx
index 2aa34b8..0d93f3a 100644
--- a/test/source/sheet/xdatapilottable2.cxx
+++ b/test/source/sheet/xdatapilottable2.cxx
@@ -34,6 +34,10 @@
 #include com/sun/star/sheet/DataPilotFieldOrientation.hpp
 #include com/sun/star/sheet/DataPilotTablePositionType.hpp
 #include com/sun/star/sheet/DataPilotOutputRangeType.hpp
+#include com/sun/star/sheet/XSpreadsheets.hpp
+#include com/sun/star/sheet/XCellAddressable.hpp
+#include com/sun/star/table/XCellCursor.hpp
+#include com/sun/star/sheet/XCellRangeData.hpp
 #include com/sun/star/sheet/DataResult.hpp
 #include com/sun/star/beans/XPropertySet.hpp
 #include cppunit/extensions/HelperMacros.h
@@ -45,6 +49,24 @@ namespace apitest {
 void XDataPilotTable2::testGetPositionData()
 {
 uno::Reference sheet::XDataPilotTable2  xDPTable(initDP2(), 
UNO_QUERY_THROW);
+getOutputRanges(xDPTable);
+table::CellAddress aAddr;
+
+aAddr.Sheet = maRangeTable.Sheet;
+for (sal_Int32 x = maRangeTable.StartColumn; x

[Libreoffice-commits] .: test/source

2012-02-18 Thread Markus Mohrhard
 test/source/sheet/xdatapilottable2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cdf0c78990a149a5deab8f9e68512a8646ca1855
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Feb 19 01:07:56 2012 +0100

fix copypaste error

diff --git a/test/source/sheet/xdatapilottable2.cxx 
b/test/source/sheet/xdatapilottable2.cxx
index 0d93f3a..de1bb97 100644
--- a/test/source/sheet/xdatapilottable2.cxx
+++ b/test/source/sheet/xdatapilottable2.cxx
@@ -275,7 +275,7 @@ bool 
XDataPilotTable2::checkDrillDownSheetContent(uno::Reference sheet::XSpread
 CPPUNIT_ASSERT_EQUAL(aData[0].getLength(), aLastCell.Column + 1);
 
 uno::Reference table::XCellRange  xCellRange = 
xSheet-getCellRangeByPosition(0, 0, aLastCell.Column, aLastCell.Row);
-uno::Reference sheet::XCellRangeData  xCellRangeData(xCellRangeData, 
UNO_QUERY_THROW);
+uno::Reference sheet::XCellRangeData  xCellRangeData(xCellRange, 
UNO_QUERY_THROW);
 
 uno::Sequence uno::Sequence Any   aSheetData = 
xCellRangeData-getDataArray();
 for (sal_Int32 x = 0; x  aSheetData.getLength(); ++x)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/qa

2012-02-16 Thread Markus Mohrhard
 sc/qa/extras/testdocuments/ScDatabaseRangeObj.ods |binary
 1 file changed

New commits:
commit c25c5a05ac6a0d678aa3d9592d213a08cabf6f7b
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Feb 16 11:59:21 2012 +0100

add missing file

diff --git a/sc/qa/extras/testdocuments/ScDatabaseRangeObj.ods 
b/sc/qa/extras/testdocuments/ScDatabaseRangeObj.ods
new file mode 100644
index 000..0561655
Binary files /dev/null and b/sc/qa/extras/testdocuments/ScDatabaseRangeObj.ods 
differ
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - sc/qa test/inc test/Library_subsequenttest.mk test/Package_inc.mk test/source

2012-02-16 Thread Markus Mohrhard
 sc/qa/extras/sccellrangeobj.cxx |   28 +++
 sc/qa/extras/testdocuments/xcellrangesquery.ods |binary
 test/Library_subsequenttest.mk  |1 
 test/Package_inc.mk |1 
 test/inc/test/sheet/xcellrangedata.hxx  |   48 
 test/source/sheet/xcellrangedata.cxx|   89 
 6 files changed, 165 insertions(+), 2 deletions(-)

New commits:
commit 7b91c6d1c0686b06de4d2e87b02df10aa9afbf4c
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Feb 17 01:59:32 2012 +0100

add test for ScCellRangeObj::setDataArray and getDataArray

diff --git a/sc/qa/extras/sccellrangeobj.cxx b/sc/qa/extras/sccellrangeobj.cxx
index 050724d..2152a2d 100644
--- a/sc/qa/extras/sccellrangeobj.cxx
+++ b/sc/qa/extras/sccellrangeobj.cxx
@@ -31,6 +31,7 @@
 #include test/sheet/cellproperties.hxx
 #include test/util/xreplaceable.hxx
 #include test/util/xsearchable.hxx
+#include test/sheet/xcellrangedata.hxx
 
 #include com/sun/star/sheet/XSpreadsheetDocument.hpp
 #include com/sun/star/sheet/XSpreadsheet.hpp
@@ -38,10 +39,10 @@
 
 namespace sc_apitest {
 
-#define NUMBER_OF_TESTS 12
+#define NUMBER_OF_TESTS 14
 
 class ScCellRangeObj : public UnoApiTest, apitest::XCellRangesQuery, 
apitest::CellProperties,
-apitest::XSearchable, apitest::XReplaceable
+apitest::XSearchable, apitest::XReplaceable, 
apitest::XCellRangeData
 {
 public:
 ScCellRangeObj();
@@ -49,6 +50,7 @@ public:
 virtual void setUp();
 virtual void tearDown();
 virtual uno::Reference uno::XInterface  init();
+virtual uno::Reference uno::XInterface  getXCellRangeData();
 
 CPPUNIT_TEST_SUITE(ScCellRangeObj);
 CPPUNIT_TEST(testQueryColumnDifference);
@@ -64,6 +66,8 @@ public:
 CPPUNIT_TEST(testFindFirst);
 CPPUNIT_TEST(testReplaceAll);
 CPPUNIT_TEST(testCreateReplaceDescriptor);
+CPPUNIT_TEST(testGetDataArray);
+CPPUNIT_TEST(testSetDataArray);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -101,6 +105,26 @@ uno::Reference uno::XInterface  ScCellRangeObj::init()
 return xReturn;
 }
 
+uno::Reference uno::XInterface  ScCellRangeObj::getXCellRangeData()
+{
+rtl::OUString aFileURL;
+const rtl::OUString 
aFileBase(RTL_CONSTASCII_USTRINGPARAM(xcellrangesquery.ods));
+createFileURL(aFileBase, aFileURL);
+std::cout  rtl::OUStringToOString(aFileURL, 
RTL_TEXTENCODING_UTF8).getStr()  std::endl;
+if( !mxComponent.is())
+mxComponent = loadFromDesktop(aFileURL);
+uno::Reference sheet::XSpreadsheetDocument xDoc (mxComponent, 
UNO_QUERY_THROW);
+uno::Reference container::XIndexAccess  xIndex (xDoc-getSheets(), 
UNO_QUERY_THROW);
+uno::Reference sheet::XSpreadsheet  xSheet( xIndex-getByIndex(1), 
UNO_QUERY_THROW);
+
+CPPUNIT_ASSERT_MESSAGE(Could not create interface of type XSpreadsheet, 
xSheet.is());
+
+uno::Referencetable::XCellRange 
xReturn(xSheet-getCellRangeByPosition(0,0,3,3), UNO_QUERY_THROW);
+
+CPPUNIT_ASSERT_MESSAGE(Could not create object of type XCellRangesQuery, 
xReturn.is());
+return xReturn;
+}
+
 void ScCellRangeObj::setUp()
 {
 nTest++;
diff --git a/sc/qa/extras/testdocuments/xcellrangesquery.ods 
b/sc/qa/extras/testdocuments/xcellrangesquery.ods
index 562229c..ec7335f 100644
Binary files a/sc/qa/extras/testdocuments/xcellrangesquery.ods and 
b/sc/qa/extras/testdocuments/xcellrangesquery.ods differ
commit 4e1e72dc346e732ff5693e5428e39710ca3b78a5
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Feb 17 01:41:04 2012 +0100

add test code for XCellRangeData

diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 6c1556f..53cc8e4 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -69,6 +69,7 @@ $(eval $(call 
gb_Library_add_exception_objects,subsequenttest,\
 test/source/container/xnamed \
 test/source/sheet/cellproperties \
 test/source/sheet/datapilotfield \
+test/source/sheet/xcellrangedata \
 test/source/sheet/xcellrangesquery \
 test/source/sheet/xdatabaserange \
 test/source/sheet/xdatapilotdescriptor \
diff --git a/test/Package_inc.mk b/test/Package_inc.mk
index 55a50af..768c6a8 100644
--- a/test/Package_inc.mk
+++ b/test/Package_inc.mk
@@ -40,6 +40,7 @@ $(eval $(call 
gb_Package_add_file,test_inc,inc/test/container/xindexaccess.hxx,t
 $(eval $(call 
gb_Package_add_file,test_inc,inc/test/container/xnamecontainer.hxx,test/container/xnamecontainer.hxx))
 $(eval $(call 
gb_Package_add_file,test_inc,inc/test/container/xnamereplace.hxx,test/container/xnamereplace.hxx))
 $(eval $(call 
gb_Package_add_file,test_inc,inc/test/sheet/cellproperties.hxx,test/sheet/cellproperties.hxx))
+$(eval $(call 
gb_Package_add_file,test_inc,inc/test/sheet/xcellrangedata.hxx,test/sheet/xcellrangedata.hxx))
 $(eval $(call 
gb_Package_add_file,test_inc,inc/test/sheet/xdatapilottable.hxx,test/sheet

[Libreoffice-commits] .: 4 commits - dbaccess/Module_dbaccess.mk sc/Module_sc.mk sc/qa test/inc test/source

2012-02-15 Thread Markus Mohrhard
 dbaccess/Module_dbaccess.mk|6 +-
 sc/Module_sc.mk|1 +
 sc/qa/extras/scdatabaserangeobj.cxx|6 --
 sc/qa/unit/filters-test.cxx|2 +-
 test/inc/test/sheet/xdatabaserange.hxx |2 ++
 test/source/sheet/xdatabaserange.cxx   |   13 +
 6 files changed, 26 insertions(+), 4 deletions(-)

New commits:
commit a5661d717197a6723b80fb65cde463c479983934
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Feb 16 00:52:44 2012 +0100

add two more test cases to XDatabaseRange

diff --git a/sc/qa/extras/scdatabaserangeobj.cxx 
b/sc/qa/extras/scdatabaserangeobj.cxx
index 93eb261..e9f09c6 100644
--- a/sc/qa/extras/scdatabaserangeobj.cxx
+++ b/sc/qa/extras/scdatabaserangeobj.cxx
@@ -37,7 +37,7 @@
 
 namespace sc_apitest {
 
-#define NUMBER_OF_TESTS 3
+#define NUMBER_OF_TESTS 5
 
 class ScDatabaseRangeObj : public UnoApiTest, apitest::XDatabaseRange
 {
@@ -51,6 +51,8 @@ public:
 CPPUNIT_TEST(testDataArea);
 CPPUNIT_TEST(testGetSortDescriptor);
 CPPUNIT_TEST(testGetSubtotalDescriptor);
+CPPUNIT_TEST(testGetImportDescriptor);
+CPPUNIT_TEST(testGetFilterDescriptor);
 CPPUNIT_TEST_SUITE_END();
 private:
 static sal_Int32 nTest;
diff --git a/test/inc/test/sheet/xdatabaserange.hxx 
b/test/inc/test/sheet/xdatabaserange.hxx
index 6c5eac0..d388aa3 100644
--- a/test/inc/test/sheet/xdatabaserange.hxx
+++ b/test/inc/test/sheet/xdatabaserange.hxx
@@ -43,6 +43,8 @@ public:
 void testDataArea();
 void testGetSortDescriptor();
 void testGetSubtotalDescriptor();
+void testGetImportDescriptor();
+void testGetFilterDescriptor();
 };
 
 }
diff --git a/test/source/sheet/xdatabaserange.cxx 
b/test/source/sheet/xdatabaserange.cxx
index ef68e8e..51e3c32 100644
--- a/test/source/sheet/xdatabaserange.cxx
+++ b/test/source/sheet/xdatabaserange.cxx
@@ -140,6 +140,19 @@ void XDatabaseRange::testGetSortDescriptor()
 }
 }
 
+void XDatabaseRange::testGetFilterDescriptor()
+{
+uno::Reference sheet::XDatabaseRange  xDBRange( 
init(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(FilterDescriptor))), 
UNO_QUERY_THROW);
+uno::Reference uno::XInterface  xFilterDescr( 
xDBRange-getFilterDescriptor(), UNO_QUERY_THROW);
+CPPUNIT_ASSERT(xFilterDescr.is());
+}
+
+void XDatabaseRange::testGetImportDescriptor()
+{
+uno::Reference sheet::XDatabaseRange  xDBRange( 
init(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ImportDescriptor))), 
UNO_QUERY_THROW);
+uno::Sequence beans::PropertyValue  xImportDescr = 
xDBRange-getImportDescriptor();
+}
+
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 1263cafe8e487b5db0c439966056516be99bc1e4
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Thu Feb 16 00:18:03 2012 +0100

enable XDatabaseRangeTest again

diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index 074b1f1..a221f22 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -54,6 +54,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sc,\
 JunitTest_sc_complex \
 JunitTest_sc_unoapi \
 CppunitTest_sc_cellrangeobj \
+CppunitTest_sc_databaserangeobj \
 CppunitTest_sc_datapilottableobj \
 CppunitTest_sc_datapilotfieldobj \
 CppunitTest_sc_macros_test \
diff --git a/sc/qa/extras/scdatabaserangeobj.cxx 
b/sc/qa/extras/scdatabaserangeobj.cxx
index 69a3d48..93eb261 100644
--- a/sc/qa/extras/scdatabaserangeobj.cxx
+++ b/sc/qa/extras/scdatabaserangeobj.cxx
@@ -63,7 +63,7 @@ uno::Reference lang::XComponent  
ScDatabaseRangeObj::mxComponent;
 uno::Reference uno::XInterface  ScDatabaseRangeObj::init( const 
rtl::OUString rDBName )
 {
 rtl::OUString aFileURL;
-
createFileURL(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(xdatabaserange.ods)), 
aFileURL);
+
createFileURL(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ScDatabaseRangeObj.ods)),
 aFileURL);
 if(!mxComponent.is())
 mxComponent = loadFromDesktop(aFileURL);
 CPPUNIT_ASSERT(mxComponent.is());
commit a05286296b3ba51029f0ff57a5a9173d3623b864
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Feb 15 22:27:11 2012 +0100

dbaccess' macros_test is still failing in some situations

diff --git a/dbaccess/Module_dbaccess.mk b/dbaccess/Module_dbaccess.mk
index 11a7cf6..f087ba8 100644
--- a/dbaccess/Module_dbaccess.mk
+++ b/dbaccess/Module_dbaccess.mk
@@ -46,9 +46,13 @@ $(eval $(call gb_Module_add_targets,dbaccess,\
 ))
 
 $(eval $(call gb_Module_add_check_targets,dbaccess,\
-CppunitTest_dbaccess_macros_test \
 ))
 
+# disable test because it still fails in some situations
+#CppunitTest_dbaccess_macros_test \
+#
+
+
 $(eval $(call gb_Module_add_subsequentcheck_targets,dbaccess,\
JunitTest_dbaccess_complex \
 JunitTest_dbaccess_unoapi \
commit 2bedc40e55fd7b51f948f60ba1d757d2912d3afb
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Feb 15 22:24:58 2012 +0100

this should test ods and not xls

diff --git a/sc/qa/unit/filters-test.cxx b

[Libreoffice-commits] .: 2 commits - sc/source sw/CppunitTest_sw_layout_test.mk sw/qa

2012-02-14 Thread Markus Mohrhard
 sc/source/ui/namedlg/namedlg.cxx |6 -
 sw/CppunitTest_sw_layout_test.mk |  139 +++
 sw/qa/core/data/odt/test.odt |binary
 sw/qa/core/layout-test.cxx   |  127 +++
 4 files changed, 266 insertions(+), 6 deletions(-)

New commits:
commit 156bd43bd96379d86535afa38ce4d4f8044f45a6
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Feb 14 16:34:47 2012 +0100

add a test case that allows testing of sw's Layout code

diff --git a/sw/CppunitTest_sw_layout_test.mk b/sw/CppunitTest_sw_layout_test.mk
new file mode 100644
index 000..a14af32
--- /dev/null
+++ b/sw/CppunitTest_sw_layout_test.mk
@@ -0,0 +1,139 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the License); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an AS IS basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# Major Contributor(s):
+# Copyright (C) 2011 Red Hat, Inc., Caolán McNamara caol...@redhat.com
+#  (initial developer)
+#
+# All Rights Reserved.
+#
+# For minor contributions see the git repository.
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the GPLv3+), or
+# the GNU Lesser General Public License Version 3 or later (the LGPLv3+),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
+#*
+
+$(eval $(call gb_CppunitTest_CppunitTest,sw_layout_test))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,sw_layout_test, \
+sw/qa/core/layout-test \
+))
+
+$(eval $(call gb_CppunitTest_add_linked_libs,sw_layout_test, \
+avmedia \
+basegfx \
+comphelper \
+cppu \
+cppuhelper \
+drawinglayer \
+editeng \
+fileacc \
+for \
+forui \
+i18nisolang1 \
+msfilter \
+oox \
+sal \
+salhelper \
+sax \
+sw \
+sfx \
+sot \
+svl \
+svt \
+svx \
+svxcore \
+   test \
+tl \
+tk \
+ucbhelper \
+   unotest \
+utl \
+vbahelper \
+vcl \
+xo \
+   $(gb_STDLIBS) \
+))
+
+$(eval $(call gb_CppunitTest_set_include,sw_layout_test,\
+-I$(realpath $(SRCDIR)/sw/source/ui/inc) \
+-I$(realpath $(SRCDIR)/sw/inc) \
+$$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_add_api,sw_layout_test,\
+offapi \
+oovbaapi \
+udkapi \
+))
+
+$(eval $(call gb_CppunitTest_uses_ure,sw_layout_test))
+
+$(eval $(call gb_CppunitTest_add_type_rdbs,sw_layout_test,\
+oovbaapi \
+types \
+))
+
+$(eval $(call gb_CppunitTest_add_components,sw_layout_test,\
+comphelper/util/comphelp \
+configmgr/source/configmgr \
+dbaccess/util/dba \
+fileaccess/source/fileacc \
+filter/source/config/cache/filterconfig1 \
+forms/util/frm \
+framework/util/fwk \
+i18npool/util/i18npool \
+oox/util/oox \
+package/source/xstor/xstor \
+package/util/package2 \
+sax/source/expatwrap/expwrap \
+sax/source/fastparser/fastsax \
+sw/util/sw \
+sw/util/swd \
+sw/util/msword \
+sw/util/vbaswobj \
+scripting/source/basprov/basprov \
+scripting/util/scriptframe \
+sfx2/util/sfx \
+sot/util/sot \
+svl/source/fsstor/fsstorage \
+toolkit/util/tk \
+ucb/source/core/ucb1 \
+ucb/source/ucp/file/ucpfile1 \
+ucb/source/ucp/tdoc/ucptdoc1 \
+unotools/util/utl \
+unoxml/source/rdf/unordf \
+unoxml/source/service/unoxml \
+))
+
+$(eval $(call gb_CppunitTest_set_args,sw_layout_test,\
+--headless \
+--protector unoexceptionprotector$(gb_Library_DLLEXT) 
unoexceptionprotector \
+-env:CONFIGURATION_LAYERS=xcsxcu:$(call 
gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry) module:$(call 
gb_CppunitTarget__make_url,$(OUTDIR)/xml/registry/spool) xcsxcu:$(call 
gb_CppunitTarget__make_url,$(OUTDIR)/unittest/registry) \
+))
+# .../spool is required for the (somewhat strange) filter configuration
+
+# we need to
+# a) explicitly depend on library msword because it is not implied by a link
+#relation
+# b) explicitly depend on the sw resource files needed at unit-test runtime
+$(call gb_CppunitTest_get_target,sw_layout_test) : \
+$(call gb_Library_get_target,localedata_en) \
+$(call gb_Library_get_target,msword) \
+$(call gb_Library_get_target,vbaswobj) \
+
+# vim: set noet sw=4 ts=4:
diff --git a/sw/qa/core/data

[Libreoffice-commits] .: 2 commits - dbaccess/CppunitTest_dbaccess_macros_test.mk dbaccess/Module_dbaccess.mk dbaccess/qa

2012-02-12 Thread Markus Mohrhard
 dbaccess/CppunitTest_dbaccess_macros_test.mk |1 +
 dbaccess/Module_dbaccess.mk  |4 
 dbaccess/qa/extras/macros-test.cxx   |2 ++
 3 files changed, 7 insertions(+)

New commits:
commit 699eae5bd35fe0dc9dd98a9a2b74f37c0ef55d9c
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Feb 12 20:14:07 2012 +0100

disable new test on win and mac since it is a test with UI

diff --git a/dbaccess/qa/extras/macros-test.cxx 
b/dbaccess/qa/extras/macros-test.cxx
index 786202b..4be3e65 100644
--- a/dbaccess/qa/extras/macros-test.cxx
+++ b/dbaccess/qa/extras/macros-test.cxx
@@ -59,7 +59,9 @@ public:
 void test();
 
 CPPUNIT_TEST_SUITE(DBAccessTest);
+#if !defined(MACOSX)  !defined(WNT)
 CPPUNIT_TEST(test);
+#endif
 CPPUNIT_TEST_SUITE_END();
 
 private:
commit b97bdba24e11becc12b9731605727e1e1166a34c
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Feb 12 19:34:23 2012 +0100

finish initial work on the Base test

Base needs the numberformatter to initialize a document

diff --git a/dbaccess/CppunitTest_dbaccess_macros_test.mk 
b/dbaccess/CppunitTest_dbaccess_macros_test.mk
index 028be5e..862fcf7 100644
--- a/dbaccess/CppunitTest_dbaccess_macros_test.mk
+++ b/dbaccess/CppunitTest_dbaccess_macros_test.mk
@@ -113,6 +113,7 @@ $(eval $(call 
gb_CppunitTest_add_components,dbaccess_macros_test,\
 sfx2/util/sfx \
 sot/util/sot \
 svl/source/fsstor/fsstorage \
+svl/util/svl \
 toolkit/util/tk \
 ucb/source/core/ucb1 \
 ucb/source/ucp/file/ucpfile1 \
diff --git a/dbaccess/Module_dbaccess.mk b/dbaccess/Module_dbaccess.mk
index 88760ae..11a7cf6 100644
--- a/dbaccess/Module_dbaccess.mk
+++ b/dbaccess/Module_dbaccess.mk
@@ -45,6 +45,10 @@ $(eval $(call gb_Module_add_targets,dbaccess,\
 Package_uiconfig \
 ))
 
+$(eval $(call gb_Module_add_check_targets,dbaccess,\
+CppunitTest_dbaccess_macros_test \
+))
+
 $(eval $(call gb_Module_add_subsequentcheck_targets,dbaccess,\
JunitTest_dbaccess_complex \
 JunitTest_dbaccess_unoapi \
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: dbaccess/qa sc/qa test/source

2012-02-11 Thread Markus Mohrhard
 dbaccess/qa/extras/macros-test.cxx   |2 +-
 sc/qa/extras/macros-test.cxx |4 ++--
 test/source/sheet/xnamedranges.cxx   |2 +-
 test/source/sheet/xspreadsheets2.cxx |   20 ++--
 4 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit 75b4d17f961ceec179e98fe07652e4ce719c16cb
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Feb 12 02:47:37 2012 +0100

use better assertion macros

diff --git a/dbaccess/qa/extras/macros-test.cxx 
b/dbaccess/qa/extras/macros-test.cxx
index 9443e9e..786202b 100644
--- a/dbaccess/qa/extras/macros-test.cxx
+++ b/dbaccess/qa/extras/macros-test.cxx
@@ -99,7 +99,7 @@ void DBAccessTest::setUp()
 // which is a private symbol to us, gets called
 mxDesktop = Referencecom::sun::star::frame::XDesktop( 
getMultiServiceFactory()-createInstance(
 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
com.sun.star.frame.Desktop ))), UNO_QUERY );
-CPPUNIT_ASSERT_MESSAGE(, mxDesktop.is());
+CPPUNIT_ASSERT(mxDesktop.is());
 }
 
 void DBAccessTest::tearDown()
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index 5e908d9..cfba258 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -141,7 +141,7 @@ void ScMacrosTest::testStarBasic()
 double aValue;
 pDoc-GetValue(0,0,0,aValue);
 std::cout  returned value =   aValue  std::endl;
-CPPUNIT_ASSERT_MESSAGE(script did not change the value of 
Sheet1.A1,aValue==2);
+CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(script did not change the value of 
Sheet1.A1,2.0, aValue, 0.1);
 xDocSh-DoClose();
 }
 
@@ -207,7 +207,7 @@ void ScMacrosTest::setUp()
 CPPUNIT_ASSERT_MESSAGE(no calc component!, m_xCalcComponent.is());
 mxDesktop = Referencecom::sun::star::frame::XDesktop( 
getMultiServiceFactory()-createInstance(
 rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
com.sun.star.frame.Desktop ))), UNO_QUERY );
-CPPUNIT_ASSERT_MESSAGE(, mxDesktop.is());
+CPPUNIT_ASSERT(mxDesktop.is());
 }
 
 void ScMacrosTest::tearDown()
diff --git a/test/source/sheet/xnamedranges.cxx 
b/test/source/sheet/xnamedranges.cxx
index 9f5b3aa..b5c9a46 100644
--- a/test/source/sheet/xnamedranges.cxx
+++ b/test/source/sheet/xnamedranges.cxx
@@ -180,7 +180,7 @@ void XNamedRanges::testRemoveByName()
 sal_Int32 nInitialCount = xIndex-getCount();
 xNamedRanges-removeByName(maNameToRemove);
 sal_Int32 nNewCount = xIndex-getCount();
-CPPUNIT_ASSERT_MESSAGE(NamedRange initial1 not removed, nNewCount == 
nInitialCount - 1);
+CPPUNIT_ASSERT_EQUAL_MESSAGE(NamedRange initial1 not removed, 
nNewCount, nInitialCount - 1);
 CPPUNIT_ASSERT_MESSAGE(Wrong NamedRange removed, initial1 still 
present, !xNamedRanges-hasByName(maNameToRemove));
 // try to remove non existing
 rtl::OUString 
aNr2(RTL_CONSTASCII_USTRINGPARAM(dummyNonExistingNamedRange));
diff --git a/test/source/sheet/xspreadsheets2.cxx 
b/test/source/sheet/xspreadsheets2.cxx
index 2634259..3d777c0 100644
--- a/test/source/sheet/xspreadsheets2.cxx
+++ b/test/source/sheet/xspreadsheets2.cxx
@@ -92,7 +92,7 @@ void XSpreadsheets2::testImportString()
 uno::Reference text::XTextRange  xDestTextRange(xDestCell, 
UNO_QUERY_THROW);
 rtl::OUString aDestString = xDestTextRange-getString();
 
-CPPUNIT_ASSERT_MESSAGE(Wrong string imported, 
aDestString.equals(aSrcString));
+CPPUNIT_ASSERT_EQUAL_MESSAGE(Wrong string imported, aDestString, 
aSrcString);
 }
 
 void XSpreadsheets2::testImportValue()
@@ -108,7 +108,7 @@ void XSpreadsheets2::testImportValue()
 uno::Reference table::XCell  xDestCell = 
xDestSheet-getCellByPosition(1,0);
 sal_Int32 aDestValue = xDestCell-getValue();
 
-CPPUNIT_ASSERT_MESSAGE(Wrong value imported, aSrcValue == aDestValue);
+CPPUNIT_ASSERT_EQUAL_MESSAGE(Wrong value imported, aSrcValue, 
aDestValue);
 }
 
 void XSpreadsheets2::testImportFormulaBasicMath()
@@ -126,7 +126,7 @@ void XSpreadsheets2::testImportFormulaBasicMath()
 
 // potential problem later: formulas might be adjusted
 // add some tests that the formulas are correctly adjusted
-CPPUNIT_ASSERT_MESSAGE(Wrong formula imported, 
aDestFormula.equals(aSrcFormula));
+CPPUNIT_ASSERT_EQUAL_MESSAGE(Wrong formula imported, aDestFormula, 
aSrcFormula);
 }
 
 void XSpreadsheets2::testImportFormulaWithNamedRange()
@@ -142,7 +142,7 @@ void XSpreadsheets2::testImportFormulaWithNamedRange()
 uno::Reference table::XCell  xDestCell = 
xDestSheet-getCellByPosition(3,0);
 rtl::OUString aDestFormula = xDestCell-getFormula();
 
-CPPUNIT_ASSERT_MESSAGE(Wrong Namedrange formula imported, 
aDestFormula.equals(aSrcFormula));
+CPPUNIT_ASSERT_EQUAL_MESSAGE(Wrong Namedrange formula imported, 
aDestFormula, aSrcFormula);
 }
 
 void XSpreadsheets2::testImportOverExistingNamedRange()
@@ -166,7 +166,7 @@ void XSpreadsheets2::testImportOverExistingNamedRange()
 rtl::OUString

[Libreoffice-commits] .: test/source

2012-02-11 Thread Markus Mohrhard
 test/source/sheet/xspreadsheets2.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 21b3a9a6beb2773668a7ac63c50a1fdc00e5cd4b
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Feb 12 08:01:03 2012 +0100

fix errors with assertion macros

diff --git a/test/source/sheet/xspreadsheets2.cxx 
b/test/source/sheet/xspreadsheets2.cxx
index 3d777c0..6fbf35b 100644
--- a/test/source/sheet/xspreadsheets2.cxx
+++ b/test/source/sheet/xspreadsheets2.cxx
@@ -283,7 +283,7 @@ void XSpreadsheets2::testImportCellStyle()
 sal_Int32 aVertJustify = 0;
 CPPUNIT_ASSERT(xCellStyleProp-getPropertyValue(aProperty) = 
aVertJustify);
 
-CPPUNIT_ASSERT_EQUAL_MESSAGE(New style: VertJustify not set, 
aVertJustify, table::CellVertJustify_CENTER);
+CPPUNIT_ASSERT_MESSAGE(New style: VertJustify not set, aVertJustify == 
table::CellVertJustify_CENTER);
 }
 
 uno::Reference sheet::XSpreadsheetDocument XSpreadsheets2::getDoc(const 
rtl::OUString aFileBase, uno::Reference lang::XComponent  xComp)
@@ -326,7 +326,7 @@ void XSpreadsheets2::importSheetToCopy()
 uno::Reference sheet::XSpreadsheets2  xDestSheets 
(xDestDoc-getSheets(), UNO_QUERY_THROW);
 sal_Int32 nDestPos = 0;
 sal_Int32 nDestPosEffective = xDestSheets-importSheet(xDocument, 
aSrcSheetName, nDestPos);
-CPPUNIT_ASSERT_EQUALS_MESSAGE(Wrong sheet index, nDestPosEffective, 
nDestPos);
+CPPUNIT_ASSERT_EQUAL_MESSAGE(Wrong sheet index, nDestPosEffective, 
nDestPos);
 }
 else
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: Branch 'libreoffice-3-4' - sc/source

2012-02-10 Thread Markus Mohrhard
 sc/source/core/tool/address.cxx  |4 +++-
 sc/source/core/tool/interpr1.cxx |2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 619e36de3fec38d172e33a5f14fdc322e6ad479f
Author: Eike Rathke er...@erack.de
Date:   Tue Aug 23 16:34:42 2011 +

fdo#36109 in INDIRECT() make a non-existing sheet produce an error again

* In lcl_ScAddress_Parse_OOo() don't assume non-existing sheets would be
  external documents if there was no sheet separator. This lead to an
  external reference being created that is only an error if
  dereferenced, not if fed to ISERROR() and the like.
* In ScInterpreter::ScIndirect() push errNoRef instead of
  errInvalidArgument to produce a #REF! error.

Signed-off-by: Markus Mohrhard markus.mohrh...@googlemail.com

diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 156043b..0c4e235 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -1013,12 +1013,14 @@ lcl_ScAddress_Parse_OOo( const sal_Unicode* p, 
ScDocument* pDoc, ScAddress rAdd
 if (!bExtDoc  (!pDoc || !pDoc-GetTable( aTab, nTab )))
 {
 // Specified table name is not found in this document.  Assume 
this is an external document.
-bExtDoc = true;
 aDocName = aTab;
 xub_StrLen n = aTab.SearchBackward('.');
 if (n != STRING_NOTFOUND  n  0)
+{
 // Extension found.  Strip it.
 aTab.Erase(n);
+bExtDoc = true;
+}
 else
 // No extension found.  This is probably not an external 
document.
 nBits = 0;
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index eb5ab56..f8b8dfb 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -6655,7 +6655,7 @@ void ScInterpreter::ScIndirect()
 }
 while (false);
 
-PushIllegalArgument();
+PushError( errNoRef);
 }
 }
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 3 commits - sc/qa solenv/gbuild test/inc test/Library_subsequenttest.mk test/Package_inc.mk test/source

2012-02-10 Thread Markus Mohrhard
 sc/qa/extras/scdatapilottableobj.cxx |   37 +
 solenv/gbuild/Module.mk  |2 
 test/Library_subsequenttest.mk   |1 
 test/Package_inc.mk  |1 
 test/inc/test/sheet/xdatapilottable2.hxx |   70 +++
 test/source/sheet/xdatapilottable2.cxx   |  195 +++
 6 files changed, 303 insertions(+), 3 deletions(-)

New commits:
commit 82e349fd80671f7dabe9dd7a22e4711696300082
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Feb 10 17:51:33 2012 +0100

add XDataPilotTable2 test to ScDatPilotTableObj

diff --git a/sc/qa/extras/scdatapilottableobj.cxx 
b/sc/qa/extras/scdatapilottableobj.cxx
index 0d1cf40..6fedec0 100644
--- a/sc/qa/extras/scdatapilottableobj.cxx
+++ b/sc/qa/extras/scdatapilottableobj.cxx
@@ -28,6 +28,7 @@
 
 #include test/unoapi_test.hxx
 #include test/sheet/xdatapilottable.hxx
+#include test/sheet/xdatapilottable2.hxx
 #include test/sheet/xdatapilotdescriptor.hxx
 #include test/container/xnamed.hxx
 
@@ -39,10 +40,10 @@
 
 namespace sc_apitest {
 
-#define NUMBER_OF_TESTS 12
+#define NUMBER_OF_TESTS 13
 
 class ScDataPilotTableObj : public UnoApiTest, apitest::XDataPilotDescriptor, 
apitest::XDataPilotTable,
-apitest::XNamed
+apitest::XNamed, apitest::XDataPilotTable2
 {
 public:
 ScDataPilotTableObj();
@@ -50,6 +51,7 @@ public:
 virtual void setUp();
 virtual void tearDown();
 virtual uno::Reference uno::XInterface  init();
+virtual uno::Reference uno::XInterface  initDP2();
 
 CPPUNIT_TEST_SUITE(ScDataPilotTableObj);
 CPPUNIT_TEST(testRefresh);
@@ -65,6 +67,7 @@ public:
 CPPUNIT_TEST(testGetDataFields);
 CPPUNIT_TEST(testGetName);
 CPPUNIT_TEST(testSetName);
+CPPUNIT_TEST(testGetDrillDownData);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -111,6 +114,36 @@ uno::Reference uno::XInterface  
ScDataPilotTableObj::init()
 return xDPTable;
 }
 
+uno::Reference uno::XInterface  ScDataPilotTableObj::initDP2()
+{
+rtl::OUString aFileURL;
+
createFileURL(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(ScDataPilotTableObj.ods)),
 aFileURL);
+if(!mxComponent.is())
+mxComponent = loadFromDesktop(aFileURL);
+CPPUNIT_ASSERT(mxComponent.is());
+
+uno::Reference sheet::XSpreadsheetDocument  xDoc(mxComponent, 
UNO_QUERY_THROW);
+uno::Reference container::XIndexAccess  xIndex (xDoc-getSheets(), 
UNO_QUERY_THROW);
+uno::Reference sheet::XSpreadsheet  xSheet( xIndex-getByIndex(0), 
UNO_QUERY_THROW);
+
+// set variables from xdatapilottable.[ch]xx
+xCellForChange = xSheet-getCellByPosition( 1, 5 );
+xCellForCheck = xSheet-getCellByPosition( 7, 11 );
+CPPUNIT_ASSERT(xCellForCheck.is());
+CPPUNIT_ASSERT(xCellForChange.is());
+
+CPPUNIT_ASSERT_MESSAGE(Could not create interface of type XSpreadsheet, 
xSheet.is());
+uno::Reference sheet::XDataPilotTablesSupplier  xDPTS(xSheet, 
UNO_QUERY_THROW);
+CPPUNIT_ASSERT(xDPTS.is());
+uno::Reference sheet::XDataPilotTables  xDPT = 
xDPTS-getDataPilotTables();
+CPPUNIT_ASSERT(xDPT.is());
+
+uno::Reference sheet::XDataPilotTable  
xDPTable(xDPT-getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DataPilotTable2))),UNO_QUERY_THROW);
+
+CPPUNIT_ASSERT(xDPTable.is());
+return xDPTable;
+}
+
 void ScDataPilotTableObj::setUp()
 {
 nTest++;
diff --git a/test/inc/test/sheet/xdatapilottable2.hxx 
b/test/inc/test/sheet/xdatapilottable2.hxx
index 436376b..e81de86 100644
--- a/test/inc/test/sheet/xdatapilottable2.hxx
+++ b/test/inc/test/sheet/xdatapilottable2.hxx
@@ -31,6 +31,8 @@
 #include com/sun/star/table/CellAddress.hpp
 #include com/sun/star/sheet/XDataPilotTable2.hpp
 
+#include test/testdllapi.hxx
+
 using namespace com::sun::star;
 
 #include vector
@@ -39,7 +41,7 @@ using namespace com::sun::star;
 
 namespace apitest {
 
-class XDataPilotTable2
+class OOO_DLLPUBLIC_TEST XDataPilotTable2
 {
 public:
 void testGetPositionData();
diff --git a/test/source/sheet/xdatapilottable2.cxx 
b/test/source/sheet/xdatapilottable2.cxx
index 57b111d..b707146 100644
--- a/test/source/sheet/xdatapilottable2.cxx
+++ b/test/source/sheet/xdatapilottable2.cxx
@@ -80,6 +80,7 @@ void XDataPilotTable2::testGetDrillDownData()
 }
 }
 
+std::cout  Sum:   sum  ; nVal:   nVal  std::endl;
 CPPUNIT_ASSERT(sum == nVal);
 }
 
commit c1589dbd450426928077694346b773b718e6ff78
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Feb 10 17:41:46 2012 +0100

add test code for XDataPilotTable2

diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 727b230..49fb833 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -79,6 +79,7 @@ $(eval $(call 
gb_Library_add_exception_objects,subsequenttest,\
 test/source/sheet/xdatapilotdescriptor \
 test/source/sheet/xdatapilotfieldgrouping \
 test

[Libreoffice-commits] .: test/source

2012-02-10 Thread Markus Mohrhard
 test/source/sheet/xdatapilottable2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b4346371080e037d04e8aa1fadd01da435339b6e
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Feb 10 19:42:18 2012 +0100

WaE at mac tinderbox

diff --git a/test/source/sheet/xdatapilottable2.cxx 
b/test/source/sheet/xdatapilottable2.cxx
index b707146..2aa34b8 100644
--- a/test/source/sheet/xdatapilottable2.cxx
+++ b/test/source/sheet/xdatapilottable2.cxx
@@ -74,7 +74,7 @@ void XDataPilotTable2::testGetDrillDownData()
 for ( sal_Int32 row = 1; row  aData.getLength(); ++row)
 {
 Any aAny = aData[row][nDim];
-double nValue;
+double nValue = 0;
 if (aAny = nValue)
 sum += nValue;
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - basic/inc basic/Library_sb.mk basic/Package_inc.mk basic/source

2012-02-10 Thread Markus Mohrhard
 basic/Library_sb.mk |1 
 basic/Package_inc.mk|1 
 basic/inc/basic/global.hxx  |   45 
 basic/source/basmgr/basmgr.cxx  |8 +++---
 basic/source/classes/global.cxx |   50 
 5 files changed, 101 insertions(+), 4 deletions(-)

New commits:
commit da39d1443c03da64fe64a1862cdc36246e19d6aa
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Feb 10 22:50:27 2012 +0100

use TransliterationWrapper in lcl_queryMacro, fdo#45607

diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index df20c20..83000b8 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -46,6 +46,7 @@
 
 #include basic/sbuno.hxx
 #include basic/basmgr.hxx
+#include basic/global.hxx
 #include sbunoobj.hxx
 #include basrid.hxx
 #include sbintern.hxx
@@ -1736,12 +1737,11 @@ namespace
 String sModule = sMacro.GetToken( 0, '.', nLast );
 sMacro.Erase( 0, nLast );
 
-IntlWrapper aIntlWrapper( ::comphelper::getProcessServiceFactory(), 
Application::GetSettings().GetLocale() );
-const CollatorWrapper* pCollator = aIntlWrapper.getCollator();
+utl::TransliterationWrapper* pTransliteration = 
SbGlobal::GetTransliteration();
 sal_uInt16 nLibCount = i_manager-GetLibCount();
 for ( sal_uInt16 nLib = 0; nLib  nLibCount; ++nLib )
 {
-if ( COMPARE_EQUAL == pCollator-compareString( 
i_manager-GetLibName( nLib ), sLibName ) )
+if ( pTransliteration-isEqual( i_manager-GetLibName( nLib ), 
sLibName ) )
 {
 StarBASIC* pLib = i_manager-GetLib( nLib );
 if( !pLib )
@@ -1756,7 +1756,7 @@ namespace
 for( sal_uInt16 nMod = 0; nMod  nModCount; ++nMod )
 {
 SbModule* pMod = (SbModule*)pLib-GetModules()-Get( 
nMod );
-if ( pMod  COMPARE_EQUAL == 
pCollator-compareString( pMod-GetName(), sModule ) )
+if ( pMod  pTransliteration-isEqual( 
pMod-GetName(), sModule ) )
 {
 SbMethod* pMethod = (SbMethod*)pMod-Find( sMacro, 
SbxCLASS_METHOD );
 if( pMethod )
commit 05d48fb71f85af3bd66ff1156b71f8d95ea7a411
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Feb 10 22:12:03 2012 +0100

add SbGlobal for shared static objects

diff --git a/basic/Library_sb.mk b/basic/Library_sb.mk
index 04dad27..0171682 100644
--- a/basic/Library_sb.mk
+++ b/basic/Library_sb.mk
@@ -70,6 +70,7 @@ $(eval $(call gb_Library_add_exception_objects,sb,\
basic/source/basmgr/vbahelper \
basic/source/classes/errobject \
basic/source/classes/eventatt \
+   basic/source/classes/global \
basic/source/classes/image \
basic/source/classes/propacc \
basic/source/classes/sb \
diff --git a/basic/Package_inc.mk b/basic/Package_inc.mk
index 603e694..1b1da04 100644
--- a/basic/Package_inc.mk
+++ b/basic/Package_inc.mk
@@ -44,6 +44,7 @@ $(eval $(call 
gb_Package_add_file,basic_inc,inc/basic/sbxdef.hxx,basic/sbxdef.hx
 $(eval $(call 
gb_Package_add_file,basic_inc,inc/basic/sbxfac.hxx,basic/sbxfac.hxx))
 $(eval $(call 
gb_Package_add_file,basic_inc,inc/basic/sbxform.hxx,basic/sbxform.hxx))
 $(eval $(call gb_Package_add_file,basic_inc,inc/basic/sbx.hxx,basic/sbx.hxx))
+$(eval $(call 
gb_Package_add_file,basic_inc,inc/basic/global.hxx,basic/global.hxx))
 $(eval $(call 
gb_Package_add_file,basic_inc,inc/basic/sbxmeth.hxx,basic/sbxmeth.hxx))
 $(eval $(call 
gb_Package_add_file,basic_inc,inc/basic/sbxobj.hxx,basic/sbxobj.hxx))
 $(eval $(call 
gb_Package_add_file,basic_inc,inc/basic/sbxprop.hxx,basic/sbxprop.hxx))
diff --git a/basic/inc/basic/global.hxx b/basic/inc/basic/global.hxx
new file mode 100644
index 000..75c5d62
--- /dev/null
+++ b/basic/inc/basic/global.hxx
@@ -0,0 +1,45 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the License); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an AS IS basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Markus Mohrhard markus.mohrh...@googlemail.com 
(initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3

[Libreoffice-commits] .: 5 commits - sc/Module_sc.mk sc/source

2012-02-08 Thread Markus Mohrhard
 sc/Module_sc.mk  |4 ++--
 sc/source/core/data/documen2.cxx |8 
 sc/source/ui/docshell/impex.cxx  |2 +-
 sc/source/ui/view/preview.cxx|   15 ++-
 4 files changed, 17 insertions(+), 12 deletions(-)

New commits:
commit 73088aaaed3ad16f80405a3d87cea437d350b893
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Feb 8 23:37:49 2012 +0100

we need to explicitly set the paste area in ScMarkData, fdo#45481

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index ede56eb..dd1ed03 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -263,7 +263,7 @@ void ScImportExport::EndPaste()
 pRedoDoc-InitUndo( pDoc, aRange.aStart.Tab(), aRange.aEnd.Tab() );
 pDoc-CopyToDocument( aRange, IDF_ALL | IDF_NOCAPTIONS, false, 
pRedoDoc );
 ScMarkData aDestMark;
-aDestMark.SelectOneTable( aRange.aStart.Tab() );
+aDestMark.SetMarkArea(aRange);
 pDocSh-GetUndoManager()-AddUndoAction(
 new ScUndoPaste(pDocSh, aRange, aDestMark, pUndoDoc, pRedoDoc, 
IDF_ALL, NULL));
 }
commit b14f61c40c1ddd897ba4b54c063753c2e3550d46
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Feb 8 21:04:05 2012 +0100

remove unnecessary check

diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index 51e581c..67e6171 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -269,7 +269,6 @@ void ScPreview::CalcPages()
 
 long nThisStart = nTotalPages;
 ScPrintFunc aPrintFunc( this, pDocShell, i, nAttrPage, 0, NULL, 
aOptions );
-aPrintFunc.InitParam( aOptions );
 long nThisTab = aPrintFunc.GetTotalPages();
 nPages[i] = nThisTab;
 nTotalPages += nThisTab;
@@ -291,10 +290,7 @@ void ScPreview::CalcPages()
 if (nTabCount  nTabsTested)
 nTabsTested = nTabCount;
 
-//  testen, ob hinter letzter Seite
-
-if ( nTabsTested = nTabCount )
-TestLastPage();
+TestLastPage();
 
 aState.nDocPages = nTotalPages;
 
commit d7eddc670410d7194918ff99c735052b880469d8
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Feb 8 21:02:01 2012 +0100

remove unnecessary temporary variable

diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index 4d72ef9..51e581c 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -231,7 +231,6 @@ void ScPreview::CalcPages()
 ScDocument* pDoc = pDocShell-GetDocument();
 nTabCount = pDoc-GetTableCount();
 
-SCTAB nAnz = nTabCount;
 SCTAB nStart = nTabsTested;
 if (!bValid)
 {
@@ -242,7 +241,7 @@ void ScPreview::CalcPages()
 
 // update all pending row heights with a single progress bar,
 // instead of a separate progress for each sheet from ScPrintFunc
-pDocShell-UpdatePendingRowHeights( nAnz-1, true );
+pDocShell-UpdatePendingRowHeights( nTabCount-1, true );
 
 //  PrintOptions is passed to PrintFunc for SkipEmpty flag,
 //  but always all sheets are used (there is no selected sheet)
@@ -252,7 +251,8 @@ void ScPreview::CalcPages()
 nPages.push_back(0);
 while (nStart  static_castSCTAB(nFirstAttr.size()))
 nFirstAttr.push_back(0);
-for (SCTAB i=nStart; inAnz; i++)
+
+for (SCTAB i=nStart; inTabCount; i++)
 {
 if ( i == static_castSCTAB(nPages.size()))
 nPages.push_back(0);
@@ -269,6 +269,7 @@ void ScPreview::CalcPages()
 
 long nThisStart = nTotalPages;
 ScPrintFunc aPrintFunc( this, pDocShell, i, nAttrPage, 0, NULL, 
aOptions );
+aPrintFunc.InitParam( aOptions );
 long nThisTab = aPrintFunc.GetTotalPages();
 nPages[i] = nThisTab;
 nTotalPages += nThisTab;
@@ -287,8 +288,8 @@ void ScPreview::CalcPages()
 
 nDisplayStart = lcl_GetDisplayStart( nTab, pDoc, nPages );
 
-if (nAnz  nTabsTested)
-nTabsTested = nAnz;
+if (nTabCount  nTabsTested)
+nTabsTested = nTabCount;
 
 //  testen, ob hinter letzter Seite
 
commit d893218da7b3e77c97eb7c96384728776f7c870c
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Feb 8 20:06:42 2012 +0100

use slowcheck in sc

diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk
index ef47326..074b1f1 100644
--- a/sc/Module_sc.mk
+++ b/sc/Module_sc.mk
@@ -42,11 +42,12 @@ $(eval $(call gb_Module_add_targets,sc,\
 endif
 
 $(eval $(call gb_Module_add_check_targets,sc,\
+CppunitTest_sc_ucalc \
 CppunitTest_sc_filters_test \
 ))
 
 $(eval $(call gb_Module_add_slowcheck_targets,sc,\
-CppunitTest_sc_ucalc \
+CppunitTest_sc_subsequent_filters_test \
 ))
 
 $(eval $(call gb_Module_add_subsequentcheck_targets,sc,\
@@ -59,7 +60,6 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sc,\
 CppunitTest_sc_namedrangeobj \
 CppunitTest_sc_namedrangesobj \
 CppunitTest_sc_tablesheetsobj

[Libreoffice-commits] .: 2 commits - sc/qa

2012-02-05 Thread Markus Mohrhard
 sc/qa/unit/data/contentCSV/mathematical-functions.csv |3 +++
 sc/qa/unit/data/ods/functions.ods |binary
 2 files changed, 3 insertions(+)

New commits:
commit 01ea91efd98e398e6998837c6bb45a9efea43cdc
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Feb 5 16:01:16 2012 +0100

add some more test cases

diff --git a/sc/qa/unit/data/contentCSV/mathematical-functions.csv 
b/sc/qa/unit/data/contentCSV/mathematical-functions.csv
index 5be0251..cebf207 100644
--- a/sc/qa/unit/data/contentCSV/mathematical-functions.csv
+++ b/sc/qa/unit/data/contentCSV/mathematical-functions.csv
@@ -15,3 +15,6 @@
 8
 12
 5
+1.2, 1, 0, 1000
+2, 4, Err:502
+
diff --git a/sc/qa/unit/data/ods/functions.ods 
b/sc/qa/unit/data/ods/functions.ods
index e9426fe..a90a224 100644
Binary files a/sc/qa/unit/data/ods/functions.ods and 
b/sc/qa/unit/data/ods/functions.ods differ
commit 7ee0b42f7cad15abca7218d001ea1b3b4cac028e
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sun Feb 5 15:51:25 2012 +0100

add some helpful entries to test file

diff --git a/sc/qa/unit/data/ods/functions.ods 
b/sc/qa/unit/data/ods/functions.ods
index 9ccb67f..e9426fe 100644
Binary files a/sc/qa/unit/data/ods/functions.ods and 
b/sc/qa/unit/data/ods/functions.ods differ
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 4 commits - qadevOOo/tests sc/qa test/inc test/Library_subsequenttest.mk test/Package_inc.mk test/source

2012-02-01 Thread Markus Mohrhard
 dev/null|binary
 qadevOOo/tests/java/ifc/container/_XNamed.java  |3 
 qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_DDELinksEnumeration.java |4 
 qadevOOo/tests/java/mod/_sc/ScSheetLinkObj.java |2 
 qadevOOo/tests/java/mod/_sc/ScTableSheetObj.java|2 
 qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java |4 
 qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java |4 
 sc/qa/unoapi/sc.sce |  116 
+-
 sc/qa/unoapi/testdocuments/ScSheetLinksObj.ods  |binary
 test/Library_subsequenttest.mk  |1 
 test/Package_inc.mk |1 
 test/inc/test/container/xnamereplace.hxx|   56 

 test/source/container/xnamereplace.cxx  |   48 

 13 files changed, 171 insertions(+), 70 deletions(-)

New commits:
commit 513bbdf9c4664e2677537acb9387df84349529cd
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Feb 1 22:30:11 2012 +0100

remove unused test document, use the ods version instead

diff --git a/sc/qa/unoapi/testdocuments/ScSheetLinksObj.sdc 
b/sc/qa/unoapi/testdocuments/ScSheetLinksObj.sdc
deleted file mode 100644
index a7f43fe..000
Binary files a/sc/qa/unoapi/testdocuments/ScSheetLinksObj.sdc and /dev/null 
differ
commit 5bd82e6c7bad871689106158f2a82d56e7bffb35
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Jan 31 21:04:27 2012 +0100

prevent hanging junit tests

diff --git a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java 
b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java
index 1068af5..b81a4b5 100644
--- a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java
+++ b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsEnumeration.java
@@ -75,9 +75,7 @@ public class ScUniqueCellFormatsEnumeration extends TestCase {
 * Disposes Spreadsheet document.
 */
 protected void cleanup(TestParameters tParam, PrintWriter log) {
-//add this lines after synchronisation
-//log.println(disposing xSheetDoc );
-//DesktopTools.closeDoc(xSheetDoc);
+util.DesktopTools.closeDoc(xSheetDoc);
 }
 
 protected TestEnvironment createTestEnvironment(TestParameters tParam,
diff --git a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java 
b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java
index e85fcb2..5a59204 100644
--- a/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java
+++ b/qadevOOo/tests/java/mod/_sc/ScUniqueCellFormatsObj.java
@@ -74,9 +74,7 @@ public class ScUniqueCellFormatsObj extends TestCase {
 * Disposes Spreadsheet document.
 */
 protected void cleanup(TestParameters tParam, PrintWriter log) {
-//add this lines after synchronisation
-//log.println(disposing xSheetDoc );
-//DesktopTools.closeDoc(xSheetDoc);
+util.DesktopTools.closeDoc(xSheetDoc);
 }
 
 protected TestEnvironment createTestEnvironment(TestParameters tParam,
commit bd6187ae9fdf2535333d372be65f01131262d385
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Jan 31 20:49:16 2012 +0100

add test for XNameReplace

diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index fea04b6..727b230 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -70,6 +70,7 @@ $(eval $(call 
gb_Library_add_exception_objects,subsequenttest,\
 test/source/container/xelementaccess \
 test/source/container/xindexaccess \
 test/source/container/xnamecontainer \
+test/source/container/xnamereplace \
 test/source/container/xnamed \
 test/source/sheet/cellproperties \
 test/source/sheet/datapilotfield \
diff --git a/test/Package_inc.mk b/test/Package_inc.mk
index c424707..7199974 100644
--- a/test/Package_inc.mk
+++ b/test/Package_inc.mk
@@ -38,6 +38,7 @@ $(eval $(call 
gb_Package_add_file,test_inc,inc/test/container/xelementaccess.hxx
 $(eval $(call 
gb_Package_add_file,test_inc,inc/test/container/xnamed.hxx,test/container/xnamed.hxx))
 $(eval $(call 
gb_Package_add_file,test_inc,inc/test/container/xindexaccess.hxx,test/container/xindexaccess.hxx))
 $(eval $(call 
gb_Package_add_file,test_inc,inc/test/container/xnamecontainer.hxx,test/container/xnamecontainer.hxx))
+$(eval $(call 
gb_Package_add_file,test_inc,inc/test/container/xnamereplace.hxx,test/container/xnamereplace.hxx))
 $(eval $(call 
gb_Package_add_file,test_inc,inc/test/sheet/cellproperties.hxx,test/sheet/cellproperties.hxx))
 $(eval $(call 
gb_Package_add_file,test_inc,inc/test/sheet/xdatapilottable.hxx,test/sheet/xdatapilottable.hxx))
 $(eval $(call 
gb_Package_add_file,test_inc,inc/test/sheet

[Libreoffice-commits] .: sc/CppunitTest_sc_cellrangeobj.mk sc/qa test/inc test/Library_subsequenttest.mk test/Package_inc.mk test/source

2012-01-29 Thread Markus Mohrhard
 sc/CppunitTest_sc_cellrangeobj.mk  |1 
 sc/qa/extras/sccellrangeobj.cxx|   20 -
 sc/qa/extras/sctablesheetobj.cxx   |8 +-
 sc/qa/extras/testdocuments/ScTableSheetObj.ods |binary
 test/Library_subsequenttest.mk |1 
 test/Package_inc.mk|1 
 test/inc/test/util/xreplaceable.hxx|   54 +
 test/source/util/xreplaceable.cxx  |   99 +
 8 files changed, 180 insertions(+), 4 deletions(-)

New commits:
commit 8cab24997ac0cca4d3bde972397ad6550bf07859
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Jan 30 00:20:54 2012 +0100

add test case for XReplaceable

diff --git a/sc/CppunitTest_sc_cellrangeobj.mk 
b/sc/CppunitTest_sc_cellrangeobj.mk
index c72a1c2..a6a43d5 100644
--- a/sc/CppunitTest_sc_cellrangeobj.mk
+++ b/sc/CppunitTest_sc_cellrangeobj.mk
@@ -100,6 +100,7 @@ $(eval $(call 
gb_CppunitTest_add_components,sc_cellrangesbase,\
 forms/util/frm \
 framework/util/fwk \
 i18npool/util/i18npool \
+i18npool/source/search/i18nsearch \
 oox/util/oox \
 package/source/xstor/xstor \
 package/util/package2 \
diff --git a/sc/qa/extras/sccellrangeobj.cxx b/sc/qa/extras/sccellrangeobj.cxx
index 20a191c..050724d 100644
--- a/sc/qa/extras/sccellrangeobj.cxx
+++ b/sc/qa/extras/sccellrangeobj.cxx
@@ -29,6 +29,8 @@
 #include test/unoapi_test.hxx
 #include test/sheet/xcellrangesquery.hxx
 #include test/sheet/cellproperties.hxx
+#include test/util/xreplaceable.hxx
+#include test/util/xsearchable.hxx
 
 #include com/sun/star/sheet/XSpreadsheetDocument.hpp
 #include com/sun/star/sheet/XSpreadsheet.hpp
@@ -36,11 +38,14 @@
 
 namespace sc_apitest {
 
-#define NUMBER_OF_TESTS 8
+#define NUMBER_OF_TESTS 12
 
-class ScCellRangeObj : public UnoApiTest, apitest::XCellRangesQuery, 
apitest::CellProperties
+class ScCellRangeObj : public UnoApiTest, apitest::XCellRangesQuery, 
apitest::CellProperties,
+apitest::XSearchable, apitest::XReplaceable
 {
 public:
+ScCellRangeObj();
+
 virtual void setUp();
 virtual void tearDown();
 virtual uno::Reference uno::XInterface  init();
@@ -55,6 +60,10 @@ public:
 CPPUNIT_TEST(testQueryVisibleCells);
 CPPUNIT_TEST(testVertJustify);
 CPPUNIT_TEST(testRotateReference);
+CPPUNIT_TEST(testFindAll);
+CPPUNIT_TEST(testFindFirst);
+CPPUNIT_TEST(testReplaceAll);
+CPPUNIT_TEST(testCreateReplaceDescriptor);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -65,6 +74,13 @@ private:
 sal_Int32 ScCellRangeObj::nTest = 0;
 uno::Reference lang::XComponent  ScCellRangeObj::mxComponent;
 
+ScCellRangeObj::ScCellRangeObj():
+apitest::XSearchable(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(15)), 
1),
+
apitest::XReplaceable(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(15)), 
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(35)))
+{
+
+}
+
 uno::Reference uno::XInterface  ScCellRangeObj::init()
 {
 rtl::OUString aFileURL;
diff --git a/sc/qa/extras/sctablesheetobj.cxx b/sc/qa/extras/sctablesheetobj.cxx
index 6fae46f..0f1d79a 100644
--- a/sc/qa/extras/sctablesheetobj.cxx
+++ b/sc/qa/extras/sctablesheetobj.cxx
@@ -27,6 +27,7 @@
  */
 
 #include test/unoapi_test.hxx
+#include test/util/xreplaceable.hxx
 #include test/util/xsearchable.hxx
 
 #include com/sun/star/sheet/XSpreadsheetDocument.hpp
@@ -35,7 +36,7 @@
 namespace sc_apitest
 {
 
-class ScTableSheetObj : public UnoApiTest, apitest::XSearchable
+class ScTableSheetObj : public UnoApiTest, apitest::XSearchable, 
apitest::XReplaceable
 {
 public:
 ScTableSheetObj();
@@ -46,6 +47,8 @@ public:
 CPPUNIT_TEST(testFindAll);
 CPPUNIT_TEST(testFindNext);
 CPPUNIT_TEST(testFindFirst);
+CPPUNIT_TEST(testReplaceAll);
+CPPUNIT_TEST(testCreateReplaceDescriptor);
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -57,7 +60,8 @@ sal_Int32 ScTableSheetObj::nTest = 0;
 uno::Reference lang::XComponent  ScTableSheetObj::mxComponent;
 
 ScTableSheetObj::ScTableSheetObj():
-apitest::XSearchable(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(test)), 4)
+apitest::XSearchable(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(test)), 
4),
+
apitest::XReplaceable(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(searchReplaceString)),
 rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(replaceReplaceString)))
 {
 
 }
diff --git a/sc/qa/extras/testdocuments/ScTableSheetObj.ods 
b/sc/qa/extras/testdocuments/ScTableSheetObj.ods
index 49863c0..86d027c 100644
Binary files a/sc/qa/extras/testdocuments/ScTableSheetObj.ods and 
b/sc/qa/extras/testdocuments/ScTableSheetObj.ods differ
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index a8ac6fb..fea04b6 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -81,6 +81,7 @@ $(eval $(call 
gb_Library_add_exception_objects,subsequenttest,\
 test/source/sheet/xnamedrange \
 test/source/sheet/xnamedranges \
 test

  1   2   >