[Libreoffice-commits] calc/xls-import

2012-05-14 Thread Kohei Yoshida
 calc/xls-import/perf/large-number-of-raw-cells.xls.bz2 |binary
 1 file changed

New commits:
commit 98c4c2acf2a819d12ea560a69ef556974773589d
Author: Kohei Yoshida 
Date:   Mon May 14 12:52:08 2012 -0400

(bzip2'ed) xls document containing tons of raw number/string cells.

This is to be used to measure xls import performance.

diff --git a/calc/xls-import/perf/large-number-of-raw-cells.xls.bz2 
b/calc/xls-import/perf/large-number-of-raw-cells.xls.bz2
new file mode 100644
index 000..ae5816a
Binary files /dev/null and 
b/calc/xls-import/perf/large-number-of-raw-cells.xls.bz2 differ
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] calc/xlsx-import

2012-05-12 Thread Kohei Yoshida
 calc/xlsx-import/perf/8-by-30-cells.xlsx |binary
 1 file changed

New commits:
commit 1bfb69e6161fecdf6f131d233694fdb457eed91a
Author: Kohei Yoshida 
Date:   Sat May 12 11:19:08 2012 -0400

New large xlsx document that contains 8 by 30 cells.

diff --git a/calc/xlsx-import/perf/8-by-30-cells.xlsx 
b/calc/xlsx-import/perf/8-by-30-cells.xlsx
new file mode 100644
index 000..abe21b6
Binary files /dev/null and b/calc/xlsx-import/perf/8-by-30-cells.xlsx differ
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-04-20 Thread Kohei Yoshida
 sc/inc/compiler.hxx  |9 ++-
 sc/inc/rangenam.hxx  |6 ++--
 sc/source/core/data/table1.cxx   |   10 ---
 sc/source/core/tool/compiler.cxx |   50 +++
 sc/source/core/tool/rangenam.cxx |   10 +++
 5 files changed, 42 insertions(+), 43 deletions(-)

New commits:
commit 51648779ccf76bc7c6b6ff1ed4cd32eb75af9a5a
Author: Eike Rathke 
Date:   Fri Apr 20 00:20:29 2012 +0200

resolved fdo#48856 update sheet-local named expressions correctly

This combines from master:

44481da569df85aa91455fdc2892a4e0c5818e6c
Author: Markus Mohrhard 

update relative local range names, fdo#48856

Signed-off-by: Eike Rathke 

409f11ae387c859dcf9275c08093649a676e1f9e
Author: Eike Rathke 

fdo#48856 update sheet-local named expressions correctly

* Named expression must be updated before any formulas that would access 
them.
* Handle all ocName tokens differentiating between global and sheet-local
  names.

Signed-off-by: Markus Mohrhard 
Signed-off-by: Kohei Yoshida 
Signed-off-by: Noel Power 

diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx
index 371192c..765187e 100644
--- a/sc/inc/compiler.hxx
+++ b/sc/inc/compiler.hxx
@@ -364,6 +364,13 @@ private:
 
 void SetRelNameReference();
 
+/** Obtain range data for ocName token, global or sheet local.
+
+Prerequisite: rToken is a FormulaIndexToken so IsGlobal() and
+GetIndex() can be called on it. We don't check with RTTI.
+ */
+ScRangeData* GetRangeData( const formula::FormulaToken& pToken ) const;
+
 static void InitCharClassEnglish();
 
 public:
@@ -442,7 +449,7 @@ public:
 bool UpdateNameReference( UpdateRefMode eUpdateRefMode,
   const ScRange&,
   SCsCOL nDx, SCsROW nDy, SCsTAB nDz,
-  bool& rChanged, bool bSharedFormula = false);
+  bool& rChanged, bool bSharedFormula = false, 
bool bLocal = false);
 
 ScRangeData* UpdateReference( UpdateRefMode eUpdateRefMode,
   const ScAddress& rOldPos, const ScRange&,
diff --git a/sc/inc/rangenam.hxx b/sc/inc/rangenam.hxx
index 53e9ec8..e2bf10b 100644
--- a/sc/inc/rangenam.hxx
+++ b/sc/inc/rangenam.hxx
@@ -140,7 +140,7 @@ public:
 const formula::FormulaGrammar::Grammar 
eGrammar = formula::FormulaGrammar::GRAM_DEFAULT );
 voidUpdateReference( UpdateRefMode eUpdateRefMode,
  const ScRange& r,
- SCsCOL nDx, SCsROW nDy, SCsTAB nDz );
+ SCsCOL nDx, SCsROW nDy, SCsTAB nDz, bool bLocal = 
false );
 boolIsModified() const  { return bModified; }
 
 SC_DLLPUBLIC void   GuessPosition();
@@ -203,9 +203,9 @@ public:
 SC_DLLPUBLIC const ScRangeData* findByRange(const ScRange& rRange) const;
 SC_DLLPUBLIC ScRangeData* findByUpperName(const rtl::OUString& rName);
 SC_DLLPUBLIC const ScRangeData* findByUpperName(const rtl::OUString& 
rName) const;
-SC_DLLPUBLIC ScRangeData* findByIndex(sal_uInt16 i);
+SC_DLLPUBLIC ScRangeData* findByIndex(sal_uInt16 i) const;
 void UpdateReference(UpdateRefMode eUpdateRefMode, const ScRange& rRange,
- SCsCOL nDx, SCsROW nDy, SCsTAB nDz);
+ SCsCOL nDx, SCsROW nDy, SCsTAB nDz, bool bLocal = 
false);
 void UpdateTabRef(SCTAB nTable, sal_uInt16 nFlag, SCTAB nNewTable = 0, 
SCTAB nNewSheets = 1);
 void UpdateTranspose(const ScRange& rSource, const ScAddress& rDest);
 void UpdateGrow(const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY);
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 31c3f46..76f371b 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1317,16 +1317,18 @@ void ScTable::UpdateReference( UpdateRefMode 
eUpdateRefMode, SCCOL nCol1, SCROW
 i = 0;
 iMax = MAXCOL;
 }
-for ( ; i<=iMax; i++)
-bUpdated |= aCol[i].UpdateReference(
-eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, 
nDy, nDz, pUndoDoc );
 
+// Named expressions need to be updated before formulas acessing them.
 if (mpRangeName)
 {
 ScRange aRange( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );;
-mpRangeName->UpdateReference( eUpdateRefMode, aRange, nDx, nDy, nDz );
+mpRangeName->UpdateReference( eUpdateRefMode, aRange, nDx, nDy, nDz, 
true );
 }
 
+for ( ; i<=iMax; i++)
+bUpdated |= aCol[i].UpdateReference(
+eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, 
nDy, nDz, pUndoDoc );
+
 if ( bIncludeDraw )
 UpdateDrawRef( eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2,

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

2012-04-19 Thread Kohei Yoshida
 editeng/source/editeng/eehtml.hxx   |3 +++
 editeng/source/editeng/eertfpar.hxx |4 
 editeng/source/editeng/impedit.hxx  |6 +++---
 editeng/source/editeng/impedit2.cxx |   26 +-
 editeng/source/editeng/impedit4.cxx |5 ++---
 5 files changed, 25 insertions(+), 19 deletions(-)

New commits:
commit 4327d4973b572ed749803007d90574919da31f04
Author: Kohei Yoshida 
Date:   Thu Apr 19 15:59:45 2012 -0400

Revert "Use boost::scoped_ptr for this."

This reverts commit a4bc804627b8b21506e9b86fa54d2f7d2525e43e.

diff --git a/editeng/source/editeng/eertfpar.hxx 
b/editeng/source/editeng/eertfpar.hxx
index 5b69074..df27f20 100644
--- a/editeng/source/editeng/eertfpar.hxx
+++ b/editeng/source/editeng/eertfpar.hxx
@@ -120,6 +120,10 @@ public:
 EditPaM GetCurPaM() const   { return aCurSel.Max(); }
 };
 
+SV_DECL_REF( EditRTFParser )
+SV_IMPL_REF( EditRTFParser );
+
+
 #endif  //_EERTFPAR_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/editeng/source/editeng/impedit4.cxx 
b/editeng/source/editeng/impedit4.cxx
index b142a98..7316d7e 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -86,7 +86,6 @@
 #include 
 
 #include 
-#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -179,7 +178,7 @@ EditPaM ImpEditEngine::ReadRTF( SvStream& rInput, 
EditSelection aSel )
 DBG_ASSERT(pPool && 
pPool->GetName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EditEngineItemPool")),
 "ReadRTF: no EditEnginePool!");
 
-boost::scoped_ptr xPrsr(new EditRTFParser(rInput, aSel, 
*pPool, pEditEngine));
+EditRTFParserRef xPrsr = new EditRTFParser(rInput, aSel, *pPool, 
pEditEngine);
 SvParserState eState = xPrsr->CallParser();
 if ( ( eState != SVPAR_ACCEPTED ) && ( !rInput.GetError() ) )
 {
commit 81a1386656622ddb7c453e473f559103ea1f9fd9
Author: Kohei Yoshida 
Date:   Thu Apr 19 15:59:08 2012 -0400

Revert "Let's use boost::scoped_ptr for this."

This reverts commit e1520a9d6a9f9bcfcaa332d54892040fe54776c2.

diff --git a/editeng/source/editeng/eehtml.hxx 
b/editeng/source/editeng/eehtml.hxx
index c74f91e..71f61c8 100644
--- a/editeng/source/editeng/eehtml.hxx
+++ b/editeng/source/editeng/eehtml.hxx
@@ -92,6 +92,9 @@ public:
 const EditSelection&GetCurSelection() const { return aCurSel; }
 };
 
+SV_DECL_REF( EditHTMLParser )
+SV_IMPL_REF( EditHTMLParser );
+
 #endif // _EEHTML_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/editeng/source/editeng/impedit4.cxx 
b/editeng/source/editeng/impedit4.cxx
index 89dce47..b142a98 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -194,7 +194,7 @@ EditPaM ImpEditEngine::ReadHTML( SvStream& rInput, const 
String& rBaseURL, EditS
 if ( aSel.HasRange() )
 aSel = ImpDeleteSelection( aSel );
 
-boost::scoped_ptr xPrsr(new EditHTMLParser(rInput, 
rBaseURL, pHTTPHeaderAttrs));
+EditHTMLParserRef xPrsr = new EditHTMLParser( rInput, rBaseURL, 
pHTTPHeaderAttrs );
 SvParserState eState = xPrsr->CallParser(pEditEngine, aSel.Max());
 if ( ( eState != SVPAR_ACCEPTED ) && ( !rInput.GetError() ) )
 {
commit 3fdd8667d8876a6661f1c900116e6d4681f43334
Author: Kohei Yoshida 
Date:   Wed Apr 18 16:14:39 2012 -0400

Pass const reference.

diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 4edfee5..a662dab 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -551,11 +551,11 @@ private:
 voidImpBreakLine( ParaPortion* pParaPortion, EditLine* 
pLine, TextPortion* pPortion, sal_uInt16 nPortionStart, long nRemainingWidth, 
sal_Bool bCanHyphenate );
 voidImpAdjustBlocks( ParaPortion* pParaPortion, EditLine* 
pLine, long nRemainingSpace );
 EditPaM ImpConnectParagraphs( ContentNode* pLeft, ContentNode* 
pRight, sal_Bool bBackward = sal_False );
-EditPaM ImpDeleteSelection( EditSelection aEditSelection);
+EditPaM ImpDeleteSelection(const EditSelection& rCurSel);
 EditPaM ImpInsertParaBreak( EditPaM& rPaM, bool 
bKeepEndingAttribs = true );
 EditPaM ImpInsertParaBreak( const EditSelection& 
rEditSelection, bool bKeepEndingAttribs = true );
 EditPaM ImpInsertText(const EditSelection& aCurEditSelection, 
const String& rStr);
-EditPaM ImpInsertFeature( EditSelection aEditSelection, const 
SfxPoolItem& rItem );
+EditPaM ImpInsertFeature(const EditSelection& rCurSel, const 
SfxPoolItem& rItem);
 voidImpRemoveChars( const EditPaM& rPaM, sal_uInt16 
nChars, EditUndoRemoveChars* pCurUndo = 0 );
 voidImpRe

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

2012-04-18 Thread Kohei Yoshida
 editeng/source/editeng/editattr.cxx |   31 ---
 editeng/source/editeng/editattr.hxx |   17 ++---
 editeng/source/editeng/editdoc.cxx  |2 +-
 editeng/source/editeng/impedit2.cxx |2 +-
 editeng/source/editeng/impedit3.cxx |4 ++--
 sc/inc/address.hxx  |   18 +-
 sc/source/ui/optdlg/tpdefaults.cxx  |   11 ---
 sc/source/ui/vba/vbaapplication.cxx |5 +++--
 8 files changed, 46 insertions(+), 44 deletions(-)

New commits:
commit 8edf5c5ee61b85c17389ceb48f78daa06edf36f4
Author: Kohei Yoshida 
Date:   Wed Apr 18 14:57:20 2012 -0400

This is no longer relevant. Removing.

diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index 182fba1..5f104b3 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -108,18 +108,6 @@ const SCROW SCROWS32K = 32000;
 const SCCOL SCCOL_REPEAT_NONE = SCCOL_MAX;
 const SCROW SCROW_REPEAT_NONE = SCROW_MAX;
 
-
-// We hope to get rid of the binary file format. If not, these are the places
-// we'd have to investigate because variable types changed. Just place code in
-// #if SC_ROWLIMIT_STREAM_ACCESS for now.
-#define SC_ROWLIMIT_STREAM_ACCESS 0
-// usage:
-//#if SC_ROWLIMIT_STREAM_ACCESS
-//#error address types changed!
-//... code ...
-//#endif // SC_ROWLIMIT_STREAM_ACCESS
-
-
 // For future reference, place in code where more than 64k rows would need a
 // special handling:
 // #if SC_ROWLIMIT_MORE_THAN_64K
commit 670db0daa2ed638ec9df0d5d569d7c43ae1bf786
Author: Albert Thuswaldner 
Date:   Wed Apr 18 00:31:02 2012 +0200

Use global constants for initial tab count bounds checking

diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index 6c45311..182fba1 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -95,7 +95,11 @@ const SCROW   MAXROW = MAXROWCOUNT - 1;
 const SCCOL   MAXCOL = MAXCOLCOUNT - 1;
 const SCTAB   MAXTAB = MAXTABCOUNT - 1;
 const SCCOLROWMAXCOLROW  = MAXROW;
-
+// Limit the initial tab count to prevent users to set the count too high,
+// which could cause the memory usage of blank documents to exceed the
+// available system memory.
+const SCTAB   MAXINITTAB = 1024;
+const SCTAB   MININITTAB = 1;
 
 // Special values
 const SCTAB SC_TAB_APPEND = SCTAB_MAX;
diff --git a/sc/source/ui/optdlg/tpdefaults.cxx 
b/sc/source/ui/optdlg/tpdefaults.cxx
index bc5b988..b67e87b 100644
--- a/sc/source/ui/optdlg/tpdefaults.cxx
+++ b/sc/source/ui/optdlg/tpdefaults.cxx
@@ -36,9 +36,6 @@
 #include "defaultsoptions.hxx"
 #include "document.hxx"
 
-#define INIT_SHEETS_MIN 1
-#define INIT_SHEETS_MAX 1024
-
 using ::rtl::OUString;
 
 ScTpDefaultsOptions::ScTpDefaultsOptions(Window *pParent, const SfxItemSet 
&rCoreSet) :
@@ -119,10 +116,10 @@ int ScTpDefaultsOptions::DeactivatePage(SfxItemSet* 
/*pSet*/)
 void ScTpDefaultsOptions::CheckNumSheets()
 {
 sal_Int64 nVal = aEdNSheets.GetValue();
-if (nVal > INIT_SHEETS_MAX)
-aEdNSheets.SetValue(INIT_SHEETS_MAX);
-if (nVal < INIT_SHEETS_MIN)
-aEdNSheets.SetValue(INIT_SHEETS_MIN);
+if (nVal > MAXINITTAB)
+aEdNSheets.SetValue(MAXINITTAB);
+if (nVal < MININITTAB)
+aEdNSheets.SetValue(MININITTAB);
 }
 
 void ScTpDefaultsOptions::CheckPrefix(Edit* pEdit)
diff --git a/sc/source/ui/vba/vbaapplication.cxx 
b/sc/source/ui/vba/vbaapplication.cxx
index 478e8f4..4204ba0 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -945,9 +945,10 @@ sal_Int32 SAL_CALL 
ScVbaApplication::getSheetsInNewWorkbook() throw (uno::Runtim
 
 void SAL_CALL ScVbaApplication::setSheetsInNewWorkbook( sal_Int32 
SheetsInNewWorkbook ) throw (script::BasicErrorException, uno::RuntimeException)
 {
-if ( SheetsInNewWorkbook < 1 || SheetsInNewWorkbook > MAXTAB )
+if ( SheetsInNewWorkbook < MININITTAB
+  || SheetsInNewWorkbook > MAXINITTAB )
 {
-DebugHelper::exception( OUString(RTL_CONSTASCII_USTRINGPARAM("The 
number must be between 1 and 255")),
+DebugHelper::exception( OUString(RTL_CONSTASCII_USTRINGPARAM("The 
number must be between 1 and 1")),
 uno::Exception(), SbERR_METHOD_FAILED, OUString() );
 }
 else
commit e4784750705b3d2649b461ade363c84bd1b2b10b
Author: Kohei Yoshida 
Date:   Wed Apr 18 11:58:06 2012 -0400

String & bool cleanup.

diff --git a/editeng/source/editeng/editattr.cxx 
b/editeng/source/editeng/editattr.cxx
index 131f889..d5b640f 100644
--- a/editeng/source/editeng/editattr.cxx
+++ b/editeng/source/editeng/editattr.cxx
@@ -328,6 +328,23 @@ void EditCharAttribField::SetFont( SvxFont& rFont, 
OutputDevice* )
 rFont.SetColor( *pTxtColor );
 }
 
+const rtl::OUString& EditCharAttribField::GetFieldValue() const
+{
+return aFieldValue;
+}
+
+void EditCharAttribField::SetFieldValue(const rtl::OUString& rVal)
+{
+aFieldValue = rVal;
+

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

2012-04-18 Thread Kohei Yoshida
 editeng/inc/editeng/flditem.hxx  |   38 ++
 editeng/source/items/flditem.cxx |   15 +++
 2 files changed, 37 insertions(+), 16 deletions(-)

New commits:
commit 7746e42006a5732a9e26dd21481391f0419d0a2e
Author: Kohei Yoshida 
Date:   Tue Apr 17 16:54:00 2012 -0400

Non-inlining constructors.

diff --git a/editeng/inc/editeng/flditem.hxx b/editeng/inc/editeng/flditem.hxx
index be874b0..4b85be9 100644
--- a/editeng/inc/editeng/flditem.hxx
+++ b/editeng/inc/editeng/flditem.hxx
@@ -194,8 +194,9 @@ public:
 class EDITENG_DLLPUBLIC SvxPageField : public SvxFieldData
 {
 public:
-SV_DECL_PERSIST1( SvxPageField, SvxFieldData, 
SVX_PAGEFIELD )
-SvxPageField() {}
+SV_DECL_PERSIST1( SvxPageField, SvxFieldData, SVX_PAGEFIELD )
+SvxPageField();
+
 virtual SvxFieldData*   Clone() const;
 virtual int operator==( const SvxFieldData& ) const;
 
@@ -205,8 +206,9 @@ public:
 class EDITENG_DLLPUBLIC SvxPagesField : public SvxFieldData
 {
 public:
-SV_DECL_PERSIST1( SvxPagesField, SvxFieldData, 
SVX_PAGESFIELD )
-SvxPagesField() {}
+SV_DECL_PERSIST1( SvxPagesField, SvxFieldData, SVX_PAGESFIELD )
+SvxPagesField();
+
 virtual SvxFieldData*   Clone() const;
 virtual int operator==( const SvxFieldData& ) const;
 };
@@ -214,8 +216,9 @@ public:
 class EDITENG_DLLPUBLIC SvxTimeField : public SvxFieldData
 {
 public:
-SV_DECL_PERSIST1( SvxTimeField, SvxFieldData, 
SVX_TIMEFIELD )
-SvxTimeField() {}
+SV_DECL_PERSIST1( SvxTimeField, SvxFieldData, SVX_TIMEFIELD )
+SvxTimeField();
+
 virtual SvxFieldData*   Clone() const;
 virtual int operator==( const SvxFieldData& ) const;
 
@@ -225,8 +228,9 @@ public:
 class EDITENG_DLLPUBLIC SvxFileField : public SvxFieldData
 {
 public:
-SV_DECL_PERSIST1( SvxFileField, SvxFieldData, 
SVX_FILEFIELD )
-SvxFileField() {}
+SV_DECL_PERSIST1( SvxFileField, SvxFieldData, SVX_FILEFIELD )
+SvxFileField();
+
 virtual SvxFieldData*   Clone() const;
 virtual int operator==( const SvxFieldData& ) const;
 };
@@ -234,8 +238,9 @@ public:
 class EDITENG_DLLPUBLIC SvxTableField : public SvxFieldData
 {
 public:
-SV_DECL_PERSIST1( SvxTableField, SvxFieldData, 
SVX_TABLEFIELD )
-SvxTableField() {}
+SV_DECL_PERSIST1( SvxTableField, SvxFieldData, SVX_TABLEFIELD )
+SvxTableField();
+
 virtual SvxFieldData*   Clone() const;
 virtual int operator==( const SvxFieldData& ) const;
 };
@@ -382,8 +387,9 @@ public:
 class EDITENG_DLLPUBLIC SvxHeaderField : public SvxFieldData
 {
 public:
-SV_DECL_PERSIST1( SvxHeaderField, SvxFieldData, 
SVX_HEADERFIELD )
-SvxHeaderField() {}
+SV_DECL_PERSIST1( SvxHeaderField, SvxFieldData, SVX_HEADERFIELD )
+SvxHeaderField();
+
 virtual SvxFieldData*   Clone() const;
 virtual int operator==( const SvxFieldData& ) const;
 };
@@ -393,8 +399,8 @@ public:
 class EDITENG_DLLPUBLIC SvxFooterField : public SvxFieldData
 {
 public:
-SV_DECL_PERSIST1( SvxFooterField, SvxFieldData, 
SVX_FOOTERFIELD )
-SvxFooterField() {}
+SV_DECL_PERSIST1( SvxFooterField, SvxFieldData, SVX_FOOTERFIELD )
+SvxFooterField();
 virtual SvxFieldData*   Clone() const;
 virtual int operator==( const SvxFieldData& ) const;
 };
@@ -404,8 +410,8 @@ public:
 class EDITENG_DLLPUBLIC SvxDateTimeField : public SvxFieldData
 {
 public:
-SV_DECL_PERSIST1( SvxDateTimeField, SvxFieldData, 
SVX_DATEFIMEFIELD )
-SvxDateTimeField() {}
+SV_DECL_PERSIST1( SvxDateTimeField, SvxFieldData, SVX_DATEFIMEFIELD )
+SvxDateTimeField();
 
 static rtl::OUStringGetFormatted( Date& rDate, Time& rTime, int 
eFormat, SvNumberFormatter& rFormatter, LanguageType eLanguage );
 
diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index 46153e6..fb16479 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -436,6 +436,8 @@ MetaAction* SvxURLField::createBeginComment() const
 
 SV_IMPL_PERSIST1( SvxPageField, SvxFieldData );
 
+SvxPageField::SvxPageField() {}
+
 SvxFieldData* SvxPageField::Clone() const
 {
 return new SvxPageField;// empty
@@ -462,6 +464,8 @@ MetaAction* SvxPageField::createBeginComment() const
 
 SV_IMPL_PERSIST1( SvxPagesField, SvxFieldData );
 
+SvxPagesField::SvxPagesField() {}
+
 SvxFieldData* SvxPagesField::Clone() const
 {
 return new SvxPagesField;   // empty
@@ -482,6 +486,8 @@ void SvxPagesField::Save( SvPersistStream & 

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

2012-04-17 Thread Kohei Yoshida
 sc/source/ui/inc/mvtabdlg.hxx  |2 ++
 sc/source/ui/miscdlgs/mvtabdlg.cxx |   27 +--
 2 files changed, 19 insertions(+), 10 deletions(-)

New commits:
commit 05579aa8b26f593af650d8434ff1c25c0a2702a6
Author: Eike Rathke 
Date:   Tue Apr 17 20:57:34 2012 +0200

resolved rhbz#813280 the current document is not always the first in list

i.e. if more than one document open and dialog invoked on any but the first
document.

Signed-off-by: Kohei Yoshida 

diff --git a/sc/source/ui/inc/mvtabdlg.hxx b/sc/source/ui/inc/mvtabdlg.hxx
index c53a59f..f9c63a3 100644
--- a/sc/source/ui/inc/mvtabdlg.hxx
+++ b/sc/source/ui/inc/mvtabdlg.hxx
@@ -58,6 +58,7 @@ private:
 void ResetRenameInput();
 void CheckNewTabName();
 ScDocument* GetSelectedDoc();
+bool IsCurrentDocSelected() const;
 
 private:
 FixedLine   aFlAction;
@@ -82,6 +83,7 @@ private:
 
 const rtl::OUString maDefaultName;
 
+sal_uInt16  mnCurrentDocPos;
 sal_uInt16  nDocument;
 SCTAB   nTable;
 boolbCopyTable:1;
diff --git a/sc/source/ui/miscdlgs/mvtabdlg.cxx 
b/sc/source/ui/miscdlgs/mvtabdlg.cxx
index 831905d..ffe96af 100644
--- a/sc/source/ui/miscdlgs/mvtabdlg.cxx
+++ b/sc/source/ui/miscdlgs/mvtabdlg.cxx
@@ -70,6 +70,7 @@ ScMoveTableDlg::ScMoveTableDlg(Window* pParent, const 
rtl::OUString& rDefault)
 maStrTabNameInvalid( 
ResId::toString(ScResId(STR_TABNAME_WARN_INVALID)) ),
 //
 maDefaultName( rDefault ),
+mnCurrentDocPos( 0 ),
 nDocument   ( 0 ),
 nTable  ( 0 ),
 bCopyTable  ( false ),
@@ -127,8 +128,13 @@ void ScMoveTableDlg::EnableRenameTable(sal_Bool bFlag)
 void ScMoveTableDlg::ResetRenameInput()
 {
 if (mbEverEdited)
+{
 // Don't reset the name when the sheet name has ever been edited.
+// But check the name, as this is also called for change of copy/move
+// buttons and document listbox selection.
+CheckNewTabName();
 return;
+}
 
 if (!aEdTabName.IsEnabled())
 {
@@ -178,19 +184,15 @@ void ScMoveTableDlg::CheckNewTabName()
 return;
 }
 
-bool   bFound = false;
+bool bMoveInCurrentDoc = (aBtnMove.IsChecked() && IsCurrentDocSelected());
+bool bFound = false;
 sal_uInt16 nLast  = aLbTable.GetEntryCount() - 1;
-for ( sal_uInt16 i=0; i<=nLast; ++i )
+for ( sal_uInt16 i=0; i<=nLast && !bFound; ++i )
 {
 if ( aNewName.equals(aLbTable.GetEntry(i)) )
 {
-if (aBtnMove.IsChecked() &&
-aLbDoc.GetSelectEntryPos() == 0 &&
-maDefaultName.equals(aEdTabName.GetText()))
-
-// Move inside same document, thus same name is allowed.
-bFound = false;
-else
+// Only for move within same document the same name is allowed.
+if (!bMoveInCurrentDoc || !maDefaultName.equals( 
aEdTabName.GetText()))
 bFound = true;
 }
 }
@@ -214,6 +216,11 @@ ScDocument* ScMoveTableDlg::GetSelectedDoc()
 return static_cast(aLbDoc.GetEntryData(nPos));
 }
 
+bool ScMoveTableDlg::IsCurrentDocSelected() const
+{
+return aLbDoc.GetSelectEntryPos() == mnCurrentDocPos;
+}
+
 //
 
 void ScMoveTableDlg::Init()
@@ -254,7 +261,7 @@ void ScMoveTableDlg::InitDocListBox()
 
 if ( pScSh == SfxObjectShell::Current() )
 {
-nSelPos = i;
+mnCurrentDocPos = nSelPos = i;
 aEntryName += sal_Unicode( ' ' );
 aEntryName += String( ScResId( STR_CURRENTDOC ) );
 }
___
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-04-17 Thread Kohei Yoshida
 sc/source/ui/unoobj/datauno.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5920b681eaf2f1203efd5af581827db2e1a81bc8
Author: Takeshi Abe 
Date:   Wed Apr 18 03:38:08 2012 +0900

fdo#46983 Macros: Macro to set filter in Calc does not work with 
.StringValue

this fixed a regression slipped into 
8808d77f199720be596a09084fbc36569ed2f1f1

Signed-off-by: Kohei Yoshida 

diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 3695f14..69252ed 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -1334,7 +1334,7 @@ throw(uno::RuntimeException)
 if (!bByEmpty && !rEntry.GetQueryItems().empty())
 {
 const ScQueryEntry::Item& rItem = rEntry.GetQueryItems().front();
-aField.IsNumeric = !rItem.meType != ScQueryEntry::ByString;
+aField.IsNumeric = rItem.meType != ScQueryEntry::ByString;
 aField.StringValue   = rItem.maString;
 aField.NumericValue  = rItem.mfVal;
 }
___
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-17 Thread Kohei Yoshida
 sc/inc/printopt.hxx  |4 ++--
 sc/inc/viewopti.hxx  |4 ++--
 sc/source/core/tool/printopt.cxx |4 ++--
 sc/source/core/tool/viewopti.cxx |2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 3ef53adf7eb7ea68fe4ba5b8f4fee8a7c6014756
Author: Albert Thuswaldner 
Date:   Sun Apr 15 17:15:20 2012 +0200

Have operators of ScViewOptions and ScPrintOptions return bool instead of 
int

diff --git a/sc/inc/printopt.hxx b/sc/inc/printopt.hxx
index 5883e7c..8e32b7c 100644
--- a/sc/inc/printopt.hxx
+++ b/sc/inc/printopt.hxx
@@ -52,8 +52,8 @@ public:
 voidSetDefaults();
 
 const ScPrintOptions&   operator=  ( const ScPrintOptions& rCpy );
-int operator== ( const ScPrintOptions& rOpt ) const;
-int operator!= ( const ScPrintOptions& rOpt ) const;
+booloperator== ( const ScPrintOptions& rOpt ) const;
+booloperator!= ( const ScPrintOptions& rOpt ) const;
 };
 
 //==
diff --git a/sc/inc/viewopti.hxx b/sc/inc/viewopti.hxx
index 0c763ce..b82f566 100644
--- a/sc/inc/viewopti.hxx
+++ b/sc/inc/viewopti.hxx
@@ -83,8 +83,8 @@ public:
 
 voidSetDefaults();
 const ScGridOptions&operator=  ( const ScGridOptions& rCpy );
-int operator== ( const ScGridOptions& rOpt ) const;
-int operator!= ( const ScGridOptions& rOpt ) const { 
return !(operator==(rOpt)); }
+booloperator== ( const ScGridOptions& rOpt ) const;
+booloperator!= ( const ScGridOptions& rOpt ) const { 
return !(operator==(rOpt)); }
 };
 
 //==
diff --git a/sc/source/core/tool/printopt.cxx b/sc/source/core/tool/printopt.cxx
index 095e594..215989b 100644
--- a/sc/source/core/tool/printopt.cxx
+++ b/sc/source/core/tool/printopt.cxx
@@ -74,13 +74,13 @@ const ScPrintOptions& ScPrintOptions::operator=( const 
ScPrintOptions& rCpy )
 return *this;
 }
 
-int ScPrintOptions::operator==( const ScPrintOptions& rOpt ) const
+bool ScPrintOptions::operator==( const ScPrintOptions& rOpt ) const
 {
 return bSkipEmpty == rOpt.bSkipEmpty
 && bAllSheets == rOpt.bAllSheets;
 }
 
-int ScPrintOptions::operator!=( const ScPrintOptions& rOpt ) const
+bool ScPrintOptions::operator!=( const ScPrintOptions& rOpt ) const
 {
 return !(operator==(rOpt));
 }
diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx
index 7c40d22..b20c57d 100644
--- a/sc/source/core/tool/viewopti.cxx
+++ b/sc/source/core/tool/viewopti.cxx
@@ -105,7 +105,7 @@ const ScGridOptions& ScGridOptions::operator=( const 
ScGridOptions& rCpy )
 
 //
 
-int ScGridOptions::operator==( const ScGridOptions& rCpy ) const
+bool ScGridOptions::operator==( const ScGridOptions& rCpy ) const
 {
 return (   nFldDrawX== rCpy.nFldDrawX
 && nFldDivisionX== rCpy.nFldDivisionX
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-04-17 Thread Kohei Yoshida
 editeng/inc/editeng/editeng.hxx |7 ++
 editeng/inc/editeng/editund2.hxx|1 
 editeng/source/editeng/editeng.cxx  |   20 ++
 editeng/source/editeng/editundo.cxx |   23 ---
 editeng/source/editeng/editundo.hxx |   12 ---
 editeng/source/editeng/editview.cxx |  114 ++--
 editeng/source/editeng/edtspell.cxx |   14 ++--
 editeng/source/editeng/impedit.cxx  |   58 +-
 editeng/source/editeng/impedit.hxx  |   16 ++---
 editeng/source/editeng/impedit2.cxx |2 
 editeng/source/editeng/impedit5.cxx |3 
 editeng/source/editeng/textconv.cxx |   16 ++---
 12 files changed, 144 insertions(+), 142 deletions(-)

New commits:
commit fe4f272a385ee4fe5f541ff37eb710956a0ad38b
Author: Kohei Yoshida 
Date:   Tue Apr 17 14:13:16 2012 -0400

no TYPEINFO for edit undo objects.

diff --git a/editeng/inc/editeng/editund2.hxx b/editeng/inc/editeng/editund2.hxx
index dc465a9..6411da8 100644
--- a/editeng/inc/editeng/editund2.hxx
+++ b/editeng/inc/editeng/editund2.hxx
@@ -57,7 +57,6 @@ private:
 EditEngine* mpEditEngine;
 
 public:
-TYPEINFO();
 EditUndo(sal_uInt16 nI, EditEngine* pEE);
 virtual ~EditUndo();
 
diff --git a/editeng/source/editeng/editundo.cxx 
b/editeng/source/editeng/editundo.cxx
index be05f7d..d44a173 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -42,20 +42,6 @@ DBG_NAME( EditUndo )
 #define NO_UNDO 0x
 #define GROUP_NOTFOUND  0x
 
-TYPEINIT1( EditUndo, SfxUndoAction );
-TYPEINIT1( EditUndoDelContent, EditUndo );
-TYPEINIT1( EditUndoConnectParas, EditUndo );
-TYPEINIT1( EditUndoSplitPara, EditUndo );
-TYPEINIT1( EditUndoInsertChars, EditUndo );
-TYPEINIT1( EditUndoRemoveChars, EditUndo );
-TYPEINIT1( EditUndoInsertFeature, EditUndo );
-TYPEINIT1( EditUndoMoveParagraphs, EditUndo );
-TYPEINIT1( EditUndoSetStyleSheet, EditUndo );
-TYPEINIT1( EditUndoSetParaAttribs, EditUndo );
-TYPEINIT1( EditUndoSetAttribs, EditUndo );
-TYPEINIT1( EditUndoTransliteration, EditUndo );
-TYPEINIT1( EditUndoMarkSelection, EditUndo );
-
 void lcl_DoSetSelection( EditView* pView, sal_uInt16 nPara )
 {
 EPaM aEPaM( nPara, 0 );
@@ -140,12 +126,10 @@ sal_Bool EditUndoManager::Redo()
 EditUndo::EditUndo(sal_uInt16 nI, EditEngine* pEE) :
 nId(nI), mpEditEngine(pEE)
 {
-DBG_CTOR( EditUndo, 0 );
 }
 
 EditUndo::~EditUndo()
 {
-DBG_DTOR( EditUndo, 0 );
 }
 
 EditEngine* EditUndo::GetEditEngine()
@@ -342,10 +326,9 @@ void EditUndoInsertChars::Redo()
 
 sal_Bool EditUndoInsertChars::Merge( SfxUndoAction* pNextAction )
 {
-if ( !pNextAction->ISA( EditUndoInsertChars ) )
-return sal_False;
-
-EditUndoInsertChars* pNext = (EditUndoInsertChars*)pNextAction;
+EditUndoInsertChars* pNext = 
dynamic_cast(pNextAction);
+if (!pNext)
+return false;
 
 if ( aEPaM.nPara != pNext->aEPaM.nPara )
 return sal_False;
diff --git a/editeng/source/editeng/editundo.hxx 
b/editeng/source/editeng/editundo.hxx
index 63b08cf..9358350 100644
--- a/editeng/source/editeng/editundo.hxx
+++ b/editeng/source/editeng/editundo.hxx
@@ -54,7 +54,6 @@ private:
 // undestroyed object!
 
 public:
-TYPEINFO();
 EditUndoDelContent(EditEngine* pEE, ContentNode* pNode, size_t nPortion);
 virtual ~EditUndoDelContent();
 
@@ -82,7 +81,6 @@ private:
 boolbBackward;
 
 public:
-TYPEINFO();
 EditUndoConnectParas(EditEngine* pEE, sal_uInt16 nNode, sal_uInt16 nSepPos,
  const SfxItemSet& rLeftParaAttribs, const SfxItemSet& 
rRightParaAttribs,
  const SfxStyleSheet* pLeftStyle, const SfxStyleSheet* 
pRightStyle, bool bBackward);
@@ -102,7 +100,6 @@ private:
 sal_uInt16  nSepPos;
 
 public:
-TYPEINFO();
 EditUndoSplitPara(EditEngine* pEE, sal_uInt16 nNode, sal_uInt16 nSepPos);
 ~EditUndoSplitPara();
 
@@ -120,7 +117,6 @@ private:
 String  aText;
 
 public:
-TYPEINFO();
 EditUndoInsertChars(EditEngine* pEE, const EPaM& rEPaM, const String& 
rStr);
 
 const EPaM& GetEPaM() { return aEPaM; }
@@ -142,7 +138,6 @@ private:
 String  aText;
 
 public:
-TYPEINFO();
 EditUndoRemoveChars(EditEngine* pEE, const EPaM& rEPaM, const String& 
rStr);
 
 const EPaM& GetEPaM() { return aEPaM; }
@@ -162,7 +157,6 @@ private:
 SfxPoolItem*pFeature;
 
 public:
-TYPEINFO();
 EditUndoInsertFeature(EditEngine* pEE, const EPaM& rEPaM, const 
SfxPoolItem& rFeature);
 virtual ~EditUndoInsertFeature();
 
@@ -180,7 +174,6 @@ private:
 sal_uInt16  nDest;
 
 public:
-TYPEINFO();
 EditUndoMoveParagraphs(EditEngine* pEE, const Range& rParas, sal_uInt16 
nDest);
 virtual ~EditUndoMoveParagraphs();
 
@@ -202,7 +195,6 @@ private:
 SfxItemSet  aPrevParaAttribs;
 
 public:
-TYPEINFO();
 EditUndoSetStyleSheet(EditEn

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

2012-04-17 Thread Kohei Yoshida
 editeng/inc/editeng/editeng.hxx |   20 ++
 editeng/inc/editeng/editund2.hxx|   11 -
 editeng/source/editeng/editeng.cxx  |   55 ++
 editeng/source/editeng/editundo.cxx |  295 
 editeng/source/editeng/editundo.hxx |   84 +-
 editeng/source/editeng/impedit.hxx  |5 
 editeng/source/editeng/impedit2.cxx |   22 +-
 editeng/source/editeng/impedit4.cxx |2 
 editeng/source/editeng/impedit5.cxx |   12 -
 9 files changed, 271 insertions(+), 235 deletions(-)

New commits:
commit 56ef4ea05520115dc5db6bf861dca80a20a76775
Author: Kohei Yoshida 
Date:   Tue Apr 17 12:12:43 2012 -0400

Removed all references to ImpEditEngine from all of edit undo classes.

diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx
index 523addf..5cbad78 100644
--- a/editeng/inc/editeng/editeng.hxx
+++ b/editeng/inc/editeng/editeng.hxx
@@ -132,6 +132,9 @@ class EDITENG_DLLPUBLIC EditEngine
 friend class EditDbg;
 friend class Outliner;
 
+public:
+typedef std::vector ViewsType;
+
 private:
 ImpEditEngine*  pImpEditEngine;
 
@@ -214,6 +217,7 @@ public:
 size_t  GetViewCount() const;
 sal_BoolHasView( EditView* pView ) const;
 EditView*   GetActiveView() const;
+void SetActiveView(EditView* pView);
 
 voidSetPaperSize( const Size& rSize );
 const Size& GetPaperSize() const;
@@ -572,6 +576,12 @@ public:
 
 void RemoveCharAttribs(sal_uInt16 nPara, sal_uInt16 nWhich = 0, bool 
bRemoveFeatures = false);
 void RemoveCharAttribs(const EditSelection& rSel, bool bRemoveParaAttribs, 
sal_uInt16 nWhich = 0);
+
+ViewsType& GetEditViews();
+const ViewsType& GetEditViews() const;
+
+void SetUndoMode(bool b);
+void FormatAndUpdate(EditView* pCurView = NULL);
 };
 
 #endif // _MyEDITENG_HXX
diff --git a/editeng/inc/editeng/editund2.hxx b/editeng/inc/editeng/editund2.hxx
index 85ad570..dc465a9 100644
--- a/editeng/inc/editeng/editund2.hxx
+++ b/editeng/inc/editeng/editund2.hxx
@@ -33,17 +33,15 @@
 #include 
 
 class EditEngine;
-class ImpEditEngine;
 
 class EDITENG_DLLPRIVATE EditUndoManager : public SfxUndoManager
 {
 using SfxUndoManager::Undo;
 using SfxUndoManager::Redo;
 
-private:
-ImpEditEngine*  pImpEE;
+EditEngine* mpEditEngine;
 public:
-EditUndoManager( ImpEditEngine* pImpEE );
+EditUndoManager(EditEngine* pEE);
 
 virtual sal_Bool Undo();
 virtual sal_Bool Redo();
@@ -56,15 +54,14 @@ class EDITENG_DLLPUBLIC EditUndo : public SfxUndoAction
 {
 private:
 sal_uInt16  nId;
-ImpEditEngine* mpEditEngine;
+EditEngine* mpEditEngine;
 
 public:
 TYPEINFO();
-EditUndo(sal_uInt16 nI, ImpEditEngine* pEE);
+EditUndo(sal_uInt16 nI, EditEngine* pEE);
 virtual ~EditUndo();
 
 EditEngine* GetEditEngine();
-ImpEditEngine* GetImpEditEngine();
 
 virtual voidUndo()  = 0;
 virtual voidRedo()  = 0;
diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index 2f9e901..8314387 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -421,6 +421,11 @@ EditView* EditEngine::GetActiveView() const
 return pImpEditEngine->GetActiveView();
 }
 
+void EditEngine::SetActiveView(EditView* pView)
+{
+pImpEditEngine->SetActiveView(pView);
+}
+
 void EditEngine::SetDefTab( sal_uInt16 nDefTab )
 {
 DBG_CHKTHIS( EditEngine, 0 );
@@ -807,6 +812,26 @@ void EditEngine::RemoveCharAttribs(const EditSelection& 
rSel, bool bRemoveParaAt
 pImpEditEngine->RemoveCharAttribs(rSel, bRemoveParaAttribs, nWhich);
 }
 
+EditEngine::ViewsType& EditEngine::GetEditViews()
+{
+return pImpEditEngine->GetEditViews();
+}
+
+const EditEngine::ViewsType& EditEngine::GetEditViews() const
+{
+return pImpEditEngine->GetEditViews();
+}
+
+void EditEngine::SetUndoMode(bool b)
+{
+pImpEditEngine->SetUndoMode(b);
+}
+
+void EditEngine::FormatAndUpdate(EditView* pCurView)
+{
+pImpEditEngine->FormatAndUpdate(pCurView);
+}
+
 uno::Reference 
EditEngine::CreateTransferable(const EditSelection& rSelection)
 {
 return pImpEditEngine->CreateTransferable(rSelection);
diff --git a/editeng/source/editeng/editundo.cxx 
b/editeng/source/editeng/editundo.cxx
index ebbc6e9..be05f7d 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -65,22 +65,19 @@ void lcl_DoSetSelection( EditView* pView, sal_uInt16 nPara )
 pView->GetImpEditView()->SetEditSelection( aSel );
 }
 
-EditUndoManager::EditUndoManager( ImpEditEngine* p )
-{
-pImpEE = p;
-}
+EditUndoManager::EditUndoManager(EditEngine* pEE) : mpEditEngine(pEE) {}
 
 sal_Bool EditUndoManager::Undo()
 {
 if ( GetUndoActionCount() == 0 )
 return sal_False;
 
-DBG_ASSERT( pImpEE->GetActiveView(), "Active View?" );
+DBG_ASSERT( mpEd

[Libreoffice-commits] .: 8 commits - editeng/inc editeng/source

2012-04-16 Thread Kohei Yoshida
 editeng/inc/editeng/editeng.hxx |   19 +++
 editeng/inc/editeng/editund2.hxx|   12 +-
 editeng/source/editeng/editeng.cxx  |   75 +--
 editeng/source/editeng/editundo.cxx |  174 ++--
 editeng/source/editeng/editundo.hxx |   10 +-
 editeng/source/editeng/impedit.hxx  |   14 --
 6 files changed, 189 insertions(+), 115 deletions(-)

New commits:
commit 620ca8c527fb77334bdb29eb4d00e8102b731bde
Author: Kohei Yoshida 
Date:   Mon Apr 16 23:48:35 2012 -0400

Remove the last undo friend from ImpEditEngine.

diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx
index a239b9f..043776b 100644
--- a/editeng/inc/editeng/editeng.hxx
+++ b/editeng/inc/editeng/editeng.hxx
@@ -564,6 +564,8 @@ public:
 EditPaM ConnectContents(sal_uInt16 nLeftNode, bool bBackward);
 
 EditPaM InsertFeature(const EditSelection& rEditSelection, const 
SfxPoolItem& rItem);
+
+EditSelection MoveParagraphs(const Range& rParagraphs, sal_uInt16 nNewPos, 
EditView* pCurView);
 };
 
 #endif // _MyEDITENG_HXX
diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index 4a1fa61..81ad880 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -787,6 +787,11 @@ EditPaM EditEngine::InsertFeature(const EditSelection& 
rEditSelection, const Sfx
 return pImpEditEngine->ImpInsertFeature(rEditSelection, rItem);
 }
 
+EditSelection EditEngine::MoveParagraphs(const Range& rParagraphs, sal_uInt16 
nNewPos, EditView* pCurView)
+{
+return pImpEditEngine->MoveParagraphs(rParagraphs, nNewPos, pCurView);
+}
+
 uno::Reference 
EditEngine::CreateTransferable(const EditSelection& rSelection)
 {
 return pImpEditEngine->CreateTransferable(rSelection);
diff --git a/editeng/source/editeng/editundo.cxx 
b/editeng/source/editeng/editundo.cxx
index 9c370d1..067d84f 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -448,7 +448,7 @@ EditUndoMoveParagraphs::~EditUndoMoveParagraphs()
 
 void EditUndoMoveParagraphs::Undo()
 {
-DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active 
View!" );
+DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" 
);
 Range aTmpRange( nParagraphs );
 long nTmpDest = aTmpRange.Min();
 
@@ -465,15 +465,15 @@ void EditUndoMoveParagraphs::Undo()
 else
 nTmpDest += aTmpRange.Len();
 
-EditSelection aNewSel( GetImpEditEngine()->MoveParagraphs( aTmpRange, 
(sal_uInt16)nTmpDest, 0 ) );
-GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( 
aNewSel );
+EditSelection aNewSel = GetEditEngine()->MoveParagraphs(aTmpRange, 
(sal_uInt16)nTmpDest, 0);
+GetEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( 
aNewSel );
 }
 
 void EditUndoMoveParagraphs::Redo()
 {
-DBG_ASSERT( GetImpEditEngine()->GetActiveView(), "Undo/Redo: No Active 
View!" );
-EditSelection aNewSel( GetImpEditEngine()->MoveParagraphs( nParagraphs, 
nDest, 0 ) );
-GetImpEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( 
aNewSel );
+DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" 
);
+EditSelection aNewSel = GetEditEngine()->MoveParagraphs(nParagraphs, 
nDest, 0);
+GetEditEngine()->GetActiveView()->GetImpEditView()->SetEditSelection( 
aNewSel );
 }
 
 EditUndoSetStyleSheet::EditUndoSetStyleSheet( ImpEditEngine* _pImpEE, 
sal_uInt16 nP,
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 6e0ebb7..6b013bc 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -380,12 +380,8 @@ public:
 
 class ImpEditEngine : public SfxListener, boost::noncopyable
 {
-// The Undos have to manipulate directly ( private-Methods ),
-// do that no new Undo is inserted!
-friend class EditUndoMoveParagraphs;
-
-friend class EditEngine;// For access to Imp-Methods
-friend class EditDbg;   // Debug Routines
+friend class EditEngine;
+    friend class EditDbg;
 
 public:
 typedef std::vector ViewsType;
commit ba644a0947a91bba7ccb62fe6e1ae85f0ee30041
Author: Kohei Yoshida 
Date:   Mon Apr 16 23:44:29 2012 -0400

EditUndoSplitPara

diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx
index 5dfddf7..a239b9f 100644
--- a/editeng/inc/editeng/editeng.hxx
+++ b/editeng/inc/editeng/editeng.hxx
@@ -562,6 +562,8 @@ public:
 void InsertContent(ContentNode* pNode, sal_uInt16 nPos);
 EditPaM SplitContent(sal_uInt16 nNode, sal_uInt16 nSepPos);
 EditPaM ConnectContents(sal_uInt16 nLeftNode, bool bBackward);
+
+EditPaM InsertFeature(const EditSelection& rEditSelection, const 
SfxPoolItem& rItem);
 };
 
 #endif // _MyEDITENG_HXX
diff --git a/ed

[Libreoffice-commits] .: sc/source

2012-04-16 Thread Kohei Yoshida
 sc/source/ui/inc/output.hxx   |2 -
 sc/source/ui/view/output2.cxx |   59 --
 2 files changed, 35 insertions(+), 26 deletions(-)

New commits:
commit e57525b61af70a6ee33c26f979e724740cca8655
Author: Kohei Yoshida 
Date:   Mon Apr 16 22:02:12 2012 -0400

fdo#48431: More reliable way to check for RTL text.

This is probably more reliable way to fix fdo#32530 such that it won't
cause the regression in rendering Thai texts as reported in fdo#48431.

diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx
index f9a14a7..8a3dc2c 100644
--- a/sc/source/ui/inc/output.hxx
+++ b/sc/source/ui/inc/output.hxx
@@ -102,12 +102,12 @@ private:
 longmnPosX;
 longmnPosY;
 longmnInitPosX;
-sal_uInt8   mnScript;
 boolmbBreak;
 boolmbCellIsValue;
 boolmbAsianVertical;
 boolmbPixelToLogic;
 boolmbHyphenatorSet;
+boolmbRTL;
 ScFieldEditEngine*  mpEngine;
 ScBaseCell* mpCell;
 const ScPatternAttr*mpPattern;
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 7913a09..2b99bb8 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -70,10 +70,14 @@
 #include "scmod.hxx"
 #include "fillinfo.hxx"
 
+#include 
+
 #include 
 
 #include 
 
+using namespace com::sun::star;
+
 //! Autofilter-Breite mit column.cxx zusammenfassen
 #define DROPDOWN_BITMAP_SIZE18
 
@@ -1329,6 +1333,29 @@ void ScOutputData::GetOutputArea( SCCOL nX, SCSIZE 
nArrY, long nPosX, long nPosY
 rParam.maClipRect.Justify();
 }
 
+namespace {
+
+bool beginsWithRTLCharacter(const rtl::OUString& rStr)
+{
+if (rStr.isEmpty())
+return false;
+
+switch (ScGlobal::pCharClass->getCharacterDirection(rStr, 0))
+{
+case i18n::DirectionProperty_RIGHT_TO_LEFT:
+case i18n::DirectionProperty_RIGHT_TO_LEFT_ARABIC:
+case i18n::DirectionProperty_RIGHT_TO_LEFT_EMBEDDING:
+case i18n::DirectionProperty_RIGHT_TO_LEFT_OVERRIDE:
+return true;
+default:
+;
+}
+
+return false;
+}
+
+}
+
 void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
 {
 OSL_ENSURE( pDev == pRefDevice ||
@@ -1563,18 +1590,8 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic )
 if (aVars.GetHorJust() == SVX_HOR_JUSTIFY_STANDARD)
 {
 // fdo#32530: Default alignment depends on value vs
-// string, and the script type of the 1st letter.
-sal_uInt8 nScript1st = 0;
-rtl::OUString aStr = aVars.GetString();
-if (!aStr.isEmpty())
-{
-aStr = aStr.copy(0, 1);
-nScript1st = pDoc->GetStringScriptType(aStr);
-if (!nScript1st)
-nScript1st = ScGlobal::GetDefaultScriptType();
-}
-
-if (nScript1st == SCRIPTTYPE_COMPLEX)
+// string, and the direction of the 1st letter.
+if (beginsWithRTLCharacter(aVars.GetString()))
 eOutHorJust = bCellIsValue ? SVX_HOR_JUSTIFY_LEFT 
: SVX_HOR_JUSTIFY_RIGHT;
 else
 eOutHorJust = bCellIsValue ? SVX_HOR_JUSTIFY_RIGHT 
: SVX_HOR_JUSTIFY_LEFT;
@@ -2154,12 +2171,12 @@ ScOutputData::DrawEditParam::DrawEditParam(const 
ScPatternAttr* pPattern, const
 mnArrY(0),
 mnX(0), mnY(0), mnCellX(0), mnCellY(0),
 mnPosX(0), mnPosY(0), mnInitPosX(0),
-mnScript(0),
 mbBreak( (meHorJust == SVX_HOR_JUSTIFY_BLOCK) || 
lcl_GetBoolValue(*pPattern, ATTR_LINEBREAK, pCondSet) ),
 mbCellIsValue(bCellIsValue),
 mbAsianVertical(false),
 mbPixelToLogic(false),
 mbHyphenatorSet(false),
+mbRTL(false),
 mpEngine(NULL),
 mpCell(NULL),
 mpPattern(pPattern),
@@ -2580,8 +2597,8 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam)
 if (eOutHorJust == SVX_HOR_JUSTIFY_STANDARD)
 {
 // fdo#32530: Default alignment depends on value vs string, and the
-// script type of the 1st letter.
-if (rParam.mnScript == SCRIPTTYPE_COMPLEX)
+// direction of the 1st letter.
+if (rParam.mbRTL)
 eOutHorJust = rParam.mbCellIsValue ? SVX_HOR_JUSTIFY_LEFT : 
SVX_HOR_JUSTIFY_RIGHT;
 else
 eOutHorJust = rParam.mbCellIsValue ? SVX_HOR_JUSTIFY_RIGHT : 
SVX_HOR_JUSTIFY_LEFT;
@@ -4586,20 +4603,13 @@ void ScOutputData::DrawEdit(sal_Bool bPixe

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

2012-04-13 Thread Kohei Yoshida
 editeng/inc/editeng/editeng.hxx|1 +
 editeng/source/editeng/editeng.cxx |5 +
 editeng/source/editeng/impedit.cxx |2 +-
 3 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 89de9dfe27d6a406fb67570c3507a8ea2e387d24
Author: Kohei Yoshida 
Date:   Sat Apr 14 02:03:46 2012 -0400

Really fix the build.

diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx
index f3be3d2..8cdc6ef 100644
--- a/editeng/inc/editeng/editeng.hxx
+++ b/editeng/inc/editeng/editeng.hxx
@@ -139,6 +139,7 @@ private:
 
 EDITENG_DLLPRIVATE void CursorMoved(ContentNode* pPrevNode);
 EDITENG_DLLPRIVATE void CheckIdleFormatter();
+EDITENG_DLLPRIVATE bool IsIdleFormatterActive() const;
 EDITENG_DLLPRIVATE ParaPortion* FindParaPortion(ContentNode* pNode);
 EDITENG_DLLPRIVATE const ParaPortion* FindParaPortion(ContentNode* pNode) 
const;
 EDITENG_DLLPRIVATE const ParaPortion* GetPrevVisPortion(const ParaPortion* 
pCurPortion) const;
diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index 0adfec1..3410fba 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -702,6 +702,11 @@ void EditEngine::CheckIdleFormatter()
 pImpEditEngine->CheckIdleFormatter();
 }
 
+bool EditEngine::IsIdleFormatterActive() const
+{
+return pImpEditEngine->aIdleFormatter.IsActive();
+}
+
 ParaPortion* EditEngine::FindParaPortion(ContentNode* pNode)
 {
 return pImpEditEngine->FindParaPortion(pNode);
diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 81edb23..3b31282 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -174,7 +174,7 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, 
Region* pRegion )
 pOutWin->GetCursor()->Hide();
 }
 
-DBG_ASSERT( !pEditEngine->aIdleFormatter.IsActive(), "DrawSelection: Not 
formatted!" );
+DBG_ASSERT( !pEditEngine->IsIdleFormatterActive(), "DrawSelection: Not 
formatted!" );
 aTmpSel.Adjust( pEditEngine->pImpEditEngine->GetEditDoc() );
 
 ContentNode* pStartNode = aTmpSel.Min().GetNode();
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: editeng/source

2012-04-13 Thread Kohei Yoshida
 editeng/source/editeng/impedit.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 5d66587d7931c6a41107969f5d0942d880ce0943
Author: Kohei Yoshida 
Date:   Sat Apr 14 01:12:42 2012 -0400

Keep tinderbox happy.

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 355564d..81edb23 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -174,7 +174,7 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, 
Region* pRegion )
 pOutWin->GetCursor()->Hide();
 }
 
-DBG_ASSERT( !pEditEngine->pImpEditEngine->aIdleFormatter.IsActive(), 
"DrawSelection: Not formatted!" );
+DBG_ASSERT( !pEditEngine->aIdleFormatter.IsActive(), "DrawSelection: Not 
formatted!" );
 aTmpSel.Adjust( pEditEngine->pImpEditEngine->GetEditDoc() );
 
 ContentNode* pStartNode = aTmpSel.Min().GetNode();
@@ -1663,11 +1663,11 @@ void ImpEditView::dragDropEnd( const 
::com::sun::star::datatransfer::dnd::DragSo
 
 DrawSelection();
 EditSelection aDelSel( pEditEngine->pImpEditEngine->CreateSel( 
aToBeDelSel ) );
-DBG_ASSERT( !aDelSel.DbgIsBuggy( 
pEditEngine->pImpEditEngine->aEditDoc ), "ToBeDel is buggy!" );
+DBG_ASSERT( !aDelSel.DbgIsBuggy( pEditEngine->GetEditDoc() ), 
"ToBeDel is buggy!" );
 pEditEngine->DeleteSelection(aDelSel);
 if ( !bBeforeSelection )
 {
-DBG_ASSERT( !pEditEngine->pImpEditEngine->CreateSel( 
aNewSel ).DbgIsBuggy(pEditEngine->pImpEditEngine->aEditDoc), "Bad" );
+DBG_ASSERT( !pEditEngine->pImpEditEngine->CreateSel( 
aNewSel ).DbgIsBuggy(pEditEngine->GetEditDoc()), "Bad" );
 SetEditSelection( pEditEngine->pImpEditEngine->CreateSel( 
aNewSel ) );
 }
 pEditEngine->pImpEditEngine->FormatAndUpdate( 
pEditEngine->pImpEditEngine->GetActiveView() );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-04-13 Thread Kohei Yoshida
 sc/Library_sc.mk|1 
 sc/inc/defaultsoptions.hxx  |  104 +++
 sc/inc/docoptio.hxx |   17 --
 sc/inc/sc.hrc   |1 
 sc/inc/scmod.hxx|5 
 sc/source/core/data/document.cxx|   14 +-
 sc/source/core/tool/defaultsoptions.cxx |  209 
 sc/source/core/tool/docoptio.cxx|   78 ---
 sc/source/ui/app/scmod.cxx  |   34 +
 sc/source/ui/inc/tpdefaults.hxx |   15 --
 sc/source/ui/optdlg/tpdefaults.cxx  |   47 +++
 sc/source/ui/view/tabvwsh4.cxx  |6 
 12 files changed, 397 insertions(+), 134 deletions(-)

New commits:
commit be7cbf49c4fa586bd6ec96c2d278a317894f569c
Author: Albert Thuswaldner 
Date:   Thu Apr 12 21:20:58 2012 +0200

Moved ScDefaultsOptions from ScDocOptions to separate class

diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index f640f05..ba6c340 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -171,6 +171,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/core/tool/consoli  \
sc/source/core/tool/dbdata \
sc/source/core/tool/ddelink \
+   sc/source/core/tool/defaultsoptions \
sc/source/core/tool/detdata  \
sc/source/core/tool/detfunc \
sc/source/core/tool/docoptio \
diff --git a/sc/inc/defaultsoptions.hxx b/sc/inc/defaultsoptions.hxx
new file mode 100644
index 000..a1e74f8
--- /dev/null
+++ b/sc/inc/defaultsoptions.hxx
@@ -0,0 +1,104 @@
+/* -*- 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. 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.
+ *
+ * The Initial Developer of the Original Code is
+ *   Albert Thuswaldner 
+ * Portions created by the Initial Developer are Copyright (C) 2012 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * 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.
+ */
+
+#ifndef SC_DEFAULTSOPT_HXX
+#define SC_DEFAULTSOPT_HXX
+
+#include 
+#include 
+#include "formula/grammar.hxx"
+#include "scdllapi.h"
+#include "global.hxx"
+
+class SC_DLLPUBLIC ScDefaultsOptions
+{
+private:
+SCTAB nInitTabCount; // number of Tabs for new Spreadsheet doc
+::rtl::OUString aInitTabPrefix;  // The Tab prefix name in new Spreadsheet 
doc
+
+
+public:
+ScDefaultsOptions();
+ScDefaultsOptions( const ScDefaultsOptions& rCpy );
+~ScDefaultsOptions();
+
+void SetDefaults();
+
+SCTAB GetInitTabCount() const   { return nInitTabCount; }
+void   SetInitTabCount( SCTAB nTabs) { nInitTabCount = nTabs; }
+void   SetInitTabPrefix(const rtl::OUString& aPrefix) { aInitTabPrefix = 
aPrefix; }
+::rtl::OUString GetInitTabPrefix() const { return aInitTabPrefix; }
+
+ScDefaultsOptions&  operator=  ( const ScDefaultsOptions& rCpy );
+booloperator== ( const ScDefaultsOptions& rOpt ) const;
+booloperator!= ( const ScDefaultsOptions& rOpt ) const;
+
+};
+
+//==
+// item for the dialog / options page
+//==
+
+class SC_DLLPUBLIC ScTpDefaultsItem : public SfxPoolItem
+{
+public:
+TYPEINFO();
+ScTpDefaultsItem( sal_uInt16 nWhich,
+   const ScDefaultsOptions& rOpt );
+ScTpDefaultsItem( const ScTpDefaultsItem& rItem );
+~ScTpDefaultsItem();
+
+virtual String  GetValueText() const;
+virtual int operator==( const SfxPoolItem& ) const;
+virtual SfxPoolItem*Clone( SfxItemPool *pPool = 0 ) const;
+
+const ScDefaultsOptions& GetDefaultsOptions() const { return theOptions; }
+
+private:
+ScDefaultsOptions theOptions;
+};
+
+//==
+// config item
+//==
+
+class ScDefaultsCfg : public ScDefaultsOptions, public utl::ConfigItem
+{
+com::sun::star::uno::Sequence GetPropertyNames();
+public:
+ScDefaultsCfg();
+
+void SetOptions( const ScDefaultsOptions& rNew );
+
+virtual void Commit

[Libreoffice-commits] .: editeng/inc editeng/qa sc/qa test/Library_test.mk test/source

2012-04-11 Thread Kohei Yoshida
 editeng/inc/editeng/eerdll.hxx   |2 +-
 editeng/qa/unit/core-test.cxx|2 --
 sc/qa/unit/ucalc.cxx |1 -
 test/Library_test.mk |1 +
 test/source/bootstrapfixture.cxx |2 ++
 5 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 5b14929dd4f659420c5707b7c432fb9337cfff1d
Author: Kohei Yoshida 
Date:   Thu Apr 12 00:53:55 2012 -0400

Handle the correct deletion order of EditDLL in the base class.

Turns out that this change affected all cppunit runs.

diff --git a/editeng/inc/editeng/eerdll.hxx b/editeng/inc/editeng/eerdll.hxx
index 226aefe..5fd9896 100644
--- a/editeng/inc/editeng/eerdll.hxx
+++ b/editeng/inc/editeng/eerdll.hxx
@@ -53,7 +53,7 @@ public:
 ResMgr* GetResMgr() const   { return pResMgr; }
 GlobalEditData* GetGlobalData() const   { return pGlobalData; }
 static EditDLL& Get();
-static void Release();
+EDITENG_DLLPUBLIC static void Release();
 };
 
 #define EE_DLL() EditDLL::Get()
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index 1e83599..fc5828f 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -74,8 +74,6 @@ void Test::setUp()
 void Test::tearDown()
 {
 SfxItemPool::Free(mpItemPool);
-EditDLL::Release();
-
 test::BootstrapFixture::tearDown();
 }
 
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 8f15b8d..130ad67 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -303,7 +303,6 @@ void Test::setUp()
 void Test::tearDown()
 {
 m_xDocShRef.Clear();
-
 BootstrapFixture::tearDown();
 }
 
diff --git a/test/Library_test.mk b/test/Library_test.mk
index 571d26c..f66e101 100644
--- a/test/Library_test.mk
+++ b/test/Library_test.mk
@@ -42,6 +42,7 @@ $(eval $(call gb_Library_use_libraries,test,\
 comphelper \
 cppu \
 cppuhelper \
+editeng \
i18nisolang1 \
 sal \
tl \
diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx
index 284dbf7..f4b8139 100644
--- a/test/source/bootstrapfixture.cxx
+++ b/test/source/bootstrapfixture.cxx
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 
@@ -107,6 +108,7 @@ void test::BootstrapFixture::setUp()
 void test::BootstrapFixture::tearDown()
 {
 ucbhelper::ContentBroker::deinitialize();
+EditDLL::Release();
 test::BootstrapFixtureBase::tearDown();
 }
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: editeng/qa

2012-04-11 Thread Kohei Yoshida
 editeng/qa/unit/core-test.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit c0de63a858ee02bba2a9154b239085a64a277999
Author: Kohei Yoshida 
Date:   Wed Apr 11 23:42:19 2012 -0400

Remove the TODO comment that's no longer relevant.

diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index 49a6efb..1e83599 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -83,7 +83,6 @@ void Test::testConstruction()
 {
 EditEngine aEngine(mpItemPool);
 
-// TODO: This currently causes segfault in vcl.
 rtl::OUString aParaText = "I am Edit Engine.";
 aEngine.SetText(aParaText);
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: editeng/inc editeng/qa editeng/source

2012-04-11 Thread Kohei Yoshida
 editeng/inc/editeng/eerdll.hxx|1 +
 editeng/qa/unit/core-test.cxx |5 +++--
 editeng/source/editeng/eerdll.cxx |   19 ++-
 3 files changed, 18 insertions(+), 7 deletions(-)

New commits:
commit b5800fac1d57b80772823bd8bc288a6cebe82e6f
Author: Kohei Yoshida 
Date:   Wed Apr 11 23:29:01 2012 -0400

We need to delete EditDLL before de-initialize vcl to avoid crash.

Without manually releasing the EditDLL singleton instance, it gets
deleted *after* the cppunit does its cleanup, which de-initializes VCL.
The problem is, when the EditDLL instance is destroyed, its member
GlobalEditData instance deletes the OutputDevice instance that it owns,
which in turn accesses font caches in VCL.  But by the time we reach
that point, VCL is already de-initialized, hence the problem.

diff --git a/editeng/inc/editeng/eerdll.hxx b/editeng/inc/editeng/eerdll.hxx
index 00094cf..226aefe 100644
--- a/editeng/inc/editeng/eerdll.hxx
+++ b/editeng/inc/editeng/eerdll.hxx
@@ -53,6 +53,7 @@ public:
 ResMgr* GetResMgr() const   { return pResMgr; }
 GlobalEditData* GetGlobalData() const   { return pGlobalData; }
 static EditDLL& Get();
+static void Release();
 };
 
 #define EE_DLL() EditDLL::Get()
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index b8e3111..49a6efb 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -74,6 +74,7 @@ void Test::setUp()
 void Test::tearDown()
 {
 SfxItemPool::Free(mpItemPool);
+EditDLL::Release();
 
 test::BootstrapFixture::tearDown();
 }
@@ -83,8 +84,8 @@ void Test::testConstruction()
 EditEngine aEngine(mpItemPool);
 
 // TODO: This currently causes segfault in vcl.
-//  rtl::OUString aParaText = "I am Edit Engine.";
-//  aEngine.SetText(aParaText);
+rtl::OUString aParaText = "I am Edit Engine.";
+aEngine.SetText(aParaText);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
diff --git a/editeng/source/editeng/eerdll.cxx 
b/editeng/source/editeng/eerdll.cxx
index 1e0f3e4..ccec18e 100644
--- a/editeng/source/editeng/eerdll.cxx
+++ b/editeng/source/editeng/eerdll.cxx
@@ -72,18 +72,27 @@
 #include 
 #include 
 #include 
-#include 
+
+#include 
 
 using namespace ::com::sun::star;
 
-namespace
-{
-class theEditDLL : public rtl::Static {};
+namespace {
+
+boost::scoped_ptr pDLL;
+
 }
 
 EditDLL& EditDLL::Get()
 {
-return theEditDLL::get();
+if (!pDLL)
+pDLL.reset(new EditDLL);
+return *pDLL;
+}
+
+void EditDLL::Release()
+{
+pDLL.reset();
 }
 
 GlobalEditData::GlobalEditData()
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: editeng/CppunitTest_editeng_core.mk editeng/qa

2012-04-11 Thread Kohei Yoshida
 editeng/CppunitTest_editeng_core.mk |1 -
 editeng/qa/unit/core-test.cxx   |   30 ++
 2 files changed, 26 insertions(+), 5 deletions(-)

New commits:
commit a9448bd1b7b64eff74198ead63154ae132ed853b
Author: Kohei Yoshida 
Date:   Wed Apr 11 21:53:33 2012 -0400

Avoid duplicate symbols & use setUp() and tearDown() for the item pool.

diff --git a/editeng/CppunitTest_editeng_core.mk 
b/editeng/CppunitTest_editeng_core.mk
index c94ff95..90117c8 100644
--- a/editeng/CppunitTest_editeng_core.mk
+++ b/editeng/CppunitTest_editeng_core.mk
@@ -42,7 +42,6 @@ $(eval $(call gb_CppunitTest_use_libraries,editeng_core, \
 comphelper \
 cppu \
 cppuhelper \
-editeng \
 i18nisolang1 \
 i18nutil \
 lng \
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index e5c556f..b8e3111 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -49,20 +49,42 @@ class Test : public test::BootstrapFixture
 public:
 Test();
 
+virtual void setUp();
+virtual void tearDown();
+
 void testConstruction();
 
 CPPUNIT_TEST_SUITE(Test);
 CPPUNIT_TEST(testConstruction);
 CPPUNIT_TEST_SUITE_END();
+
+private:
+EditEngineItemPool* mpItemPool;
 };
 
-Test::Test() {}
+Test::Test() : mpItemPool(NULL) {}
+
+void Test::setUp()
+{
+test::BootstrapFixture::setUp();
+
+mpItemPool = new EditEngineItemPool(true);
+}
+
+void Test::tearDown()
+{
+SfxItemPool::Free(mpItemPool);
+
+test::BootstrapFixture::tearDown();
+}
 
 void Test::testConstruction()
 {
-EditEngineItemPool* pPool = new EditEngineItemPool(true);
-EditEngine aEngine(pPool);
-SfxItemPool::Free(pPool);
+EditEngine aEngine(mpItemPool);
+
+// TODO: This currently causes segfault in vcl.
+//  rtl::OUString aParaText = "I am Edit Engine.";
+//  aEngine.SetText(aParaText);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: editeng/qa editeng/source

2012-04-11 Thread Kohei Yoshida
 editeng/qa/unit/core-test.cxx  |   73 ++---
 editeng/source/editeng/editdoc.hxx |4 +-
 2 files changed, 6 insertions(+), 71 deletions(-)

New commits:
commit 1bcd2c94930c95c1807c6112559f5b0041aeb4fa
Author: Kohei Yoshida 
Date:   Wed Apr 11 21:27:34 2012 -0400

Just use the internal item pool already written for the edit engine.

diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index 66707fa..e5c556f 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -40,75 +40,10 @@
 #include "editeng/editeng.hxx"
 #include "editeng/eeitem.hxx"
 #include "editeng/editids.hrc"
+#include "editeng/editdoc.hxx"
 
 namespace {
 
-const SfxItemInfo aItemInfos[] = {
-{ SID_ATTR_FRAMEDIRECTION, SFX_ITEM_POOLABLE }, // 
EE_PARA_WRITINGDIR
-{ 0, SFX_ITEM_POOLABLE },   // 
EE_PARA_XMLATTRIBS
-{ SID_ATTR_PARA_HANGPUNCTUATION, SFX_ITEM_POOLABLE },   // 
EE_PARA_HANGINGPUNCTUATION
-{ SID_ATTR_PARA_FORBIDDEN_RULES, SFX_ITEM_POOLABLE },
-{ SID_ATTR_PARA_SCRIPTSPACE, SFX_ITEM_POOLABLE },   // 
EE_PARA_ASIANCJKSPACING
-{ SID_ATTR_NUMBERING_RULE, SFX_ITEM_POOLABLE }, // EE_PARA_NUMBULL
-{ 0, SFX_ITEM_POOLABLE },   // 
EE_PARA_HYPHENATE
-{ 0, SFX_ITEM_POOLABLE },   // 
EE_PARA_BULLETSTATE
-{ 0, SFX_ITEM_POOLABLE },   // 
EE_PARA_OUTLLRSPACE
-{ SID_ATTR_PARA_OUTLLEVEL, SFX_ITEM_POOLABLE }, // 
EE_PARA_OUTLLEVEL
-{ SID_ATTR_PARA_BULLET, SFX_ITEM_POOLABLE },// EE_PARA_BULLET
-{ SID_ATTR_LRSPACE, SFX_ITEM_POOLABLE },// EE_PARA_LRSPACE
-{ SID_ATTR_ULSPACE, SFX_ITEM_POOLABLE },// EE_PARA_ULSPACE
-{ SID_ATTR_PARA_LINESPACE, SFX_ITEM_POOLABLE }, // EE_PARA_SBL
-{ SID_ATTR_PARA_ADJUST, SFX_ITEM_POOLABLE },// EE_PARA_JUST
-{ SID_ATTR_TABSTOP, SFX_ITEM_POOLABLE },// EE_PARA_TABS
-{ SID_ATTR_ALIGN_HOR_JUSTIFY_METHOD, SFX_ITEM_POOLABLE }, // 
EE_PARA_JUST_METHOD
-{ SID_ATTR_ALIGN_VER_JUSTIFY, SFX_ITEM_POOLABLE },  // EE_PARA_VER_JUST
-{ SID_ATTR_CHAR_COLOR, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_FONT, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_FONTHEIGHT, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_SCALEWIDTH, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_WEIGHT, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_UNDERLINE, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_STRIKEOUT, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_POSTURE, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_CONTOUR, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_SHADOWED, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_ESCAPEMENT, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_AUTOKERN, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_KERNING, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_WORDLINEMODE, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_LANGUAGE, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_CJK_LANGUAGE, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_CTL_LANGUAGE, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_CJK_FONT, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_CTL_FONT, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_CJK_FONTHEIGHT, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_CTL_FONTHEIGHT, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_CJK_WEIGHT, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_CTL_WEIGHT, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_CJK_POSTURE, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_CTL_POSTURE, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_EMPHASISMARK, SFX_ITEM_POOLABLE },
-{ SID_ATTR_CHAR_RELIEF, SFX_ITEM_POOLABLE },
-{ 0, SFX_ITEM_POOLABLE },   // EE_CHAR_RUBI_DUMMY
-{ 0, SFX_ITEM_POOLABLE },   // EE_CHAR_XMLATTRIBS
-{ SID_ATTR_CHAR_OVERLINE, SFX_ITEM_POOLABLE },
-{ 0, SFX_ITEM_POOLABLE },   // EE_FEATURE_TAB
-{ 0, SFX_ITEM_POOLABLE },   // EE_FEATURE_LINEBR
-{ SID_ATTR_CHAR_CHARSETCOLOR, SFX_ITEM_POOLABLE },  // EE_FEATURE_NOTCONV
-{ SID_FIELD, SFX_ITEM_POOLABLE }
-};
-
-class TestPool : public SfxItemPool
-{
-public:
-TestPool() : SfxItemPool("TestPool", EE_ITEMS_START, EE_ITEMS_END, 
aItemInfos, NULL, true)
-{
-SfxPoolItem** ppDefItems = 
EditDLL::Get().GetGlobalData()->GetDefItems();
-SetDefaults(ppDefItems);
-}
-virtual ~TestPool() {}
-};
-
 class Test : public test::BootstrapFixture
 {
 public:
@@ -125,9 +60,9 @@ Test::Test() {}
 
 void Test::testConstruction()
 {
-TestPool aPool;
-
-EditEngine aEngine(&aPool);
+EditEngineItemPool* pPool = new EditEngineItemPool(true);
+EditEngine aEngine(pPool);
+SfxItemPool::Free(pPool);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 27c5b14..afd1398 100644
--- a/editen

[Libreoffice-commits] .: sc/source

2012-04-11 Thread Kohei Yoshida
 sc/source/ui/inc/tpformula.hxx |9 -
 1 file changed, 9 deletions(-)

New commits:
commit c510670e3cab5322ed82e5702f6f6e311c9823f6
Author: Albert Thuswaldner 
Date:   Thu Apr 12 01:01:06 2012 +0200

removed unused includes in tpformula.hxx

diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx
index 033f61d..c547849 100644
--- a/sc/source/ui/inc/tpformula.hxx
+++ b/sc/source/ui/inc/tpformula.hxx
@@ -35,14 +35,6 @@
 #include 
 #include 
 
-#include 
-
-#include 
-
-class ScAppOptions;
-class SfxItemSet;
-class Window;
-
 class ScTpFormulaOptions : public SfxTabPage
 {
 public:
@@ -50,7 +42,6 @@ public:
 
 static  SfxTabPage* Create (Window* pParent, const SfxItemSet& rCoreSet);
 
-//  static  USHORT* GetRanges();
 virtual sal_Bool FillItemSet(SfxItemSet& rCoreSet);
 virtual void Reset( const SfxItemSet& rCoreSet );
 virtual int DeactivatePage(SfxItemSet* pSet = NULL);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: editeng/qa

2012-04-11 Thread Kohei Yoshida
 editeng/qa/unit/core-test.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit e487d2fbf67cc6c7f4506d08eb7aa080a7d37c18
Author: Kohei Yoshida 
Date:   Wed Apr 11 20:47:58 2012 -0400

You *are* fixed.

diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index 27af952..66707fa 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -127,7 +127,6 @@ void Test::testConstruction()
 {
 TestPool aPool;
 
-// TODO: fix me
 EditEngine aEngine(&aPool);
 }
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: editeng/CppunitTest_editeng_core.mk editeng/qa

2012-04-11 Thread Kohei Yoshida
 editeng/CppunitTest_editeng_core.mk |3 +++
 editeng/qa/unit/core-test.cxx   |   10 --
 2 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 8b216a7aa3c88a6b18f62079757567a2d4e4d737
Author: Kohei Yoshida 
Date:   Wed Apr 11 20:46:45 2012 -0400

Set default items to the item pool, do this and that, and now the test 
passes.

diff --git a/editeng/CppunitTest_editeng_core.mk 
b/editeng/CppunitTest_editeng_core.mk
index 77e203d..c94ff95 100644
--- a/editeng/CppunitTest_editeng_core.mk
+++ b/editeng/CppunitTest_editeng_core.mk
@@ -35,6 +35,8 @@ $(eval $(call 
gb_CppunitTest_add_exception_objects,editeng_core, \
 editeng/qa/unit/core-test \
 ))
 
+$(eval $(call gb_CppunitTest_use_library_objects,editeng_core,editeng))
+
 $(eval $(call gb_CppunitTest_use_libraries,editeng_core, \
 basegfx \
 comphelper \
@@ -64,6 +66,7 @@ $(eval $(call gb_CppunitTest_use_externals,editeng_core,\
 ))
 
 $(eval $(call gb_CppunitTest_set_include,editeng_core,\
+-I$(SRCDIR)/editeng/source \
 $$(INCLUDE) \
 ))
 
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
index d631923..27af952 100644
--- a/editeng/qa/unit/core-test.cxx
+++ b/editeng/qa/unit/core-test.cxx
@@ -35,6 +35,8 @@
 #include 
 
 #include "svl/itempool.hxx"
+#include "editeng/eerdll.hxx"
+#include "editeng/eerdll2.hxx"
 #include "editeng/editeng.hxx"
 #include "editeng/eeitem.hxx"
 #include "editeng/editids.hrc"
@@ -99,7 +101,11 @@ const SfxItemInfo aItemInfos[] = {
 class TestPool : public SfxItemPool
 {
 public:
-TestPool() : SfxItemPool("TestPool", EE_ITEMS_START, EE_ITEMS_END, 
aItemInfos, NULL, true) {}
+TestPool() : SfxItemPool("TestPool", EE_ITEMS_START, EE_ITEMS_END, 
aItemInfos, NULL, true)
+{
+SfxPoolItem** ppDefItems = 
EditDLL::Get().GetGlobalData()->GetDefItems();
+SetDefaults(ppDefItems);
+}
 virtual ~TestPool() {}
 };
 
@@ -122,7 +128,7 @@ void Test::testConstruction()
 TestPool aPool;
 
 // TODO: fix me
-//  EditEngine aEngine(&aPool);
+EditEngine aEngine(&aPool);
 }
 
 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/source

2012-04-11 Thread Kohei Yoshida
 sc/source/filter/oox/sharedformulabuffer.cxx |  213 ---
 1 file changed, 213 deletions(-)

New commits:
commit ddfa209fc0422c544292ad23413851d1b654de7c
Author: Kohei Yoshida 
Date:   Wed Apr 11 20:06:02 2012 -0400

Removed the source file of SharedFormulaBuffer, which is no longer used.

It has been replaced by SheetDataBuffer.

diff --git a/sc/source/filter/oox/sharedformulabuffer.cxx 
b/sc/source/filter/oox/sharedformulabuffer.cxx
deleted file mode 100644
index 9646534..000
--- a/sc/source/filter/oox/sharedformulabuffer.cxx
+++ /dev/null
@@ -1,213 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- /
-
-#include 
-#include 
-#include "oox/helper/propertyset.hxx"
-#include "addressconverter.hxx"
-#include "biffinputstream.hxx"
-#include "formulaparser.hxx"
-
-namespace oox {
-namespace xls {
-
-// 
-
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sheet;
-using namespace ::com::sun::star::table;
-
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-
-// 
-
-namespace {
-
-bool operator==( const CellAddress& rAddr1, const CellAddress& rAddr2 )
-{
-return
-(rAddr1.Sheet == rAddr2.Sheet) &&
-(rAddr1.Column == rAddr2.Column) &&
-(rAddr1.Row == rAddr2.Row);
-}
-
-bool lclContains( const CellRangeAddress& rRange, const CellAddress& rAddr )
-{
-return
-(rRange.Sheet == rAddr.Sheet) &&
-(rRange.StartColumn <= rAddr.Column) && (rAddr.Column <= 
rRange.EndColumn) &&
-(rRange.StartRow <= rAddr.Row) && (rAddr.Row <= rRange.EndRow);
-}
-
-} // namespace
-
-// 
-
-ExtCellFormulaContext::ExtCellFormulaContext( const WorksheetHelper& rHelper,
-const Reference< XFormulaTokens >& rxTokens, const CellAddress& 
rCellPos ) :
-SimpleFormulaContext( rxTokens, false, false ),
-WorksheetHelper( rHelper )
-{
-setBaseAddress( rCellPos );
-}
-
-void ExtCellFormulaContext::setSharedFormula( const CellAddress& rBaseAddr )
-{
-getSharedFormulas().setSharedFormulaCell( *this, rBaseAddr );
-}
-
-// 
-
-SharedFormulaBuffer::SharedFormulaBuffer( const WorksheetHelper& rHelper ) :
-WorksheetHelper( rHelper )
-{
-}
-
-void SharedFormulaBuffer::importSharedFmla( const OUString& rFormula, const 
OUString& rSharedRange, sal_Int32 nSharedId, const CellAddress& rBaseAddr )
-{
-CellRangeAddress aFmlaRange;
-if( getAddressConverter().convertToCellRange( aFmlaRange, rSharedRange, 
getSheetIndex(), true, true ) )
-{
-// create the defined name representing the shared formula
-OSL_ENSURE( lclContains( aFmlaRange, rBaseAddr ), 
"SharedFormulaBuffer::importSharedFmla - invalid range for shared formula" );
-BinAddress aMapKey( nSharedId, 0 );
-Reference< XNamedRange > xNamedRange = createDefinedName( aMapKey );
-// convert the formula definition
-Reference< XFormulaTokens > xTokens( xNamedRange, UNO_QUERY );
-if( xTokens.is() )
-{
-SimpleFormulaContext aContext( xTokens, true, false );
-aContext.setBaseAddress( rBaseAddr );
-getFormulaParser().importFormula( aContext, rFormula );
-updateCachedCell( rBaseAddr, aMapKey );
-}
-}
-}
-
-void SharedFormulaBuffer::importSharedFmla( SequenceInputStream& rSt

[Libreoffice-commits] .: editeng/source

2012-04-11 Thread Kohei Yoshida
 editeng/source/editeng/editdoc.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit a78a7ee9f7b1db56a6fa7e082f410db5a8db2f18
Author: Kohei Yoshida 
Date:   Wed Apr 11 15:36:00 2012 -0400

Do this special case search only when the array is large enough.

Otherwise the normal linear search should be sufficient.  Eventually
we need to use a better algorithm here than this special case handling...

diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index f797d24..c791aa2 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -688,7 +688,7 @@ size_t FastGetPos(const _Array& rArray, const _Val* p, 
size_t& rLastPos)
 // Through certain filter code-paths we do a lot of appends, which in
 // turn call GetPos - creating some N^2 nightmares. If we have a
 // non-trivially large list, do a few checks from the end first.
-if (rLastPos > 16)
+if (rLastPos > 16 && nArrayLen > 16)
 {
 size_t nEnd;
 if (rLastPos > nArrayLen - 2)
@@ -698,7 +698,7 @@ size_t FastGetPos(const _Array& rArray, const _Val* p, 
size_t& rLastPos)
 
 for (size_t nIdx = rLastPos - 2; nIdx < nEnd; ++nIdx)
 {
-if (&rArray[nIdx] == p)
+if (&rArray.at(nIdx) == p)
 {
 rLastPos = nIdx;
 return nIdx;
@@ -707,7 +707,7 @@ size_t FastGetPos(const _Array& rArray, const _Val* p, 
size_t& rLastPos)
 }
 // The world's lamest linear search from svarray ...
 for (size_t nIdx = 0; nIdx < nArrayLen; ++nIdx)
-if (&rArray[nIdx] == p)
+if (&rArray.at(nIdx) == p)
 return rLastPos = nIdx;
 
 // 0x is used to signify "not found" condition. We need to change this.
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: editeng/CppunitTest_editeng_core.mk

2012-04-11 Thread Kohei Yoshida
 editeng/CppunitTest_editeng_core.mk |   39 +++-
 1 file changed, 21 insertions(+), 18 deletions(-)

New commits:
commit e981a102333feb2a4d71bb3803210434b14b5d39
Author: Kohei Yoshida 
Date:   Wed Apr 11 14:55:58 2012 -0400

Add the right license header here...

diff --git a/editeng/CppunitTest_editeng_core.mk 
b/editeng/CppunitTest_editeng_core.mk
index e612de1..fb14e16 100644
--- a/editeng/CppunitTest_editeng_core.mk
+++ b/editeng/CppunitTest_editeng_core.mk
@@ -1,29 +1,32 @@
 # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
 #*
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
 #
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-# 
-# Copyright 2000, 2011 Oracle and/or its affiliates.
+# 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/
 #
-# OpenOffice.org - a multi-platform office productivity suite
+# 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.
 #
-# This file is part of OpenOffice.org.
+# The Initial Developer of the Original Code is
+#   Bjoern Michaelsen, Canonical Ltd. 
+# Portions created by the Initial Developer are Copyright (C) 2010 the
+# Initial Developer. All Rights Reserved.
 #
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
+# Major Contributor(s):
+#   Kohei Yoshida 
 #
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
-#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org.  If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
+# 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,editeng_core))
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - editeng/CppunitTest_editeng_core.mk editeng/Module_editeng.mk editeng/qa sc/inc sc/source

2012-04-11 Thread Kohei Yoshida
 editeng/CppunitTest_editeng_core.mk |   84 +
 editeng/Module_editeng.mk   |1 
 editeng/qa/unit/core-test.cxx   |  141 
 sc/inc/document.hxx |1 
 sc/source/core/data/documen2.cxx|2 
 5 files changed, 226 insertions(+), 3 deletions(-)

New commits:
commit d241251638d80bc6e2b737088e02c96bfa8c5c63
Author: Kohei Yoshida 
Date:   Wed Apr 11 14:29:11 2012 -0400

Attempt to add general-purpose unit test for editeng.

But instantiating EditEngine causes segfault.  The line is commented
out for now.

diff --git a/editeng/CppunitTest_editeng_core.mk 
b/editeng/CppunitTest_editeng_core.mk
new file mode 100644
index 000..e612de1
--- /dev/null
+++ b/editeng/CppunitTest_editeng_core.mk
@@ -0,0 +1,84 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+# 
+# Copyright 2000, 2011 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org.  If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*
+
+$(eval $(call gb_CppunitTest_CppunitTest,editeng_core))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,editeng_core, \
+editeng/qa/unit/core-test \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,editeng_core, \
+basegfx \
+comphelper \
+cppu \
+cppuhelper \
+editeng \
+i18nisolang1 \
+i18nutil \
+lng \
+sal \
+salhelper \
+sot \
+svl \
+svt \
+test \
+tk \
+tl \
+ucbhelper \
+utl \
+vcl \
+xo \
+$(gb_STDLIBS) \
+))
+
+$(eval $(call gb_CppunitTest_use_externals,editeng_core,\
+icuuc \
+))
+
+$(eval $(call gb_CppunitTest_set_include,editeng_core,\
+$$(INCLUDE) \
+))
+
+$(eval $(call gb_CppunitTest_use_api,editeng_core,\
+offapi \
+udkapi \
+))
+
+$(eval $(call gb_CppunitTest_use_components,editeng_core,\
+configmgr/source/configmgr \
+framework/util/fwk \
+i18npool/util/i18npool \
+sfx2/util/sfx \
+ucb/source/core/ucb1 \
+ucb/source/ucp/file/ucpfile1 \
+unoxml/source/service/unoxml \
+))
+
+$(eval $(call gb_CppunitTest_use_configuration,editeng_core))
+
+# vim: set noet sw=4 ts=4:
diff --git a/editeng/Module_editeng.mk b/editeng/Module_editeng.mk
index fd49b94..b767098 100644
--- a/editeng/Module_editeng.mk
+++ b/editeng/Module_editeng.mk
@@ -37,6 +37,7 @@ $(eval $(call gb_Module_add_targets,editeng,\
 # add any runtime tests (unit tests) here
 # remove if no tests
 $(eval $(call gb_Module_add_check_targets,editeng,\
+CppunitTest_editeng_core \
 CppunitTest_editeng_borderline \
 ))
 
diff --git a/editeng/qa/unit/core-test.cxx b/editeng/qa/unit/core-test.cxx
new file mode 100644
index 000..43e668c
--- /dev/null
+++ b/editeng/qa/unit/core-test.cxx
@@ -0,0 +1,141 @@
+/* -*- 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 Kohei Yoshida 
+ *
+ * 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.
+ */
+
+#includ

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

2012-04-10 Thread Kohei Yoshida
 sc/source/filter/excel/excform.cxx |   36 +++-
 sc/source/filter/excel/read.cxx|   12 ++--
 sc/source/filter/inc/imp_op.hxx|4 ++--
 3 files changed, 27 insertions(+), 25 deletions(-)

New commits:
commit a7f07eab97d9f52431329cb96bc1bf5ebd7da13d
Author: Kohei Yoshida 
Date:   Tue Apr 10 15:01:19 2012 -0400

bnc#755775: Set numeric formula results when importing xls document.

Without this, calculation upon import may incorrectly show #VALUE!
in some cells when the iterative calculation option is turned on.

This is on par with what we do during the ods document import.

diff --git a/sc/source/filter/excel/excform.cxx 
b/sc/source/filter/excel/excform.cxx
index 02ba65f..4fcf976 100644
--- a/sc/source/filter/excel/excform.cxx
+++ b/sc/source/filter/excel/excform.cxx
@@ -158,7 +158,9 @@ void ImportExcel::Formula(
 {
 if( eErr != ConvOK )
 ExcelToSc::SetError( *pCell, eErr );
-(void)fCurVal;
+
+if (!rtl::math::isNan(fCurVal))
+pCell->SetHybridDouble(fCurVal);
 }
 
 GetXFRangeBuffer().SetXF( aScPos, nXF );
commit ff0314bf92cd300ddedad566ab0303ddf5e95c17
Author: Kohei Yoshida 
Date:   Tue Apr 10 14:46:02 2012 -0400

Method signature cleanup.

Taking a reference to double makes no sense here.  Plus the bool.

diff --git a/sc/source/filter/excel/excform.cxx 
b/sc/source/filter/excel/excform.cxx
index 0279b41..02ba65f 100644
--- a/sc/source/filter/excel/excform.cxx
+++ b/sc/source/filter/excel/excform.cxx
@@ -111,8 +111,8 @@ void ImportExcel::Formula4()
 }
 
 
-void ImportExcel::Formula( const XclAddress& rXclPos,
-sal_uInt16 nXF, sal_uInt16 nFormLen, double& rCurVal, sal_Bool bShrFmla )
+void ImportExcel::Formula(
+const XclAddress& rXclPos, sal_uInt16 nXF, sal_uInt16 nFormLen, double 
fCurVal, bool bShrFmla)
 {
 ConvErr eErr = ConvOK;
 
@@ -158,7 +158,7 @@ void ImportExcel::Formula( const XclAddress& rXclPos,
 {
 if( eErr != ConvOK )
 ExcelToSc::SetError( *pCell, eErr );
-(void)rCurVal;
+(void)fCurVal;
 }
 
 GetXFRangeBuffer().SetXF( aScPos, nXF );
diff --git a/sc/source/filter/inc/imp_op.hxx b/sc/source/filter/inc/imp_op.hxx
index 57a3374..fc56de7 100644
--- a/sc/source/filter/inc/imp_op.hxx
+++ b/sc/source/filter/inc/imp_op.hxx
@@ -184,8 +184,8 @@ protected:
 voidBof5( void );   // 0x0809
 
 // ---
-voidFormula( const XclAddress& rXclPos,
-sal_uInt16 nXF, sal_uInt16 nFormLen, double 
&rCurVal, sal_Bool bShrFmla );
+void Formula(
+const XclAddress& rXclPos, sal_uInt16 nXF, sal_uInt16 nFormLen, double 
fCurVal, bool bShrFmla);
 //  -> excform.cxx
 
 virtual voidEndSheet( void );
commit 8bc22acaa0825c734e4f2dda177ad93b61b488a2
Author: Kohei Yoshida 
Date:   Tue Apr 10 14:28:00 2012 -0400

Zelle->Cell, Ergebnis->Result and bit of cleanup.

diff --git a/sc/source/filter/excel/excform.cxx 
b/sc/source/filter/excel/excform.cxx
index c5d2228..0279b41 100644
--- a/sc/source/filter/excel/excform.cxx
+++ b/sc/source/filter/excel/excform.cxx
@@ -120,25 +120,25 @@ void ImportExcel::Formula( const XclAddress& rXclPos,
 if( GetAddressConverter().ConvertAddress( aScPos, rXclPos, GetCurrScTab(), 
true ) )
 {
 // Formula will be read next, length in nFormLen
-const ScTokenArray* pErgebnis = 0;
-sal_BoolbConvert;
+const ScTokenArray* pResult = NULL;
+bool bConvert = false;
 
 pFormConv->Reset( aScPos );
 
 if( bShrFmla )
-bConvert = !pFormConv->GetShrFmla( pErgebnis, maStrm, nFormLen );
+bConvert = !pFormConv->GetShrFmla( pResult, maStrm, nFormLen );
 else
-bConvert = sal_True;
+bConvert = true;
 
 if( bConvert )
-eErr = pFormConv->Convert( pErgebnis, maStrm, nFormLen, true, 
FT_CellFormula);
+eErr = pFormConv->Convert( pResult, maStrm, nFormLen, true, 
FT_CellFormula);
 
-ScFormulaCell*  pZelle = NULL;
+ScFormulaCell* pCell = NULL;
 
-if( pErgebnis )
+if (pResult)
 {
-pZelle = new ScFormulaCell( pD, aScPos, pErgebnis );
-pD->PutCell( aScPos.Col(), aScPos.Row(), aScPos.Tab(), pZelle, 
true );
+pCell = new ScFormulaCell( pD, aScPos, pResult );
+pD->PutCell( aScPos.Col(), aScPos.Row(), aScPos.Tab(), pCell, true 
);
 }
 else
 {
@@ -148,16 +148,16 @@ void ImportExcel::Formula( const XclAddress& rXclPos,
 if( eCellType == CELLTYPE_FORMULA )
 {
 

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

2012-04-10 Thread Kohei Yoshida
 sc/Library_sc.mk   |1 
 sc/inc/appoptio.hxx|   29 --
 sc/inc/formulaopt.hxx  |  124 
 sc/inc/sc.hrc  |6 
 sc/inc/scmod.hxx   |5 
 sc/source/core/tool/appoptio.cxx   |  238 
 sc/source/core/tool/formulaopt.cxx |  361 +
 sc/source/ui/app/scmod.cxx |  120 ++--
 sc/source/ui/docshell/docsh3.cxx   |4 
 sc/source/ui/docshell/docsh6.cxx   |   20 +-
 sc/source/ui/inc/docsh.hxx |3 
 sc/source/ui/optdlg/tpformula.cxx  |  153 ---
 12 files changed, 616 insertions(+), 448 deletions(-)

New commits:
commit bf0629e09d176555aaa10f60061b206103cc0295
Author: Albert Thuswaldner 
Date:   Tue Apr 10 00:09:40 2012 +0200

Grouping ScFormulaOptions

diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 39d9c33..f640f05 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -177,6 +177,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/core/tool/doubleref \
sc/source/core/tool/editutil \
sc/source/core/tool/filtopt \
+   sc/source/core/tool/formulaopt \
sc/source/core/tool/formulaparserpool \
sc/source/core/tool/formularesult \
sc/source/core/tool/hints \
diff --git a/sc/inc/appoptio.hxx b/sc/inc/appoptio.hxx
index 7c69f88..b7f5fe8 100644
--- a/sc/inc/appoptio.hxx
+++ b/sc/inc/appoptio.hxx
@@ -91,26 +91,6 @@ public:
 ScOptionsUtil::KeyBindingType GetKeyBindingType() const { return 
meKeyBindingType; }
 voidSetKeyBindingType( ScOptionsUtil::KeyBindingType e ) { 
meKeyBindingType = e; }
 
-void SetFormulaSyntax( ::formula::FormulaGrammar::Grammar eGram ) { 
eFormulaGrammar = eGram; }
-::formula::FormulaGrammar::Grammar GetFormulaSyntax() const { return 
eFormulaGrammar; }
-
-void SetUseEnglishFuncName( bool bVal ) { bUseEnglishFuncName = bVal; }
-bool GetUseEnglishFuncName() const { return bUseEnglishFuncName; }
-
-void SetFormulaSepArg(const ::rtl::OUString& rSep) { aFormulaSepArg = 
rSep; }
-::rtl::OUString GetFormulaSepArg() const { return aFormulaSepArg; }
-
-void SetFormulaSepArrayRow(const ::rtl::OUString& rSep) { 
aFormulaSepArrayRow = rSep; }
-::rtl::OUString GetFormulaSepArrayRow() const { return 
aFormulaSepArrayRow; }
-
-void SetFormulaSepArrayCol(const ::rtl::OUString& rSep) { 
aFormulaSepArrayCol = rSep; }
-::rtl::OUString GetFormulaSepArrayCol() const { return 
aFormulaSepArrayCol; }
-
-void ResetFormulaSeparators();
-
-static void GetDefaultFormulaSeparators(rtl::OUString& rSepArg, 
rtl::OUString& rSepArrayCol, rtl::OUString& rSepArrayRow);
-static const LocaleDataWrapper& GetLocaleDataWrapper();
-
 const ScAppOptions& operator=   ( const ScAppOptions& rOpt );
 
 private:
@@ -133,12 +113,6 @@ private:
 sal_Int32   nDefaultObjectSizeHeight;
 sal_BoolmbShowSharedDocumentWarning;
 ScOptionsUtil::KeyBindingType meKeyBindingType;
-bool   bUseEnglishFuncName; // use English function name even if the 
locale is not English.
-::formula::FormulaGrammar::Grammar eFormulaGrammar;  // formula grammar 
used to switch different formula syntax
-
-::rtl::OUString aFormulaSepArg;
-::rtl::OUString aFormulaSepArrayRow;
-::rtl::OUString aFormulaSepArrayCol;
 };
 
 
@@ -158,7 +132,6 @@ class ScAppCfg : public ScAppOptions
 ScLinkConfigItemaSortListItem;
 ScLinkConfigItemaMiscItem;
 ScLinkConfigItemaCompatItem;
-ScLinkConfigItemaFormulaItem;
 
 DECL_LINK( LayoutCommitHdl, void* );
 DECL_LINK( InputCommitHdl, void* );
@@ -167,7 +140,6 @@ class ScAppCfg : public ScAppOptions
 DECL_LINK( SortListCommitHdl, void* );
 DECL_LINK( MiscCommitHdl, void* );
 DECL_LINK( CompatCommitHdl, void* );
-DECL_LINK( FormulaCommitHdl, void* );
 
 com::sun::star::uno::Sequence GetLayoutPropertyNames();
 com::sun::star::uno::Sequence GetInputPropertyNames();
@@ -176,7 +148,6 @@ class ScAppCfg : public ScAppOptions
 com::sun::star::uno::Sequence GetSortListPropertyNames();
 com::sun::star::uno::Sequence GetMiscPropertyNames();
 com::sun::star::uno::Sequence GetCompatPropertyNames();
-com::sun::star::uno::Sequence GetFormulaPropertyNames();
 
 public:
 ScAppCfg();
diff --git a/sc/inc/formulaopt.hxx b/sc/inc/formulaopt.hxx
new file mode 100644
index 000..50d3b9c
--- /dev/null
+++ b/sc/inc/formulaopt.hxx
@@ -0,0 +1,124 @@
+/* -*- 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. 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,
+ * 

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

2012-04-09 Thread Kohei Yoshida
 sc/Library_sc.mk  |1 
 sc/inc/formularesult.hxx  |  501 ++
 sc/source/core/tool/formularesult.cxx |  452 ++
 3 files changed, 486 insertions(+), 468 deletions(-)

New commits:
commit 967a3debe7fac2d749324be9af99192d94439da8
Author: Kohei Yoshida 
Date:   Tue Apr 10 01:20:03 2012 -0400

Non inline methods of ScFormulaResult.

diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index 224df82..39d9c33 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -178,6 +178,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/core/tool/editutil \
sc/source/core/tool/filtopt \
sc/source/core/tool/formulaparserpool \
+   sc/source/core/tool/formularesult \
sc/source/core/tool/hints \
sc/source/core/tool/inputopt \
sc/source/core/tool/interpr1 \
diff --git a/sc/inc/formularesult.hxx b/sc/inc/formularesult.hxx
index 8a35b43..2983176 100644
--- a/sc/inc/formularesult.hxx
+++ b/sc/inc/formularesult.hxx
@@ -30,6 +30,8 @@
 #define SC_FORMULARESULT_HXX
 
 #include "token.hxx"
+#include "scdllapi.h"
+
 #include 
 
 /** Store a variable formula cell result, balancing between runtime performance
@@ -68,7 +70,7 @@ class ScFormulaResult
 
 /** Reset mnError, mbEmpty and mbEmptyDisplayedAsString to their defaults
 prior to assigning other types */
-inline  voidResetToDefaults();
+void ResetToDefaults();
 
 /** If token is of formula::svError set error code and decrement RefCount.
 If token is of formula::svEmptyCell set mbEmpty and mbEmptyAsString and
@@ -81,65 +83,24 @@ class ScFormulaResult
 DecRef'ed prior to this call, p will be assigned to mpToken if not
 resolved.
 ATTENTION! Token may get deleted in this call! */
-inline  voidResolveToken( const formula::FormulaToken * p 
);
+void ResolveToken( const formula::FormulaToken * p );
 
 public:
-/** Effectively type svUnknown. */
-ScFormulaResult()
-: mpToken(NULL), mnError(0), mbToken(true),
-mbEmpty(false), 
mbEmptyDisplayedAsString(false),
-meMultiline(MULTILINE_UNKNOWN) {}
-
-ScFormulaResult( const ScFormulaResult & r )
-: mnError( r.mnError), mbToken( r.mbToken),
-mbEmpty( r.mbEmpty),
-mbEmptyDisplayedAsString( 
r.mbEmptyDisplayedAsString),
-meMultiline( r.meMultiline)
-{
-if (mbToken)
-{
-mpToken = r.mpToken;
-if (mpToken)
-{
-// Since matrix dimension and
-// results are assigned to a matrix
-// cell formula token we have to
-// clone that instead of sharing 
it.
-const ScMatrixFormulaCellToken* 
pMatFormula =
-r.GetMatrixFormulaCellToken();
-if (pMatFormula)
-{
-mpToken = new 
ScMatrixFormulaCellToken( *pMatFormula);
-mpToken->IncRef();
-}
-else
-IncrementTokenRef( mpToken);
-}
-}
-else
-mfValue = r.mfValue;
-}
+/** Effectively type svUnknown. */
+ScFormulaResult();
+
+ScFormulaResult( const ScFormulaResult & r );
 
 /** Same comments as for SetToken() apply! */
-explicitScFormulaResult( const formula::FormulaToken* 
p )
-: mnError(0), mbToken(false),
-mbEmpty(false), 
mbEmptyDisplayedAsString(false),
-meMultiline(MULTILINE_UNKNOWN)
-{
-SetToken( p);
-}
-
-~ScFormulaResult()
-{
-if (mbToken && mpToken)
-   

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

2012-04-09 Thread Kohei Yoshida
 sc/Library_sc.mk|1 
 sc/inc/recursionhelper.hxx  |   93 +---
 sc/source/core/data/cell.cxx|6 -
 sc/source/core/tool/recursionhelper.cxx |  121 
 4 files changed, 146 insertions(+), 75 deletions(-)

New commits:
commit 53a40d5e0dd06735a6e44cd16ed47538108035de
Author: Kohei Yoshida 
Date:   Mon Apr 9 21:45:19 2012 -0400

Make this non-inline too; for easier debugging.

diff --git a/sc/inc/recursionhelper.hxx b/sc/inc/recursionhelper.hxx
index f2a258d..929e24f 100644
--- a/sc/inc/recursionhelper.hxx
+++ b/sc/inc/recursionhelper.hxx
@@ -90,7 +90,7 @@ public:
 bool &  GetConvergingReference(){ return bConverging; }
 void StartIteration();
 void ResumeIteration();
-voidIncIteration()  { ++nIteration; }
+void IncIteration();
 void EndIteration();
 
 ScFormulaRecursionList::iterator GetLastIterationStart() { return 
aLastIterationStart; }
diff --git a/sc/source/core/tool/recursionhelper.cxx 
b/sc/source/core/tool/recursionhelper.cxx
index b98484b..cbee508 100644
--- a/sc/source/core/tool/recursionhelper.cxx
+++ b/sc/source/core/tool/recursionhelper.cxx
@@ -84,6 +84,11 @@ void ScRecursionHelper::ResumeIteration()
 aLastIterationStart = GetIterationStart();
 }
 
+void ScRecursionHelper::IncIteration()
+{
+++nIteration;
+}
+
 void ScRecursionHelper::EndIteration()
 {
 aRecursionFormulas.erase( GetIterationStart(), GetIterationEnd());
commit 4be657d53281680ebfa72e96b93705599f4178e1
Author: Kohei Yoshida 
Date:   Mon Apr 9 21:40:08 2012 -0400

Removed duplicated methods.

diff --git a/sc/inc/recursionhelper.hxx b/sc/inc/recursionhelper.hxx
index 176a93d..f2a258d 100644
--- a/sc/inc/recursionhelper.hxx
+++ b/sc/inc/recursionhelper.hxx
@@ -83,14 +83,6 @@ public:
 
 void Insert( ScFormulaCell* p, bool bOldRunning, const ScFormulaResult & 
rRes );
 
-ScFormulaRecursionList::iteratorGetStart()
-{
-return aRecursionFormulas.begin();
-}
-ScFormulaRecursionList::iteratorGetEnd()
-{
-return aRecursionFormulas.end();
-}
 boolIsInIterationReturn() const { return bInIterationReturn; }
 void SetInIterationReturn( bool b );
 boolIsDoingIteration() const{ return nIteration > 0; }
@@ -102,8 +94,8 @@ public:
 void EndIteration();
 
 ScFormulaRecursionList::iterator GetLastIterationStart() { return 
aLastIterationStart; }
-ScFormulaRecursionList::iterator GetIterationStart() { return GetStart(); }
-ScFormulaRecursionList::iterator GetIterationEnd() { return GetEnd(); }
+ScFormulaRecursionList::iterator GetIterationStart();
+ScFormulaRecursionList::iterator GetIterationEnd();
 /** Any return, recursion or iteration, iteration is always coupled with
 recursion. */
 boolIsInReturn() const  { return bInRecursionReturn; }
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index f191c5d..9ccadde 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -1390,9 +1390,9 @@ void ScFormulaCell::Interpret()
 {
 rRecursionHelper.SetInRecursionReturn( false);
 for (ScFormulaRecursionList::const_iterator aIter(
-rRecursionHelper.GetStart());
+rRecursionHelper.GetIterationStart());
 !rRecursionHelper.IsInReturn() && aIter !=
-rRecursionHelper.GetEnd(); ++aIter)
+rRecursionHelper.GetIterationEnd(); ++aIter)
 {
 ScFormulaCell* pCell = (*aIter).pCell;
 if (pCell->IsDirtyOrInTableOpDirty())
@@ -1412,7 +1412,7 @@ void ScFormulaCell::Interpret()
 else if (bResumeIteration ||
 rRecursionHelper.IsDoingIteration())
 rRecursionHelper.GetList().erase(
-rRecursionHelper.GetStart(),
+rRecursionHelper.GetIterationStart(),
 rRecursionHelper.GetLastIterationStart());
 else
 rRecursionHelper.Clear();
diff --git a/sc/source/core/tool/recursionhelper.cxx 
b/sc/source/core/tool/recursionhelper.cxx
index 98e6c28..b98484b 100644
--- a/sc/source/core/tool/recursionhelper.cxx
+++ b/sc/source/core/tool/recursionhelper.cxx
@@ -32,13 +32,13 @@ void ScRecursionHelper::Init()
 {
 nRecursionCount= 0;
 bInRecursionReturn = bDoingRecursion = bInIterationReturn = false;
-aInsertPos = GetEnd();
+aInsertPos = GetIterationEnd();
 ResetIteration();
 }
 
 void ScRecursionHelper::ResetIteration()
 {
-aLastIterationStart = GetEnd();
+aLastIterationStart = GetIterationEnd();
 nIteration = 0;
 bConverging = false;
 }
@

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

2012-04-09 Thread Kohei Yoshida
 editeng/inc/editeng/editobj.hxx |   18 -
 editeng/source/editeng/editobj.cxx  |  500 +---
 editeng/source/editeng/editobj2.hxx |   42 +--
 editeng/source/editeng/impedit4.cxx |6 
 4 files changed, 281 insertions(+), 285 deletions(-)

New commits:
commit 5d2b0f25f14c33c00cbf31d16e50bc9e00d60f06
Author: Kohei Yoshida 
Date:   Sun Apr 8 13:30:09 2012 -0400

Killed Another instance of svarray.

diff --git a/editeng/inc/editeng/editobj.hxx b/editeng/inc/editeng/editobj.hxx
index e3c9340..b495efb 100644
--- a/editeng/inc/editeng/editobj.hxx
+++ b/editeng/inc/editeng/editobj.hxx
@@ -85,12 +85,12 @@ public:
 static EditTextObject*  Create( SvStream& rIStream,
 SfxItemPool* pGlobalTextObjectPool = 0 );
 
-virtual sal_uInt16  GetParagraphCount() const;
+virtual size_t GetParagraphCount() const;
 
-virtual XubString   GetText( sal_uInt16 nParagraph ) const;
-virtual voidInsert( const EditTextObject& rObj, sal_uInt16 nPara );
-virtual voidRemoveParagraph( sal_uInt16 nPara );
-virtual EditTextObject* CreateTextObject( sal_uInt16 nPara, sal_uInt16 
nParas = 1 ) const;
+virtual String GetText(size_t nParagraph) const;
+virtual void Insert(const EditTextObject& rObj, size_t nPara);
+virtual void RemoveParagraph(size_t nPara);
+virtual EditTextObject* CreateTextObject(size_t nPara, size_t nParas = 1) 
const;
 
 virtual sal_BoolHasPortionInfo() const;
 virtual voidClearPortionInfo();
@@ -109,12 +109,12 @@ public:
 virtual const SvxFieldItem* GetField() const;
 virtual sal_BoolHasField( TypeId aType = NULL ) const;
 
-virtual SfxItemSet  GetParaAttribs( sal_uInt16 nPara ) const;
-virtual voidSetParaAttribs( sal_uInt16 nPara, const SfxItemSet& 
rAttribs );
+virtual SfxItemSet GetParaAttribs(size_t nPara) const;
+virtual void SetParaAttribs(size_t nPara, const SfxItemSet& rAttribs);
 
 virtual sal_BoolHasStyleSheet( const XubString& rName, 
SfxStyleFamily eFamily ) const;
-virtual voidGetStyleSheet( sal_uInt16 nPara, XubString& rName, 
SfxStyleFamily& eFamily ) const;
-virtual voidSetStyleSheet( sal_uInt16 nPara, const XubString& 
rName, const SfxStyleFamily& eFamily );
+virtual void GetStyleSheet(size_t nPara, String& rName, SfxStyleFamily& 
eFamily) const;
+virtual void SetStyleSheet(size_t nPara, const String& rName, const 
SfxStyleFamily& eFamily);
 virtual sal_BoolChangeStyleSheets(  const XubString& rOldName, 
SfxStyleFamily eOldFamily,
 const XubString& rNewName, 
SfxStyleFamily eNewFamily );
 virtual voidChangeStyleSheetName( SfxStyleFamily eFamily, const 
XubString& rOldName, const XubString& rNewName );
diff --git a/editeng/source/editeng/editobj.cxx 
b/editeng/source/editeng/editobj.cxx
index a404533..67099ba 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -168,6 +168,11 @@ bool ContentInfo::operator==( const ContentInfo& rCompare 
) const
 return false;
 }
 
+bool ContentInfo::operator!=(const ContentInfo& rCompare) const
+{
+return !operator==(rCompare);
+}
+
 EditTextObject::EditTextObject( sal_uInt16 n)
 {
 DBG_CTOR( EE_EditTextObject, 0 );
@@ -185,30 +190,30 @@ EditTextObject::~EditTextObject()
 DBG_DTOR( EE_EditTextObject, 0 );
 }
 
-sal_uInt16 EditTextObject::GetParagraphCount() const
+size_t EditTextObject::GetParagraphCount() const
 {
 OSL_FAIL( "Virtual method direct from EditTextObject!" );
 return 0;
 }
 
-XubString EditTextObject::GetText( sal_uInt16 /* nParagraph */ ) const
+String EditTextObject::GetText(size_t /* nParagraph */) const
 {
 OSL_FAIL( "Virtual method direct from EditTextObject!" );
-return XubString();
+return String();
 }
 
-void EditTextObject::Insert( const EditTextObject& /* rObj */, sal_uInt16 /* 
nPara */)
+void EditTextObject::Insert(const EditTextObject& /* rObj */, size_t /* nPara 
*/)
 {
 OSL_FAIL( "Virtual method direct from EditTextObject!" );
 }
 
-EditTextObject* EditTextObject::CreateTextObject( sal_uInt16 /*nPara*/, 
sal_uInt16 /*nParas*/ ) const
+EditTextObject* EditTextObject::CreateTextObject(size_t /*nPara*/, size_t 
/*nParas*/) const
 {
 OSL_FAIL( "Virtual method direct from EditTextObject!" );
 return 0;
 }
 
-void EditTextObject::RemoveParagraph( sal_uInt16 /*nPara*/ )
+void EditTextObject::RemoveParagraph(size_t /*nPara*/)
 {
 OSL_FAIL( "Virtual method direct from EditTextObject!" );
 }
@@ -264,13 +269,13 @@ sal_Bool EditTextObject::HasField( TypeId /*aType*/ ) 
const
 return false;
 }
 
-SfxItemSet EditTextObject::GetParaAttribs( sal_uInt16 /*nPara*/ ) const
+SfxItemSet EditTextObject::GetParaAttribs(size_t /*

[Libreoffice-commits] .: sc/inc

2012-04-04 Thread Kohei Yoshida
 sc/inc/dpobject.hxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit ba80af89a78b49954fd4a47ce95450d7f9247796
Author: Kohei Yoshida 
Date:   Thu Apr 5 00:58:20 2012 -0400

The real cleanup I meant to commit earlier...

diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index af50eb6..4f97b40 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -64,8 +64,6 @@ class Rectangle;
 class SvStream;
 class ScDPSaveData;
 class ScDPOutput;
-class ScPivot;
-class ScPivotCollection;
 struct ScPivotParam;
 struct ScImportSourceDesc;
 class ScSheetSourceDesc;
@@ -210,7 +208,6 @@ public:
 boolFillOldParam(ScPivotParam& rParam) const;
 boolFillLabelData(sal_Int32 nDim, ScDPLabelData& Labels);
 boolFillLabelData(ScPivotParam& rParam);
-voidInitFromOldPivot(const ScPivot& rOld, ScDocument* 
pDoc, sal_Bool bSetSource);
 
 boolGetHierarchiesNA( sal_Int32 nDim, 
com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& 
xHiers );
 boolGetHierarchies( sal_Int32 nDim, 
com::sun::star::uno::Sequence< rtl::OUString >& rHiers );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: editeng/source

2012-04-04 Thread Kohei Yoshida
 editeng/source/editeng/impedit.hxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit c770d2c8472402eecbb88ec72885cd9d6447d370
Author: Kohei Yoshida 
Date:   Wed Apr 4 16:40:54 2012 -0400

Method declared but not implemented.  Removing...

diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 438abee..28e1d0b 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -546,7 +546,6 @@ private:
 voidGetCharAttribs( sal_uInt16 nPara, 
std::vector& rLst ) const;
 
 EditTextObject* CreateBinTextObject( EditSelection aSelection, 
SfxItemPool*, sal_Bool bAllowBigObjects = sal_False, sal_uInt16 nBigObjStart = 
0 );
-voidStoreBinTextObject( SvStream& rOStream, BinTextObject& 
rTextObject );
 EditSelection   InsertBinTextObject( BinTextObject&, EditPaM aPaM );
 EditSelection   InsertText( ::com::sun::star::uno::Reference< 
::com::sun::star::datatransfer::XTransferable >& rxDataObj, const String& 
rBaseURL, const EditPaM& rPaM, sal_Bool bUseSpecial );
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: editeng/source

2012-04-04 Thread Kohei Yoshida
 editeng/source/editeng/editdbg.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit e0fd2c61e47c994d050d9afcb9578e096e1489b6
Author: Kohei Yoshida 
Date:   Wed Apr 4 16:22:32 2012 -0400

dbgutil fix.

diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index 9142ec1..c1ef702 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -334,13 +334,14 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, 
sal_Bool bInfoBox )
 fprintf( fp, 
"\n"
 );
 for ( sal_uInt16 nPortion = 0; nPortion < 
pEE->pImpEditEngine->GetParaPortions(). Count(); nPortion++)
 {
-
 ParaPortion* pPPortion = 
pEE->pImpEditEngine->GetParaPortions()[nPortion];
-fprintf( fp, "\nParagraph %i: Length = %i, Invalid = %i\nText = '%s'", 
nPortion, pPPortion->GetNode()->Len(), pPPortion->IsInvalid(), 
rtl::OUStringToOString( *pPPortion->GetNode(), RTL_TEXTENCODING_ASCII_US 
).getStr() );
+fprintf( fp, "\nParagraph %i: Length = %i, Invalid = %i\nText = '%s'",
+ nPortion, pPPortion->GetNode()->Len(), pPPortion->IsInvalid(),
+ rtl::OUStringToOString(pPPortion->GetNode()->GetString(), 
RTL_TEXTENCODING_UTF8).getStr() );
 fprintf( fp, "\nVorlage:" );
 SfxStyleSheet* pStyle = pPPortion->GetNode()->GetStyleSheet();
 if ( pStyle )
-fprintf( fp, " %s", rtl::OUStringToOString( pStyle->GetName(), 
RTL_TEXTENCODING_ASCII_US ).getStr() );
+fprintf( fp, " %s", rtl::OUStringToOString( pStyle->GetName(), 
RTL_TEXTENCODING_UTF8).getStr() );
 fprintf( fp, "\nParagraph attribute:" );
 DbgOutItemSet( fp, 
pPPortion->GetNode()->GetContentAttribs().GetItems(), sal_False, sal_False );
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-04-04 Thread Kohei Yoshida
 editeng/source/editeng/editattr.cxx |   21 +++--
 editeng/source/editeng/editattr.hxx |   29 ++---
 editeng/source/editeng/editdoc.cxx  |   77 +---
 editeng/source/editeng/editdoc.hxx  |   22 --
 editeng/source/editeng/editview.cxx |2 
 editeng/source/editeng/edtspell.cxx |6 +-
 editeng/source/editeng/impedit2.cxx |   58 ++-
 editeng/source/editeng/impedit3.cxx |   20 +
 editeng/source/editeng/impedit4.cxx |   55 +
 9 files changed, 184 insertions(+), 106 deletions(-)

New commits:
commit 0e355da592008257ec02bd68d37ff67b32eaa8c6
Author: Kohei Yoshida 
Date:   Tue Apr 3 17:10:10 2012 -0400

De-coupled ContentNode from XubString inheritance.

diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index 373e608..c444950 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -1154,6 +1154,16 @@ void EditPaM::SetNode(ContentNode* p)
 pNode = p;
 }
 
+bool EditPaM::IsParaStart() const
+{
+return nIndex == 0;
+}
+
+bool EditPaM::IsParaEnd() const
+{
+return nIndex == pNode->Len();
+}
+
 sal_Bool EditPaM::DbgIsBuggy( EditDoc& rDoc )
 {
 if ( !pNode )
@@ -1275,7 +1285,7 @@ ContentNode::ContentNode( SfxItemPool& rPool ) : 
aContentAttribs( rPool )
 }
 
 ContentNode::ContentNode( const XubString& rStr, const ContentAttribs& 
rContentAttribs ) :
-XubString( rStr ), aContentAttribs( rContentAttribs )
+maString(rStr), aContentAttribs(rContentAttribs)
 {
 DBG_CTOR( EE_ContentNode, 0 );
 pWrongList = NULL;
@@ -1414,7 +1424,7 @@ void ContentNode::ExpandAttribs( sal_uInt16 nIndex, 
sal_uInt16 nNew, SfxItemPool
 
 if ( pWrongList )
 {
-sal_Bool bSep = ( GetChar( nIndex ) == ' ' ) || IsFeature( nIndex );
+bool bSep = ( maString.GetChar( nIndex ) == ' ' ) || IsFeature( nIndex 
);
 pWrongList->TextInserted( nIndex, nNew, bSep );
 }
 
@@ -1515,7 +1525,7 @@ void ContentNode::CopyAndCutAttribs( ContentNode* 
pPrevNode, SfxItemPool& rPool,
 {
 DBG_ASSERT( pPrevNode, "Copy of attributes to a null pointer?" );
 
-xub_StrLen nCut = pPrevNode->Len();
+sal_uInt16 nCut = pPrevNode->Len();
 
 size_t nAttr = 0;
 CharAttribList::AttribsType& rPrevAttribs = 
pPrevNode->GetCharAttribs().GetAttribs();
@@ -1567,7 +1577,7 @@ void ContentNode::AppendAttribs( ContentNode* pNextNode )
 {
 DBG_ASSERT( pNextNode, "Copy of attributes to a null pointer?" );
 
-sal_uInt16 nNewStart = Len();
+sal_uInt16 nNewStart = maString.Len();
 
 #if OSL_DEBUG_LEVEL > 2
 OSL_ENSURE( aCharAttribList.DbgCheckAttribs(), "Attribute before 
AppendAttribs broken" );
@@ -1658,6 +1668,61 @@ void ContentNode::DestroyWrongList()
 pWrongList = NULL;
 }
 
+bool ContentNode::IsFeature( sal_uInt16 nPos ) const
+{
+return maString.GetChar(nPos) == CH_FEATURE;
+}
+
+sal_uInt16 ContentNode::Len() const
+{
+return maString.Len();
+}
+
+const XubString& ContentNode::GetString() const
+{
+return maString;
+}
+
+void ContentNode::SetChar(sal_uInt16 nPos, sal_Unicode c)
+{
+maString.SetChar(nPos, c);
+}
+
+void ContentNode::Insert(const XubString& rStr, sal_uInt16 nPos)
+{
+maString.Insert(rStr, nPos);
+}
+
+void ContentNode::Append(const XubString& rStr)
+{
+maString.Append(rStr);
+}
+
+void ContentNode::Erase(sal_uInt16 nPos)
+{
+maString.Erase(nPos);
+}
+
+void ContentNode::Erase(sal_uInt16 nPos, sal_uInt16 nCount)
+{
+maString.Erase(nPos, nCount);
+}
+
+XubString ContentNode::Copy(sal_uInt16 nPos) const
+{
+return maString.Copy(nPos);
+}
+
+XubString ContentNode::Copy(sal_uInt16 nPos, sal_uInt16 nCount) const
+{
+return maString.Copy(nPos, nCount);
+}
+
+sal_Unicode ContentNode::GetChar(sal_uInt16 nPos) const
+{
+return maString.GetChar(nPos);
+}
+
 void ContentNode::CreateWrongList()
 {
 DBG_ASSERT( !pWrongList, "WrongList already exist!" );
@@ -2050,7 +2115,7 @@ XubString EditDoc::GetParaAsString(
 //!! beware of sub string length  of -1 which is also defined as 
STRING_LEN and
 //!! thus would result in adding the whole sub string up to the end of 
the node !!
 if (nEnd > nIndex)
-aStr += XubString( *pNode, nIndex, nEnd - nIndex );
+aStr += XubString(pNode->GetString(), nIndex, nEnd - nIndex);
 
 if ( pNextFeature )
 {
@@ -2240,7 +2305,7 @@ EditPaM EditDoc::ConnectParagraphs( ContentNode* pLeft, 
ContentNode* pRight )
 // First the attributes, otherwise nLen will not be correct!
 pLeft->AppendAttribs( pRight );
 // then the Text...
-*pLeft += *pRight;
+pLeft->Append(pRight->GetString());
 
 // the one to the right disappears.
 RemoveItemsFromPool(*pRight);
diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/ed

[Libreoffice-commits] .: editeng/source

2012-04-03 Thread Kohei Yoshida
 editeng/source/editeng/impedit2.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 71da75abda60172ee9b8f42c1bf5de2f48a731b9
Author: Kohei Yoshida 
Date:   Tue Apr 3 18:45:55 2012 -0400

I need to check for empty-ness here too.

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index ec74f29..ecb4a89 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -4021,7 +4021,9 @@ long ImpEditEngine::GetXPos(
 if ( nType == CHAR_PUNCTUATIONRIGHT )
 {
 sal_uInt16 n = nIndex - nTextPortionStart;
-const sal_Int32* pDXArray = 
&pLine->GetCharPosArray()[0]+( nTextPortionStart-pLine->GetStart() );
+const sal_Int32* pDXArray = NULL;
+if (!pLine->GetCharPosArray().empty())
+pDXArray = &pLine->GetCharPosArray()[0]+( 
nTextPortionStart-pLine->GetStart() );
 sal_Int32 nCharWidth = ( ( (n+1) < 
pPortion->GetLen() ) ? pDXArray[n] : pPortion->GetSize().Width() )
 - ( n ? 
pDXArray[n-1] : 0 );
 if ( (n+1) < pPortion->GetLen() )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: editeng/source

2012-04-03 Thread Kohei Yoshida
 editeng/source/editeng/impedit3.cxx |   11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit e5d378b1ba04c470e0c6c16b48af97ab5818e2bb
Author: Kohei Yoshida 
Date:   Tue Apr 3 18:26:29 2012 -0400

Check for empty-ness of vector before accessing the first element.

I hope this will keep Stephan's tinderbox happy.  If not...

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 83396c9..4e9c393 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1241,7 +1241,9 @@ sal_Bool ImpEditEngine::CreateLines( sal_uInt16 nPara, 
sal_uInt32 nStartPosY )
 if ( bCompressedChars && pPortion && ( pPortion->GetLen() > 1 ) && 
pPortion->GetExtraInfos() && pPortion->GetExtraInfos()->bCompressed )
 {
 // I need the manipulated DXArray for determining the break 
postion...
-sal_Int32* pDXArray = &pLine->GetCharPosArray()[0] + 
(nPortionStart - pLine->GetStart());
+sal_Int32* pDXArray = NULL;
+if (!pLine->GetCharPosArray().empty())
+pDXArray = &pLine->GetCharPosArray()[0] + (nPortionStart - 
pLine->GetStart());
 ImplCalcAsianCompression(
 pNode, pPortion, nPortionStart, pDXArray, 1, true);
 }
@@ -2997,7 +2999,8 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, 
Rectangle aClipRec, Point aSta
 aText = *pPortion->GetNode();
 nTextStart = nIndex;
 nTextLen = pTextPortion->GetLen();
-pDXArray = &pLine->GetCharPosArray()[0]+( 
nIndex-pLine->GetStart() );
+if (!pLine->GetCharPosArray().empty())
+pDXArray = 
&pLine->GetCharPosArray()[0]+( nIndex-pLine->GetStart() );
 
 // Paint control characters (#i55716#)
 if ( aStatus.MarkFields() )
@@ -4457,7 +4460,9 @@ void ImpEditEngine::ImplExpandCompressedPortions( 
EditLine* pLine, ParaPortion*
 size_t nTxtPortion = pParaPortion->GetTextPortions().GetPos( 
pTP );
 sal_uInt16 nTxtPortionStart = 
pParaPortion->GetTextPortions().GetStartPos( nTxtPortion );
 DBG_ASSERT( nTxtPortionStart >= pLine->GetStart(), "Portion 
doesn't belong to the line!!!" );
-sal_Int32* pDXArray = &pLine->GetCharPosArray()[0]+( 
nTxtPortionStart-pLine->GetStart() );
+sal_Int32* pDXArray = NULL;
+if (!pLine->GetCharPosArray().empty())
+pDXArray = &pLine->GetCharPosArray()[0]+( 
nTxtPortionStart-pLine->GetStart() );
 if ( pTP->GetExtraInfos()->pOrgDXArray )
 memcpy( pDXArray, pTP->GetExtraInfos()->pOrgDXArray, 
(pTP->GetLen()-1)*sizeof(sal_Int32) );
 ImplCalcAsianCompression( pParaPortion->GetNode(), pTP, 
nTxtPortionStart, pDXArray, (sal_uInt16)nCompressPercent, sal_True );
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: editeng/source

2012-04-03 Thread Kohei Yoshida
 editeng/source/editeng/impedit.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit e7e882715872303dc8feabc899ceab572d1c2337
Author: Kohei Yoshida 
Date:   Tue Apr 3 13:53:15 2012 -0400

Unused local variables.

diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index b01c830..d3268ce 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -491,7 +491,6 @@ void ImpEditView::ResetOutputArea( const Rectangle& rRec )
 
 void ImpEditView::RecalcOutputArea()
 {
-Rectangle aOldArea( aOutArea );
 Point aNewTopLeft( aOutArea.TopLeft() );
 Size aNewSz( aOutArea.GetSize() );
 
@@ -886,7 +885,6 @@ Pair ImpEditView::Scroll( long ndX, long ndY, sal_uInt8 
nRangeCheck )
 #endif
 
 Rectangle aNewVisArea( GetVisDocArea() );
-Size aPaperSz( pEditEngine->pImpEditEngine->GetPaperSize() );
 
 // Vertical:
 if ( !IsVertical() )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: editeng/source

2012-04-03 Thread Kohei Yoshida
 editeng/source/editeng/impedit3.cxx |2 +-
 editeng/source/editeng/impedit4.cxx |8 
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 881fa8d5cbb937b033f87f7da813419895b31b28
Author: Kohei Yoshida 
Date:   Tue Apr 3 13:15:57 2012 -0400

More dbgutil build fix.

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 091c329..83396c9 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -1697,7 +1697,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( 
ParaPortion* pParaPortion, sal_uIn
 {
 // -2: The new one is already inserted.
 #ifdef DBG_UTIL
-EditLine* pLastLine = pParaPortion->GetLines().GetObject( 
pParaPortion->GetLines().Count()-2 );
+EditLine* pLastLine = 
pParaPortion->GetLines()[pParaPortion->GetLines().Count()-2];
 DBG_ASSERT( pLastLine, "soft wrap no line?!" );
 DBG_ASSERT( pLastLine->GetEnd() == pParaPortion->GetNode()->Len(), 
"different anyway?" );
 #endif
diff --git a/editeng/source/editeng/impedit4.cxx 
b/editeng/source/editeng/impedit4.cxx
index dd45a57..63b9402 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -1167,9 +1167,9 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( 
EditSelection aSel, SfxItemP
 sal_uInt16 nTest;
 int nTPLen = 0, nTxtLen = 0;
 for ( nTest = pParaPortion->GetTextPortions().Count(); nTest; )
-nTPLen += pParaPortion->GetTextPortions().GetObject( --nTest 
)->GetLen();
+nTPLen += pParaPortion->GetTextPortions()[--nTest]->GetLen();
 for ( nTest = pParaPortion->GetLines().Count(); nTest; )
-nTxtLen += pParaPortion->GetLines().GetObject( --nTest 
)->GetLen();
+nTxtLen += pParaPortion->GetLines()[--nTest]->GetLen();
 DBG_ASSERT( ( nTPLen == pParaPortion->GetNode()->Len() ) && ( 
nTxtLen == pParaPortion->GetNode()->Len() ), "CreateBinTextObject: ParaPortion 
not completely formatted!" );
 #endif
 }
@@ -1363,9 +1363,9 @@ EditSelection ImpEditEngine::InsertBinTextObject( 
BinTextObject& rTextObject, Ed
 sal_uInt16 nTest;
 int nTPLen = 0, nTxtLen = 0;
 for ( nTest = pParaPortion->GetTextPortions().Count(); nTest; )
-nTPLen += pParaPortion->GetTextPortions().GetObject( 
--nTest )->GetLen();
+nTPLen += 
pParaPortion->GetTextPortions()[--nTest]->GetLen();
 for ( nTest = pParaPortion->GetLines().Count(); nTest; )
-nTxtLen += pParaPortion->GetLines().GetObject( --nTest 
)->GetLen();
+nTxtLen += pParaPortion->GetLines()[--nTest]->GetLen();
 DBG_ASSERT( ( nTPLen == pParaPortion->GetNode()->Len() ) && ( 
nTxtLen == pParaPortion->GetNode()->Len() ), "InsertBinTextObject: ParaPortion 
not completely formatted!" );
 #endif
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: editeng/source

2012-04-03 Thread Kohei Yoshida
 editeng/source/editeng/impedit2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 97bcf0b645fa5ce14cfd806548c6805952fd3e76
Author: Kohei Yoshida 
Date:   Tue Apr 3 11:51:18 2012 -0400

WaE: for Norbert's Mac OS tinderbox.

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index 6a01a0f..ec74f29 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -3965,7 +3965,7 @@ long ImpEditEngine::GetXPos(
 // End of Portion
 if ( pPortion->GetKind() == PORTIONKIND_TAB )
 {
-if ( (nTextPortion+1) < 
pParaPortion->GetTextPortions().Count() )
+if ( static_cast(nTextPortion+1) < 
pParaPortion->GetTextPortions().Count() )
 {
 const TextPortion* pNextPortion = 
pParaPortion->GetTextPortions()[nTextPortion+1];
 if ( pNextPortion->GetKind() != PORTIONKIND_TAB )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: editeng/source

2012-04-03 Thread Kohei Yoshida
 editeng/source/editeng/editdbg.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 2c4e811049e9f2cad823e372a01a5afc09ead25c
Author: Kohei Yoshida 
Date:   Tue Apr 3 11:44:06 2012 -0400

Fix the dbgutil build.

diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index 48f6e00..9142ec1 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -384,7 +384,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool 
bInfoBox )
 sal_uLong n = 0;
 for ( z = 0; z < nTextPortions; z++ )
 {
-TextPortion* pPortion = pPPortion->GetTextPortions().GetObject( z 
);
+TextPortion* pPortion = pPPortion->GetTextPortions()[z];
 aPortionStr.append(' ');
 aPortionStr.append(static_cast(pPortion->GetLen()));
 aPortionStr.append('(');
@@ -409,7 +409,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool 
bInfoBox )
 sal_uInt16 nLine;
 for ( nLine = 0; nLine < pPPortion->GetLines().Count(); nLine++ )
 {
-EditLine* pLine = pPPortion->GetLines().GetObject( nLine );
+EditLine* pLine = pPPortion->GetLines()[nLine];
 
 rtl::OString 
aLine(rtl::OUStringToOString(pPPortion->GetNode()->Copy(pLine->GetStart(), 
pLine->GetEnd() - pLine->GetStart()), RTL_TEXTENCODING_ASCII_US));
 fprintf( fp, "\nLine %i\t>%s<", nLine, aLine.getStr() );
@@ -417,7 +417,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool 
bInfoBox )
 // then the internal data ...
 for ( nLine = 0; nLine < pPPortion->GetLines().Count(); nLine++ )
 {
-EditLine* pLine = pPPortion->GetLines().GetObject( nLine );
+EditLine* pLine = pPPortion->GetLines()[nLine];
 fprintf( fp, "\nZeile %i:\tStart: %i,\tEnd: %i", nLine, 
pLine->GetStart(), pLine->GetEnd() );
 fprintf( fp, "\t\tPortions: %i - %i.\tHight: %i, Ascent=%i", 
pLine->GetStartPortion(), pLine->GetEndPortion(), pLine->GetHeight(), 
pLine->GetMaxAscent() );
 }
___
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-04-02 Thread Kohei Yoshida
 sc/source/filter/excel/xestyle.cxx |8 
 sc/source/filter/excel/xistyle.cxx |   37 +++--
 sc/source/filter/inc/xlconst.hxx   |   10 ++
 3 files changed, 29 insertions(+), 26 deletions(-)

New commits:
commit 487139d681fbf38a52cf5ea91d7e38f7eba290a0
Author: Markus Mohrhard 
Date:   Sun Apr 1 23:57:46 2012 +0200

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

Signed-off-by: Kohei Yoshida 

diff --git a/sc/source/filter/excel/xestyle.cxx 
b/sc/source/filter/excel/xestyle.cxx
index 11757bb..39ecfcf 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1553,15 +1553,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( ) )
@@ -1576,7 +1576,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 2131095..1f55f2d 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
+{   EXC_BORDER_THIN,::editeng::SOLID },// B = thin 
d

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

2012-04-02 Thread Kohei Yoshida
 sc/source/core/data/docpool.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit 643fd5a6d2f72e55b243290b85be25f77dcf7be8
Author: Markus Mohrhard 
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

Signed-off-by: Kohei Yoshida 

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] .: editeng/source

2012-03-28 Thread Kohei Yoshida
 editeng/source/editeng/impedit2.cxx |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

New commits:
commit b512c3ca29735f15383c5f6215348fccfaddd40e
Author: Kohei Yoshida 
Date:   Thu Mar 29 02:00:02 2012 -0400

No need to delete ParaPortion outside of the container any more.

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index 04cebce..e7d2bbc 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -2477,18 +2477,15 @@ void ImpEditEngine::ImpRemoveParagraph( sal_uInt16 
nPara )
 {
 ContentNode* pNode = aEditDoc.SaveGetObject( nPara );
 ContentNode* pNextNode = aEditDoc.SaveGetObject( nPara+1 );
-ParaPortion* pPortion = GetParaPortions().SaveGetObject( nPara );
 
 OSL_ENSURE( pNode, "Blind Node in ImpRemoveParagraph" );
-OSL_ENSURE( pPortion, "Blind Portion in ImpRemoveParagraph(2)" );
 
 DeletedNodeInfo* pInf = new DeletedNodeInfo( (sal_uLong)pNode, nPara );
 aDeletedNodes.Insert( pInf, aDeletedNodes.Count() );
 
 // The node is managed by the undo and possibly destroyed!
-/* delete */ aEditDoc.Remove( nPara );
+aEditDoc.Remove( nPara );
 GetParaPortions().Remove( nPara );
-delete pPortion;
 
 if ( IsCallParaInsertedOrDeleted() )
 {
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-03-28 Thread Kohei Yoshida
 editeng/inc/editeng/editeng.hxx |3 
 editeng/inc/editeng/editview.hxx|2 
 editeng/inc/editeng/outliner.hxx|2 
 editeng/source/editeng/editdbg.cxx  |2 
 editeng/source/editeng/editdoc.cxx  |  116 +++-
 editeng/source/editeng/editdoc.hxx  |   63 +--
 editeng/source/editeng/editdoc2.cxx |   80 ++--
 editeng/source/editeng/editeng.cxx  |8 ++
 editeng/source/editeng/editview.cxx |6 -
 editeng/source/editeng/impedit.cxx  |4 -
 editeng/source/editeng/impedit.hxx  |   31 -
 editeng/source/editeng/impedit2.cxx |   39 ++--
 editeng/source/editeng/impedit3.cxx |2 
 editeng/source/editeng/impedit4.cxx |8 +-
 editeng/source/editeng/impedit5.cxx |   22 --
 editeng/source/outliner/outlvw.cxx  |2 
 16 files changed, 249 insertions(+), 141 deletions(-)

New commits:
commit c802cbad7f25d3070f2ae5fd8a7e1a7ce17f99a9
Author: Kohei Yoshida 
Date:   Thu Mar 29 01:43:30 2012 -0400

ContentList no longer a child class of DummyContentList (take 2).

The previous commit was bad as it would cause segfalut on startup.

This one is good as far as I can tell.

diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx
index 4c0d5e0..c17b15b 100644
--- a/editeng/inc/editeng/editeng.hxx
+++ b/editeng/inc/editeng/editeng.hxx
@@ -328,7 +328,8 @@ public:
 SfxStyleSheetPool*  GetStyleSheetPool();
 
 voidSetStyleSheet( sal_uInt16 nPara, SfxStyleSheet* pStyle 
);
-SfxStyleSheet*  GetStyleSheet( sal_uInt16 nPara ) const;
+const SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara ) const;
+SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara );
 
 voidSetWordDelimiters( const String& rDelimiters );
 String  GetWordDelimiters() const;
diff --git a/editeng/inc/editeng/editview.hxx b/editeng/inc/editeng/editview.hxx
index 7f3dd4c..aa9864f 100644
--- a/editeng/inc/editeng/editview.hxx
+++ b/editeng/inc/editeng/editview.hxx
@@ -183,7 +183,7 @@ public:
 voidSetEditEngineUpdateMode( sal_Bool bUpdate );
 voidForceUpdate();
 
-SfxStyleSheet*  GetStyleSheet() const;
+const SfxStyleSheet* GetStyleSheet() const;
 
 voidSetAnchorMode( EVAnchorMode eMode );
 EVAnchorModeGetAnchorMode() const;
diff --git a/editeng/inc/editeng/outliner.hxx b/editeng/inc/editeng/outliner.hxx
index faceb8a..ee7edec 100644
--- a/editeng/inc/editeng/outliner.hxx
+++ b/editeng/inc/editeng/outliner.hxx
@@ -308,7 +308,7 @@ public:
 voidPaste();
 voidPasteSpecial();
 
-SfxStyleSheet*  GetStyleSheet() const;
+const SfxStyleSheet*  GetStyleSheet() const;
 
 voidSetControlWord( sal_uLong nWord );
 sal_uLong   GetControlWord() const;
diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index 4070002..48f6e00 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -335,7 +335,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool 
bInfoBox )
 for ( sal_uInt16 nPortion = 0; nPortion < 
pEE->pImpEditEngine->GetParaPortions(). Count(); nPortion++)
 {
 
-ParaPortion* pPPortion = 
pEE->pImpEditEngine->GetParaPortions().GetObject(nPortion );
+ParaPortion* pPPortion = 
pEE->pImpEditEngine->GetParaPortions()[nPortion];
 fprintf( fp, "\nParagraph %i: Length = %i, Invalid = %i\nText = '%s'", 
nPortion, pPPortion->GetNode()->Len(), pPPortion->IsInvalid(), 
rtl::OUStringToOString( *pPPortion->GetNode(), RTL_TEXTENCODING_ASCII_US 
).getStr() );
 fprintf( fp, "\nVorlage:" );
 SfxStyleSheet* pStyle = pPPortion->GetNode()->GetStyleSheet();
diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index f83d054..010f40f 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -256,8 +256,6 @@ sal_uInt16 aV5Map[] = {
 4035, 4036, 4037, 4038
 };
 
-SV_IMPL_PTRARR( DummyContentList, ContentNode* );
-
 EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, 
sal_uInt16 nS, sal_uInt16 nE )
 {
 // Create a new attribute in the pool
@@ -567,6 +565,25 @@ sal_uInt16 EditLineList::FindLine( sal_uInt16 nChar, 
sal_Bool bInclEnd )
 return ( Count() - 1 );
 }
 
+EditPaM::EditPaM() : pNode(NULL), nIndex(0) {}
+EditPaM::EditPaM(const EditPaM& r) : pNode(r.pNode), nIndex(r.nIndex) {}
+EditPaM::EditPaM(ContentNode* p, sal_uInt16 n) : pNode(p), nIndex(n) {}
+
+const ContentNode* EditPaM::GetNode() const
+{
+return pNode;
+}
+
+ContentNode* EditPaM::GetNode()
+{
+return pNode;
+}
+
+void EditPaM::SetNode(ContentNode* p)
+{
+pNode = p;
+}
+
 sal_Bool EditPaM::DbgIsBuggy( EditDoc& rDoc )
 {
 if ( !pNode )
@@ -633,8 +650,8 @@ sal_Bool EditSelection::Adjus

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

2012-03-28 Thread Kohei Yoshida
 editeng/inc/editeng/editeng.hxx |3 
 editeng/inc/editeng/editview.hxx|2 
 editeng/inc/editeng/outliner.hxx|2 
 editeng/source/editeng/editdbg.cxx  |2 
 editeng/source/editeng/editdoc.cxx  |  112 
 editeng/source/editeng/editdoc.hxx  |   63 ++--
 editeng/source/editeng/editdoc2.cxx |   80 ++---
 editeng/source/editeng/editeng.cxx  |8 --
 editeng/source/editeng/editview.cxx |6 -
 editeng/source/editeng/impedit.cxx  |4 -
 editeng/source/editeng/impedit.hxx  |   31 -
 editeng/source/editeng/impedit2.cxx |   39 +---
 editeng/source/editeng/impedit3.cxx |2 
 editeng/source/editeng/impedit4.cxx |8 +-
 editeng/source/editeng/impedit5.cxx |   22 ++-
 editeng/source/outliner/outlvw.cxx  |2 
 16 files changed, 139 insertions(+), 247 deletions(-)

New commits:
commit 8bf6eb4519b4b92390570341a10872e65fd95dc1
Author: Kohei Yoshida 
Date:   Thu Mar 29 01:44:32 2012 -0400

Revert "ContentList no longer a child class of DummyContentList."

This reverts commit ea8f2cbee079932e7f5d9ab646996b472a120c76.

diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx
index c17b15b..4c0d5e0 100644
--- a/editeng/inc/editeng/editeng.hxx
+++ b/editeng/inc/editeng/editeng.hxx
@@ -328,8 +328,7 @@ public:
 SfxStyleSheetPool*  GetStyleSheetPool();
 
 voidSetStyleSheet( sal_uInt16 nPara, SfxStyleSheet* pStyle 
);
-const SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara ) const;
-SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara );
+SfxStyleSheet*  GetStyleSheet( sal_uInt16 nPara ) const;
 
 voidSetWordDelimiters( const String& rDelimiters );
 String  GetWordDelimiters() const;
diff --git a/editeng/inc/editeng/editview.hxx b/editeng/inc/editeng/editview.hxx
index aa9864f..7f3dd4c 100644
--- a/editeng/inc/editeng/editview.hxx
+++ b/editeng/inc/editeng/editview.hxx
@@ -183,7 +183,7 @@ public:
 voidSetEditEngineUpdateMode( sal_Bool bUpdate );
 voidForceUpdate();
 
-const SfxStyleSheet* GetStyleSheet() const;
+SfxStyleSheet*  GetStyleSheet() const;
 
 voidSetAnchorMode( EVAnchorMode eMode );
 EVAnchorModeGetAnchorMode() const;
diff --git a/editeng/inc/editeng/outliner.hxx b/editeng/inc/editeng/outliner.hxx
index ee7edec..faceb8a 100644
--- a/editeng/inc/editeng/outliner.hxx
+++ b/editeng/inc/editeng/outliner.hxx
@@ -308,7 +308,7 @@ public:
 voidPaste();
 voidPasteSpecial();
 
-const SfxStyleSheet*  GetStyleSheet() const;
+SfxStyleSheet*  GetStyleSheet() const;
 
 voidSetControlWord( sal_uLong nWord );
 sal_uLong   GetControlWord() const;
diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index 48f6e00..4070002 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -335,7 +335,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool 
bInfoBox )
 for ( sal_uInt16 nPortion = 0; nPortion < 
pEE->pImpEditEngine->GetParaPortions(). Count(); nPortion++)
 {
 
-ParaPortion* pPPortion = 
pEE->pImpEditEngine->GetParaPortions()[nPortion];
+ParaPortion* pPPortion = 
pEE->pImpEditEngine->GetParaPortions().GetObject(nPortion );
 fprintf( fp, "\nParagraph %i: Length = %i, Invalid = %i\nText = '%s'", 
nPortion, pPPortion->GetNode()->Len(), pPPortion->IsInvalid(), 
rtl::OUStringToOString( *pPPortion->GetNode(), RTL_TEXTENCODING_ASCII_US 
).getStr() );
 fprintf( fp, "\nVorlage:" );
 SfxStyleSheet* pStyle = pPPortion->GetNode()->GetStyleSheet();
diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index 5df6635..f83d054 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -256,6 +256,8 @@ sal_uInt16 aV5Map[] = {
 4035, 4036, 4037, 4038
 };
 
+SV_IMPL_PTRARR( DummyContentList, ContentNode* );
+
 EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, 
sal_uInt16 nS, sal_uInt16 nE )
 {
 // Create a new attribute in the pool
@@ -565,25 +567,6 @@ sal_uInt16 EditLineList::FindLine( sal_uInt16 nChar, 
sal_Bool bInclEnd )
 return ( Count() - 1 );
 }
 
-EditPaM::EditPaM() : pNode(NULL), nIndex(0) {}
-EditPaM::EditPaM(const EditPaM& r) : pNode(r.pNode), nIndex(r.nIndex) {}
-EditPaM::EditPaM(ContentNode* p, sal_uInt16 n) : pNode(p), nIndex(n) {}
-
-const ContentNode* EditPaM::GetNode() const
-{
-return pNode;
-}
-
-ContentNode* EditPaM::GetNode()
-{
-return pNode;
-}
-
-void EditPaM::SetNode(ContentNode* p)
-{
-pNode = p;
-}
-
 sal_Bool EditPaM::DbgIsBuggy( EditDoc& rDoc )
 {
 if ( !pNode )
@@ -650,8 +633,8 @@ sal_Bool EditSelection::Adjust( const ContentList& rNodes 

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

2012-03-28 Thread Kohei Yoshida
 editeng/inc/editeng/editeng.hxx |3 
 editeng/inc/editeng/editview.hxx|2 
 editeng/inc/editeng/outliner.hxx|2 
 editeng/source/editeng/editdbg.cxx  |2 
 editeng/source/editeng/editdoc.cxx  |  112 +++-
 editeng/source/editeng/editdoc.hxx  |   72 ++-
 editeng/source/editeng/editdoc2.cxx |   92 ++---
 editeng/source/editeng/editeng.cxx  |8 ++
 editeng/source/editeng/editview.cxx |6 -
 editeng/source/editeng/impedit.cxx  |4 -
 editeng/source/editeng/impedit.hxx  |   31 +
 editeng/source/editeng/impedit2.cxx |   39 ++--
 editeng/source/editeng/impedit3.cxx |2 
 editeng/source/editeng/impedit4.cxx |8 +-
 editeng/source/editeng/impedit5.cxx |   22 ---
 editeng/source/outliner/outlvw.cxx  |2 
 16 files changed, 261 insertions(+), 146 deletions(-)

New commits:
commit ea8f2cbee079932e7f5d9ab646996b472a120c76
Author: Kohei Yoshida 
Date:   Thu Mar 29 01:43:30 2012 -0400

ContentList no longer a child class of DummyContentList.

diff --git a/editeng/inc/editeng/editeng.hxx b/editeng/inc/editeng/editeng.hxx
index 4c0d5e0..c17b15b 100644
--- a/editeng/inc/editeng/editeng.hxx
+++ b/editeng/inc/editeng/editeng.hxx
@@ -328,7 +328,8 @@ public:
 SfxStyleSheetPool*  GetStyleSheetPool();
 
 voidSetStyleSheet( sal_uInt16 nPara, SfxStyleSheet* pStyle 
);
-SfxStyleSheet*  GetStyleSheet( sal_uInt16 nPara ) const;
+const SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara ) const;
+SfxStyleSheet* GetStyleSheet( sal_uInt16 nPara );
 
 voidSetWordDelimiters( const String& rDelimiters );
 String  GetWordDelimiters() const;
diff --git a/editeng/inc/editeng/editview.hxx b/editeng/inc/editeng/editview.hxx
index 7f3dd4c..aa9864f 100644
--- a/editeng/inc/editeng/editview.hxx
+++ b/editeng/inc/editeng/editview.hxx
@@ -183,7 +183,7 @@ public:
 voidSetEditEngineUpdateMode( sal_Bool bUpdate );
 voidForceUpdate();
 
-SfxStyleSheet*  GetStyleSheet() const;
+const SfxStyleSheet* GetStyleSheet() const;
 
 voidSetAnchorMode( EVAnchorMode eMode );
 EVAnchorModeGetAnchorMode() const;
diff --git a/editeng/inc/editeng/outliner.hxx b/editeng/inc/editeng/outliner.hxx
index faceb8a..ee7edec 100644
--- a/editeng/inc/editeng/outliner.hxx
+++ b/editeng/inc/editeng/outliner.hxx
@@ -308,7 +308,7 @@ public:
 voidPaste();
 voidPasteSpecial();
 
-SfxStyleSheet*  GetStyleSheet() const;
+const SfxStyleSheet*  GetStyleSheet() const;
 
 voidSetControlWord( sal_uLong nWord );
 sal_uLong   GetControlWord() const;
diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index 4070002..48f6e00 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -335,7 +335,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool 
bInfoBox )
 for ( sal_uInt16 nPortion = 0; nPortion < 
pEE->pImpEditEngine->GetParaPortions(). Count(); nPortion++)
 {
 
-ParaPortion* pPPortion = 
pEE->pImpEditEngine->GetParaPortions().GetObject(nPortion );
+ParaPortion* pPPortion = 
pEE->pImpEditEngine->GetParaPortions()[nPortion];
 fprintf( fp, "\nParagraph %i: Length = %i, Invalid = %i\nText = '%s'", 
nPortion, pPPortion->GetNode()->Len(), pPPortion->IsInvalid(), 
rtl::OUStringToOString( *pPPortion->GetNode(), RTL_TEXTENCODING_ASCII_US 
).getStr() );
 fprintf( fp, "\nVorlage:" );
 SfxStyleSheet* pStyle = pPPortion->GetNode()->GetStyleSheet();
diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index f83d054..5df6635 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -256,8 +256,6 @@ sal_uInt16 aV5Map[] = {
 4035, 4036, 4037, 4038
 };
 
-SV_IMPL_PTRARR( DummyContentList, ContentNode* );
-
 EditCharAttrib* MakeCharAttrib( SfxItemPool& rPool, const SfxPoolItem& rAttr, 
sal_uInt16 nS, sal_uInt16 nE )
 {
 // Create a new attribute in the pool
@@ -567,6 +565,25 @@ sal_uInt16 EditLineList::FindLine( sal_uInt16 nChar, 
sal_Bool bInclEnd )
 return ( Count() - 1 );
 }
 
+EditPaM::EditPaM() : pNode(NULL), nIndex(0) {}
+EditPaM::EditPaM(const EditPaM& r) : pNode(r.pNode), nIndex(r.nIndex) {}
+EditPaM::EditPaM(ContentNode* p, sal_uInt16 n) : pNode(p), nIndex(n) {}
+
+const ContentNode* EditPaM::GetNode() const
+{
+return pNode;
+}
+
+ContentNode* EditPaM::GetNode()
+{
+return pNode;
+}
+
+void EditPaM::SetNode(ContentNode* p)
+{
+pNode = p;
+}
+
 sal_Bool EditPaM::DbgIsBuggy( EditDoc& rDoc )
 {
 if ( !pNode )
@@ -633,8 +650,8 @@ sal_Bool EditSelection::Adjust( const ContentList& rNodes )
 DBG_ASSERT( aStartPaM.GetIndex() <= aStartPaM.GetNode()->Len(), "Index out 

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

2012-03-28 Thread Kohei Yoshida
 editeng/source/editeng/editdoc.hxx  |   39 +++-
 editeng/source/editeng/editdoc2.cxx |  113 
 editeng/source/editeng/editeng.cxx  |   16 ++---
 editeng/source/editeng/editundo.cxx |1 
 editeng/source/editeng/editview.cxx |2 
 editeng/source/editeng/impedit.cxx  |5 -
 editeng/source/editeng/impedit.hxx  |   22 ---
 editeng/source/editeng/impedit2.cxx |  105 +++--
 editeng/source/editeng/impedit3.cxx |   36 +--
 editeng/source/editeng/impedit4.cxx |4 -
 editeng/source/editeng/impedit5.cxx |4 -
 11 files changed, 215 insertions(+), 132 deletions(-)

New commits:
commit 175dc9fcc6252177e03486952e867c7bd1f8e9de
Author: Kohei Yoshida 
Date:   Wed Mar 28 22:49:34 2012 -0400

pRightPortion no longer used.

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index d7d1fa2..661d2c1 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -2275,10 +2275,7 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( 
ContentNode* pLeft, ContentNode* pR
 
 // First search for Portions since pRight is gone after ConnectParagraphs.
 ParaPortion* pLeftPortion = FindParaPortion( pLeft );
-ParaPortion* pRightPortion = FindParaPortion( pRight );
 OSL_ENSURE( pLeftPortion, "Blind Portion in ImpConnectParagraphs(1)" );
-OSL_ENSURE( pRightPortion, "Blind Portion in ImpConnectParagraphs(2)" );
-OSL_ENSURE( nParagraphTobeDeleted == GetParaPortions().GetPos( 
pRightPortion ), "NodePos != PortionPos?" );
 
 if ( GetStatus().DoOnlineSpelling() )
 {
commit 87d554e97332f418d570d69391c3f2bf95e8cbab
Author: Kohei Yoshida 
Date:   Wed Mar 28 22:34:57 2012 -0400

ParaPortionList no longer a child class of DummyParaPortionList.

BTW, whoever originally wrote this code obviously didn't like using
const keywords.

diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 9474ee9..2a78af7 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -438,7 +438,7 @@ public:
 ~TextPortionList();
 
 voidReset();
-sal_uInt16  FindPortion( sal_uInt16 nCharPos, sal_uInt16& rPortionStart, 
sal_Bool bPreferStartingPortion = sal_False );
+sal_uInt16  FindPortion( sal_uInt16 nCharPos, sal_uInt16& rPortionStart, 
sal_Bool bPreferStartingPortion = sal_False ) const;
 sal_uInt16  GetStartPos( sal_uInt16 nPortion );
 voidDeleteFromPortion( sal_uInt16 nDelFrom );
 };
@@ -584,9 +584,10 @@ public:
 ParaPortion( ContentNode* pNode );
 ~ParaPortion();
 
-sal_uInt16  GetLineNumber( sal_uInt16 nIndex );
+sal_uInt16 GetLineNumber( sal_uInt16 nIndex ) const;
 
 EditLineList&   GetLines()  { return aLineList; }
+const EditLineList& GetLines() const { return aLineList; }
 
 sal_BoolIsInvalid() const   { return bInvalid; }
 sal_BoolIsSimpleInvalid()   const   { return bSimple; }
@@ -602,7 +603,7 @@ public:
 voidMarkSelectionInvalid( sal_uInt16 nStart, sal_uInt16 
nEnd );
 
 voidSetVisible( sal_Bool bVisible );
-sal_BoolIsVisible() { return bVisible; }
+boolIsVisible() const { return bVisible; }
 
 sal_BoolIsEmpty() { return GetTextPortions().Count() == 1 && 
GetTextPortions()[0]->GetLen() == 0; }
 
@@ -612,6 +613,7 @@ public:
 
 ContentNode*GetNode() const { return pNode; }
 TextPortionList&GetTextPortions()   { return aTextPortionList; 
}
+const TextPortionList& GetTextPortions() const { return aTextPortionList; }
 
 sal_uInt16  GetInvalidPosStart() const  { return 
nInvalidPosStart; }
 short   GetInvalidDiff() const  { return nInvalidDiff; }
@@ -622,27 +624,37 @@ public:
 #endif
 };
 
-typedef ParaPortion* ParaPortionPtr;
-SV_DECL_PTRARR( DummyParaPortionList, ParaPortionPtr, 0 )
-
 // -
 // class ParaPortionList
 // -
-class ParaPortionList : public DummyParaPortionList
+class ParaPortionList
 {
-mutable sal_uInt16 nLastCache;
+mutable size_t nLastCache;
+boost::ptr_vector maPortions;
 public:
 ParaPortionList();
 ~ParaPortionList();
 
 voidReset();
-longGetYOffset( ParaPortion* pPPortion );
+long GetYOffset(const ParaPortion* pPPortion) const;
 sal_uInt16  FindParagraph( long nYOffset );
 
-inline ParaPortion* SaveGetObject( sal_uInt16 nPos ) const
-{ return ( nPos < Count() ) ? GetObject( nPos

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

2012-03-28 Thread Kohei Yoshida
 editeng/source/editeng/editdoc.hxx  |   10 +++--
 editeng/source/editeng/editdoc2.cxx |6 +++--
 editeng/source/editeng/editeng.cxx  |2 -
 editeng/source/editeng/editundo.cxx |   40 +++-
 editeng/source/editeng/editundo.hxx |7 --
 editeng/source/editeng/impedit5.cxx |2 -
 6 files changed, 41 insertions(+), 26 deletions(-)

New commits:
commit 48cd6ac1ec7e92a9c9a21f5365db4f9ff5fde93c
Author: Kohei Yoshida 
Date:   Wed Mar 28 15:31:05 2012 -0400

Fix tinderbox error & some cleanup.

diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 7551eca..7f760f3 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -298,10 +298,11 @@ SV_DECL_PTRARR( DummyContentList, ContentNodePtr, 0 )
 
 class ContentList : public DummyContentList
 {
-  sal_uInt16 nLastCache;
+sal_uInt16 nLastCache;
+
 public:
-  ContentList() : DummyContentList( 0 ), nLastCache(0) {}
-  sal_uInt16 GetPos( const ContentNodePtr &rPtr ) const;
+ContentList();
+sal_uInt16 GetPos(ContentNode* p) const;
 };
 
 // -
diff --git a/editeng/source/editeng/editdoc2.cxx 
b/editeng/source/editeng/editdoc2.cxx
index c13b656..68da6aa 100644
--- a/editeng/source/editeng/editdoc2.cxx
+++ b/editeng/source/editeng/editdoc2.cxx
@@ -337,10 +337,12 @@ sal_uInt16 ParaPortionList::GetPos( const ParaPortionPtr 
&rPtr ) const
((ParaPortionList *)this)->nLastCache );
 }
 
-sal_uInt16 ContentList::GetPos( const ContentNodePtr &rPtr ) const
+ContentList::ContentList() : DummyContentList( 0 ), nLastCache(0) {}
+
+sal_uInt16 ContentList::GetPos(ContentNode* p) const
 {
 return FastGetPos( reinterpret_cast( GetData() ),
-   Count(), static_cast( rPtr ),
+   Count(), static_cast(p),
((ContentList *)this)->nLastCache );
 }
 
diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index 0954d51..9fcd0a2 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -2113,7 +2113,7 @@ void EditEngine::RemoveFields( sal_Bool bKeepFieldText, 
TypeId aType )
 const SvxFieldData* pFldData = static_cast(rAttr.GetItem())->GetField();
 if ( pFldData && ( !aType || ( pFldData->IsA( aType ) ) ) )
 {
-DBG_ASSERT( rAttr->GetItem()->ISA( SvxFieldItem ), "no 
field item..." );
+DBG_ASSERT( dynamic_cast(rAttr.GetItem()), "no field item..." );
 EditSelection aSel( EditPaM(pNode, rAttr.GetStart()), 
EditPaM(pNode, rAttr.GetEnd()) );
 String aFieldText = static_cast(rAttr).GetFieldValue();
 pImpEditEngine->ImpInsertText( aSel, aFieldText );
commit 17cc39f2b0ef13efdfb052fe6b815508879fb755
Author: Kohei Yoshida 
Date:   Wed Mar 28 14:54:42 2012 -0400

ContentInfoArray is gone.

diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 1114990..7551eca 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -135,9 +135,6 @@ public:
 void AppendCharAttrib(EditCharAttrib* pNew);
 };
 
-typedef ContentAttribsInfo* ContentAttribsInfoPtr;
-SV_DECL_PTRARR( ContentInfoArray, ContentAttribsInfoPtr, 1 )
-
 //  --
 //  class SvxColorList
 //  --
diff --git a/editeng/source/editeng/editundo.cxx 
b/editeng/source/editeng/editundo.cxx
index e29043b..b59b71a 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -540,18 +540,26 @@ EditUndoSetAttribs::EditUndoSetAttribs( ImpEditEngine* 
_pImpEE, const ESelection
 nSpecial = 0;
 }
 
+namespace {
+
+struct RemoveAttribsFromPool : std::unary_function
+{
+SfxItemPool& mrPool;
+public:
+RemoveAttribsFromPool(SfxItemPool& rPool) : mrPool(rPool) {}
+void operator() (ContentAttribsInfo& rInfo)
+{
+rInfo.RemoveAllCharAttribsFromPool(mrPool);
+}
+};
+
+}
+
 EditUndoSetAttribs::~EditUndoSetAttribs()
 {
 // Get Items from Pool...
 SfxItemPool* pPool = aNewAttribs.GetPool();
-sal_uInt16 nContents = aPrevAttribs.Count();
-for ( sal_uInt16 n = 0; n < nContents; n++ )
-{
-ContentAttribsInfo* pInf = aPrevAttribs[n];
-DBG_ASSERT( pInf, "Undo_DTOR (SetAttribs): pInf = NULL!" );
-pInf->RemoveAllCharAttribsFromPool(*pPool);
-delete pInf;
-}
+std::for_each(aPrevAttribs.begin(), aPrevAttribs.end(), 
RemoveAttribsFromPool(*pPool));
 }
 
 void EditUndoSetAttribs::Undo()
@@ -561,20 +569,19 @@ void EditUndoSetAttribs::Undo()
 bool bFi

[Libreoffice-commits] .: 2 commits - offapi/com

2012-03-28 Thread Kohei Yoshida
 offapi/com/sun/star/sheet/XCellRangesQuery.idl |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 484b44b39bc2788160f475c3b40ce6b569fdc6cb
Author: Kohei Yoshida 
Date:   Wed Mar 28 14:12:31 2012 -0400

Changed some wording.

diff --git a/offapi/com/sun/star/sheet/XCellRangesQuery.idl 
b/offapi/com/sun/star/sheet/XCellRangesQuery.idl
index a44cc70..35bb831 100644
--- a/offapi/com/sun/star/sheet/XCellRangesQuery.idl
+++ b/offapi/com/sun/star/sheet/XCellRangesQuery.idl
@@ -78,10 +78,10 @@ published interface XCellRangesQuery: 
com::sun::star::uno::XInterface
 long values, this method expects a short
 parameter.
 
-Attention: Empty cells in the range are not analyzed.Some
-CellFlags may not be fully honored. For instance,
-when querying for STYLES, the returned ranges may not include empty
-cells with styles applied.
+Attention: Empty cells in the range may be skipped depending on
+the content flag used.  For instance, when querying for STYLES,
+the returned ranges may not include empty cells even if styles are
+applied to those cells.
 
 @returns
 all cells of the current cell range(s) with the specified
commit 78278561130a3faab44472831bfccc074a0e8194
Author: Laurent Godard 
Date:   Wed Mar 28 17:00:53 2012 +0200

document queryContentCells limitation

add also a missing  in previous paragraph

diff --git a/offapi/com/sun/star/sheet/XCellRangesQuery.idl 
b/offapi/com/sun/star/sheet/XCellRangesQuery.idl
index f35eec7..a44cc70 100644
--- a/offapi/com/sun/star/sheet/XCellRangesQuery.idl
+++ b/offapi/com/sun/star/sheet/XCellRangesQuery.idl
@@ -76,7 +76,12 @@ published interface XCellRangesQuery: 
com::sun::star::uno::XInterface
 
 Attention: Despite the CellFlags flags are
 long values, this method expects a short
-parameter.
+parameter.
+
+Attention: Empty cells in the range are not analyzed.Some
+CellFlags may not be fully honored. For instance,
+when querying for STYLES, the returned ranges may not include empty
+cells with styles applied.
 
 @returns
 all cells of the current cell range(s) with the specified
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: editeng/source

2012-03-28 Thread Kohei Yoshida
 editeng/source/editeng/editdbg.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 736bf5c26f4f220171d95f52b933669c1ff6b172
Author: Kohei Yoshida 
Date:   Wed Mar 28 14:00:06 2012 -0400

Keep tinderbox happy.

diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index a1b4575..4070002 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -349,21 +349,21 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, 
sal_Bool bInfoBox )
 sal_uInt16 z;
 for ( z = 0; z < pPPortion->GetNode()->GetCharAttribs().Count(); z++ )
 {
-EditCharAttrib* pAttr = 
pPPortion->GetNode()->GetCharAttribs().GetAttribs().GetObject( z );
+const EditCharAttrib& rAttr = 
pPPortion->GetNode()->GetCharAttribs().GetAttribs()[z];
 rtl::OStringBuffer aCharAttribs;
 aCharAttribs.append(RTL_CONSTASCII_STRINGPARAM("\nA"));
 aCharAttribs.append(static_cast(nPortion));
 aCharAttribs.append(RTL_CONSTASCII_STRINGPARAM(":  "));
-
aCharAttribs.append(static_cast(pAttr->GetItem()->Which()));
+
aCharAttribs.append(static_cast(rAttr.GetItem()->Which()));
 aCharAttribs.append('\t');
-aCharAttribs.append(static_cast(pAttr->GetStart()));
+aCharAttribs.append(static_cast(rAttr.GetStart()));
 aCharAttribs.append('\t');
-aCharAttribs.append(static_cast(pAttr->GetEnd()));
-if ( pAttr->IsEmpty() )
+aCharAttribs.append(static_cast(rAttr.GetEnd()));
+if ( rAttr.IsEmpty() )
 bZeroAttr = sal_True;
 fprintf(fp, "%s => ", aCharAttribs.getStr());
 
-rtl::OString aDebStr = DbgOutItem( rPool, *pAttr->GetItem() );
+rtl::OString aDebStr = DbgOutItem( rPool, *rAttr.GetItem() );
 fprintf( fp, "%s", aDebStr.getStr() );
 }
 if ( bZeroAttr )
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-03-28 Thread Kohei Yoshida
 editeng/source/editeng/editdbg.cxx  |   12 ++--
 editeng/source/editeng/editdoc.hxx  |   14 +++---
 editeng/source/editeng/editdoc2.cxx |   11 +++
 editeng/source/editeng/editundo.cxx |   21 +++--
 editeng/source/editeng/impedit5.cxx |2 +-
 5 files changed, 32 insertions(+), 28 deletions(-)

New commits:
commit d192756c71519b1f013bbaa1a0594d46606a6336
Author: Kohei Yoshida 
Date:   Wed Mar 28 13:35:19 2012 -0400

No more CharAttribArray.

diff --git a/editeng/source/editeng/editdbg.cxx 
b/editeng/source/editeng/editdbg.cxx
index fc9c562..a1b4575 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -496,19 +496,19 @@ sal_Bool ParaPortion::DbgCheckTextPortions()
 }
 #endif
 
-sal_Bool CheckOrderedList( CharAttribArray& rAttribs, sal_Bool bStart )
+bool CheckOrderedList(const CharAttribList::AttribsType& rAttribs, bool bStart)
 {
 sal_uInt16 nPrev = 0;
-for ( sal_uInt16 nAttr = 0; nAttr < rAttribs.Count(); nAttr++ )
+for (size_t nAttr = 0; nAttr < rAttribs.size(); ++nAttr)
 {
-EditCharAttrib* pAttr = rAttribs[nAttr];
-sal_uInt16 nCur = bStart ? pAttr->GetStart() : pAttr->GetEnd();
+const EditCharAttrib& rAttr = rAttribs[nAttr];
+sal_uInt16 nCur = bStart ? rAttr.GetStart() : rAttr.GetEnd();
 if ( nCur < nPrev )
-return sal_False;
+return false;
 
 nPrev = nCur;
 }
-return sal_True;
+return true;
 }
 
 #endif
diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 2bd5151..1114990 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -117,9 +117,6 @@ struct WritingDirectionInfo
 
 typedef std::deque< WritingDirectionInfo > WritingDirectionInfos;
 
-typedef EditCharAttrib* EditCharAttribPtr;
-SV_DECL_PTRARR( CharAttribArray, EditCharAttribPtr, 0 )
-
 class ContentAttribsInfo
 {
 private:
@@ -804,7 +801,7 @@ inline EditCharAttrib* 
GetAttrib(CharAttribList::AttribsType& rAttribs, size_t n
 return (nAttr < rAttribs.size()) ? &rAttribs[nAttr] : NULL;
 }
 
-sal_Bool CheckOrderedList( CharAttribArray& rAttribs, sal_Bool bStart );
+bool CheckOrderedList(const CharAttribList::AttribsType& rAttribs, bool 
bStart);
 
 // -
 // class EditEngineItemPool
commit 38e07aab9eb8c3c1d18038857b5dda28aace5bff
Author: Kohei Yoshida 
Date:   Wed Mar 28 13:31:27 2012 -0400

One less use of CharAttribArray.

diff --git a/editeng/source/editeng/editdoc.hxx 
b/editeng/source/editeng/editdoc.hxx
index 7ddaa39..2bd5151 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -123,16 +123,19 @@ SV_DECL_PTRARR( CharAttribArray, EditCharAttribPtr, 0 )
 class ContentAttribsInfo
 {
 private:
+typedef boost::ptr_vector CharAttribsType;
+
 SfxItemSet  aPrevParaAttribs;
-CharAttribArray aPrevCharAttribs;
+CharAttribsType aPrevCharAttribs;
 
 public:
 ContentAttribsInfo( const SfxItemSet& rParaAttribs );
 
 const SfxItemSet&   GetPrevParaAttribs() const  { return 
aPrevParaAttribs; }
-const CharAttribArray&  GetPrevCharAttribs() const  { return 
aPrevCharAttribs; }
+const CharAttribsType&  GetPrevCharAttribs() const  { return 
aPrevCharAttribs; }
 
-CharAttribArray&GetPrevCharAttribs(){ return 
aPrevCharAttribs; }
+void RemoveAllCharAttribsFromPool(SfxItemPool& rPool) const;
+void AppendCharAttrib(EditCharAttrib* pNew);
 };
 
 typedef ContentAttribsInfo* ContentAttribsInfoPtr;
diff --git a/editeng/source/editeng/editdoc2.cxx 
b/editeng/source/editeng/editdoc2.cxx
index 67c0d38..c13b656 100644
--- a/editeng/source/editeng/editdoc2.cxx
+++ b/editeng/source/editeng/editdoc2.cxx
@@ -395,6 +395,17 @@ ContentAttribsInfo::ContentAttribsInfo( const SfxItemSet& 
rParaAttribs ) :
 {
 }
 
+void ContentAttribsInfo::RemoveAllCharAttribsFromPool(SfxItemPool& rPool) const
+{
+CharAttribsType::const_iterator it = aPrevCharAttribs.begin(), itEnd = 
aPrevCharAttribs.end();
+for (; it != itEnd; ++it)
+rPool.Remove(*it->GetItem());
+}
+
+void ContentAttribsInfo::AppendCharAttrib(EditCharAttrib* pNew)
+{
+aPrevCharAttribs.push_back(pNew);
+}
 
 void ConvertItem( SfxPoolItem& rPoolItem, MapUnit eSourceUnit, MapUnit 
eDestUnit )
 {
diff --git a/editeng/source/editeng/editundo.cxx 
b/editeng/source/editeng/editundo.cxx
index 1b96e14..e29043b 100644
--- a/editeng/source/editeng/editundo.cxx
+++ b/editeng/source/editeng/editundo.cxx
@@ -549,13 +549,7 @@ EditUndoSetAttribs::~EditUndoSetAttribs()
 {
 ContentAttribsInfo* pInf = aPrevAttribs[n];
 DBG_ASSERT( pInf, "Undo_DTOR (SetAttribs): pInf = NULL!" );
-for ( sal_uInt16 nAttr = 0; nAttr < 
pInf->Ge

[Libreoffice-commits] .: 4 commits - editeng/source sw/source

2012-03-27 Thread Kohei Yoshida
 );
+_SaveRedlines aSaveRedl;
 SvPtrarr aSavRedlInsPosArr( 0 );
 if( DOC_MOVEREDLINES & eMvFlags && GetRedlineTbl().Count() )
 {
@@ -1212,7 +1208,7 @@ bool SwDoc::MoveNodeRange( SwNodeRange& rRange, 
SwNodeIndex& rPos,
 }
 }
 
-    if( aSaveRedl.Count() )
+if( !aSaveRedl.empty() )
 lcl_RestoreRedlines( this, aIdx.GetIndex(), aSaveRedl );
 
 if( pUndo )
commit 3670b2a2b15c5342562080630037e1959659da73
Author: Kohei Yoshida 
Date:   Tue Mar 27 14:27:02 2012 -0400

Let's hide stuff like this from header..

diff --git a/editeng/source/editeng/edtspell.cxx 
b/editeng/source/editeng/edtspell.cxx
index bf21be8..b3c9dbb 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -207,6 +207,8 @@ void EditSpellWrapper::CheckSpellTo()
 
 //
 
+#define NOT_INVALID 0x
+
 WrongList::WrongList() : nInvalidStart(0), nInvalidEnd(0x) {}
 
 WrongList::WrongList(const WrongList& r) :
@@ -216,6 +218,17 @@ WrongList::WrongList(const WrongList& r) :
 
 WrongList::~WrongList() {}
 
+bool WrongList::IsInvalid() const
+{
+return nInvalidStart != NOT_INVALID;
+}
+
+void WrongList::SetValid()
+{
+nInvalidStart = NOT_INVALID;
+nInvalidEnd = 0;
+}
+
 void WrongList::MarkInvalid( sal_uInt16 nS, sal_uInt16 nE )
 {
 if ( ( nInvalidStart == NOT_INVALID ) || ( nInvalidStart > nS ) )
diff --git a/editeng/source/editeng/edtspell.hxx 
b/editeng/source/editeng/edtspell.hxx
index 1b23b17..52d1bbd 100644
--- a/editeng/source/editeng/edtspell.hxx
+++ b/editeng/source/editeng/edtspell.hxx
@@ -81,8 +81,6 @@ struct WrongRange
 WrongRange( sal_uInt16 nS, sal_uInt16 nE ) { nStart = nS; nEnd = nE; }
 };
 
-#define NOT_INVALID 0x
-
 class WrongList
 {
 private:
@@ -100,8 +98,8 @@ public:
 WrongList(const WrongList& r);
 ~WrongList();
 
-sal_BoolIsInvalid() const   { return nInvalidStart != NOT_INVALID; 
}
-voidSetValid()  { nInvalidStart = NOT_INVALID; nInvalidEnd 
= 0; }
+boolIsInvalid() const;
+    voidSetValid();
 voidMarkInvalid( sal_uInt16 nS, sal_uInt16 nE );
 
 sal_uInt16  GetInvalidStart() const { return nInvalidStart; }
commit 80ecd30e1c7b753f2b24147e47204c97d253d394
Author: Kohei Yoshida 
Date:   Tue Mar 27 14:19:31 2012 -0400

It's cleaner to use copy ctor for cloning.

diff --git a/editeng/source/editeng/edtspell.cxx 
b/editeng/source/editeng/edtspell.cxx
index 13dcf28..bf21be8 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -207,15 +207,14 @@ void EditSpellWrapper::CheckSpellTo()
 
 //
 
-WrongList::WrongList()
-{
-nInvalidStart = 0;
-nInvalidEnd = 0x;
-}
+WrongList::WrongList() : nInvalidStart(0), nInvalidEnd(0x) {}
 
-WrongList::~WrongList()
-{
-}
+WrongList::WrongList(const WrongList& r) :
+maRanges(r.maRanges),
+nInvalidStart(r.nInvalidStart),
+nInvalidEnd(r.nInvalidEnd) {}
+
+WrongList::~WrongList() {}
 
 void WrongList::MarkInvalid( sal_uInt16 nS, sal_uInt16 nE )
 {
@@ -244,7 +243,7 @@ void WrongList::TextInserted( sal_uInt16 nPos, sal_uInt16 
nNew, sal_Bool bPosIsS
 
 for (size_t i = 0, n = maRanges.size(); i < n; ++i)
 {
-WrongRange & rWrong = maRanges[i]; // why does this thing derive 
vector?
+WrongRange& rWrong = maRanges[i];
 bool bRefIsValid = true;
 if (rWrong.nEnd >= nPos)
 {
@@ -477,11 +476,7 @@ void WrongList::MarkWrongsInvalid()
 
 WrongList* WrongList::Clone() const
 {
-WrongList* pNew = new WrongList;
-pNew->maRanges.reserve(maRanges.size());
-for (WrongList::const_iterator i = maRanges.begin(); i != maRanges.end(); 
++i)
-pNew->maRanges.push_back(*i);
-return pNew;
+return new WrongList(*this);
 }
 
 // #i102062#
diff --git a/editeng/source/editeng/edtspell.hxx 
b/editeng/source/editeng/edtspell.hxx
index 47dc59f..1b23b17 100644
--- a/editeng/source/editeng/edtspell.hxx
+++ b/editeng/source/editeng/edtspell.hxx
@@ -96,8 +96,9 @@ public:
 typedef std::vector::iterator iterator;
 typedef std::vector::const_iterator const_iterator;
 
-WrongList();
-~WrongList();
+WrongList();
+WrongList(const WrongList& r);
+    ~WrongList();
 
 sal_BoolIsInvalid() const   { return nInvalidStart != NOT_INVALID; 
}
 voidSetValid()  { nInvalidStart = NOT_INVALID; nInvalidEnd 
= 0; }
commit e747c9df0bcbc68935b0adf0eaa166ae1a1abe05
Author: Kohei Yoshida 
Date:   Tue Mar 27 14:13:47 2012 -0400

Publicly deriving from STL is not a good idea...

diff --git a/editeng/source/editeng/edtspell.cxx 
b/editeng/source/editeng/edtspell.cxx
index 2963f12..13dcf28 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -242,10 

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

2012-03-27 Thread Kohei Yoshida
 editeng/inc/editeng/flditem.hxx |   72 +++--
 editeng/source/items/flditem.cxx|   78 
 sc/source/filter/excel/xehelper.cxx |   12 ++---
 sc/source/filter/inc/xehelper.hxx   |2 
 svl/inc/svl/zforlist.hxx|4 +
 svl/source/numbers/zforlist.cxx |   12 +
 6 files changed, 100 insertions(+), 80 deletions(-)

New commits:
commit 1e91520e7af29c390c03d05b39992da5aaf6d1c7
Author: Kohei Yoshida 
Date:   Tue Mar 27 10:57:14 2012 -0400

UniString removal.

diff --git a/editeng/inc/editeng/flditem.hxx b/editeng/inc/editeng/flditem.hxx
index b54e37c..be874b0 100644
--- a/editeng/inc/editeng/flditem.hxx
+++ b/editeng/inc/editeng/flditem.hxx
@@ -144,8 +144,8 @@ public:
 
 // If eLanguage==LANGUAGE_DONTKNOW the 
language/country
 // used in number formatter initialization is 
taken.
-String  GetFormatted( SvNumberFormatter& rFormatter, 
LanguageType eLanguage ) const;
-static String   GetFormatted( Date& rDate, SvxDateFormat eFormat, 
SvNumberFormatter& rFormatter, LanguageType eLanguage );
+rtl::OUString   GetFormatted( SvNumberFormatter& rFormatter, 
LanguageType eLanguage ) const;
+static rtl::OUStringGetFormatted( Date& rDate, SvxDateFormat eFormat, 
SvNumberFormatter& rFormatter, LanguageType eLanguage );
 
 virtual SvxFieldData*   Clone() const;
 virtual int operator==( const SvxFieldData& ) const;
@@ -163,24 +163,24 @@ class EDITENG_DLLPUBLIC SvxURLField : public SvxFieldData
 {
 private:
 SvxURLFormateFormat;
-XubString   aURL;   // URL-Address
-XubString   aRepresentation;// What is shown
-XubString   aTargetFrame;   // In what Frame
+rtl::OUString   aURL;   // URL-Address
+rtl::OUString   aRepresentation;// What is shown
+rtl::OUString   aTargetFrame;   // In what Frame
 
 public:
 SV_DECL_PERSIST1( SvxURLField, SvxFieldData, 
SVX_URLFIELD )
 
 SvxURLField();
-SvxURLField( const XubString& rURL, const 
XubString& rRepres, SvxURLFormat eFmt = SVXURLFORMAT_URL );
+SvxURLField( const rtl::OUString& rURL, const 
rtl::OUString& rRepres, SvxURLFormat eFmt = SVXURLFORMAT_URL );
 
-const XubString&GetURL() const { return aURL; }
-voidSetURL( const XubString& rURL ) { aURL = rURL; }
+const rtl::OUString&GetURL() const { return aURL; }
+voidSetURL( const rtl::OUString& rURL ) { aURL = rURL; 
}
 
-const XubString&GetRepresentation() const { return 
aRepresentation; }
-voidSetRepresentation( const XubString& rRep ) { 
aRepresentation= rRep; }
+const rtl::OUString&GetRepresentation() const { return 
aRepresentation; }
+voidSetRepresentation( const rtl::OUString& rRep ) { 
aRepresentation= rRep; }
 
-const XubString&GetTargetFrame() const { return aTargetFrame; }
-voidSetTargetFrame( const XubString& rFrm ) { 
aTargetFrame = rFrm; }
+const rtl::OUString&GetTargetFrame() const { return aTargetFrame; }
+voidSetTargetFrame( const rtl::OUString& rFrm ) { 
aTargetFrame = rFrm; }
 
 SvxURLFormatGetFormat() const { return eFormat; }
 voidSetFormat( SvxURLFormat eFmt ) { eFormat = eFmt; }
@@ -281,8 +281,8 @@ public:
 
 // If eLanguage==LANGUAGE_DONTKNOW the 
language/country
 // used in number formatter initialization is 
taken.
-String  GetFormatted( SvNumberFormatter& rFormatter, 
LanguageType eLanguage ) const;
-static String   GetFormatted( Time& rTime, SvxTimeFormat eFormat, 
SvNumberFormatter& rFormatter, LanguageType eLanguage );
+rtl::OUString   GetFormatted( SvNumberFormatter& rFormatter, 
LanguageType eLanguage ) const;
+static rtl::OUStringGetFormatted( Time& rTime, SvxTimeFormat eFormat, 
SvNumberFormatter& rFormatter, LanguageType eLanguage );
 
 virtual SvxFieldData*   Clone() const;
 virtual int operator==( const SvxFieldData& ) const;
@@ -303,19 +303,19 @@ enum SvxFileFormat {SVXFILEFORMAT_NAME_EXT, // File 
name with Extension
 class EDITENG_DLLPUBLIC SvxExtFileField : public SvxFieldData
 {
 private:
-XubString   aFile;
+rtl::OUString   aFile;
 SvxFileType eType;
 SvxFileFormat   eFormat;
 
 public:
 SV_DECL_PERSIST1( SvxExtFileField, SvxFieldData, 
SVX_EXT_F

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

2012-03-26 Thread Kohei Yoshida
 editeng/source/items/flditem.cxx |   16 
 sc/source/ui/app/scdll.cxx   |6 +++---
 2 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit df827af160fa255c56b9aaef644a2d9c4680977d
Author: Kohei Yoshida 
Date:   Tue Mar 27 01:34:35 2012 -0400

Let's not use a macro for this...

diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index a182a36..58f6ab1 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -948,14 +948,14 @@ SvClassManager& SvxFieldItem::GetClassManager()
 if ( !pClassMgr )
 {
 pClassMgr = new SvClassManager;
-pClassMgr->SV_CLASS_REGISTER( SvxFieldData );
-pClassMgr->SV_CLASS_REGISTER( SvxURLField );
-pClassMgr->SV_CLASS_REGISTER( SvxDateField );
-pClassMgr->SV_CLASS_REGISTER( SvxPageField );
-pClassMgr->SV_CLASS_REGISTER( SvxTimeField );
-pClassMgr->SV_CLASS_REGISTER( SvxExtTimeField );
-pClassMgr->SV_CLASS_REGISTER( SvxExtFileField );
-pClassMgr->SV_CLASS_REGISTER( SvxAuthorField );
+pClassMgr->Register(SvxFieldData::StaticClassId(),
SvxFieldData::CreateInstance);
+pClassMgr->Register(SvxURLField::StaticClassId(), 
SvxURLField::CreateInstance);
+pClassMgr->Register(SvxDateField::StaticClassId(),
SvxDateField::CreateInstance);
+pClassMgr->Register(SvxPageField::StaticClassId(),
SvxPageField::CreateInstance);
+pClassMgr->Register(SvxTimeField::StaticClassId(),
SvxTimeField::CreateInstance);
+pClassMgr->Register(SvxExtTimeField::StaticClassId(), 
SvxExtTimeField::CreateInstance);
+pClassMgr->Register(SvxExtFileField::StaticClassId(), 
SvxExtFileField::CreateInstance);
+pClassMgr->Register(SvxAuthorField::StaticClassId(),  
SvxAuthorField::CreateInstance);
 }
 
 return *pClassMgr;
diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx
index 25712d4..2d9af16 100644
--- a/sc/source/ui/app/scdll.cxx
+++ b/sc/source/ui/app/scdll.cxx
@@ -295,9 +295,9 @@ void ScDLL::Init()
 //  Edit-Engine-Felder, soweit nicht schon in OfficeApplication::Init
 
 SvClassManager& rClassManager = SvxFieldItem::GetClassManager();
-rClassManager.SV_CLASS_REGISTER( SvxPagesField );
-rClassManager.SV_CLASS_REGISTER( SvxFileField );
-rClassManager.SV_CLASS_REGISTER( SvxTableField );
+rClassManager.Register(SvxPagesField::StaticClassId(), 
SvxPagesField::CreateInstance);
+rClassManager.Register(SvxFileField::StaticClassId(),  
SvxFileField::CreateInstance);
+rClassManager.Register(SvxTableField::StaticClassId(), 
SvxTableField::CreateInstance);
 
 SdrRegisterFieldClasses();  // SvDraw-Felder registrieren
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: editeng/inc

2012-03-26 Thread Kohei Yoshida
 editeng/inc/editeng/flditem.hxx |   12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 292d71f513ee2dd3c276f950ca561704b2deb11b
Author: Kohei Yoshida 
Date:   Mon Mar 26 22:02:36 2012 -0400

Translated German class description (thanks to Markus Mohrhard).

diff --git a/editeng/inc/editeng/flditem.hxx b/editeng/inc/editeng/flditem.hxx
index e911d41..b35cb54 100644
--- a/editeng/inc/editeng/flditem.hxx
+++ b/editeng/inc/editeng/flditem.hxx
@@ -57,13 +57,11 @@ public:
 virtual MetaAction* createEndComment() const;
 };
 
-/*
-[Description]
-In diesem Item wird ein Feld (SvxFieldData) gespeichert.
-Das Feld gehoert dem Item.
-Das Feld selbst wird durch eine Ableitung von SvxFieldData bestimmt. (RTTI)
-*/
-
+/**
+ * This item stores a field (SvxFieldData).  The field is controlled by or
+ * belongs to the item.  The field itself is determined by a derivation from
+ * SvxFieldData (RTTI)
+ */
 class EDITENG_DLLPUBLIC SvxFieldItem : public SfxPoolItem
 {
 private:
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 8 commits - chart2/source cui/source svx/inc svx/source

2012-03-26 Thread Kohei Yoshida
 chart2/source/controller/dialogs/dlg_ObjectProperties.cxx |   98 +-
 cui/source/inc/cuitabline.hxx |5 
 cui/source/tabpages/tpline.cxx|  523 +++---
 svx/inc/svx/gallery.hxx   |1 
 svx/source/gallery2/galexpl.cxx   |   17 
 5 files changed, 335 insertions(+), 309 deletions(-)

New commits:
commit c7b8b3482c50eb5de8d43acf036642dc684fe8d9
Author: Kohei Yoshida 
Date:   Mon Mar 26 16:17:36 2012 -0400

fdo#46942: Fix a regression caused by List removal.

3236c2c3af9355157c62f68fcbd429498f7f747b accidentally removed the gallery
item count which was used to differentiate the gallery symbols from
normal ones.

diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 1436c0a..ede160b 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -277,6 +277,7 @@ void SvxLineTabPage::InitSymbols(MenuButton* pButton)
 rtl::OUString aEmptyStr;
 const rtl::OUString *pUIName = NULL;
 sal_uInt32 i = 0;
+nNumMenuGalleryItems = aGrfNames.size();
 for(std::vector::iterator it = aGrfNames.begin(); it != 
aGrfNames.end(); ++it, ++i)
 {
 pUIName = &(*it);
commit 622a0ee58130a6c0e712f70eb5d6daed810a64f0
Author: Kohei Yoshida 
Date:   Mon Mar 26 15:18:52 2012 -0400

Move this into a real method also.

diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx
index 0bc07ff..6a0881c 100644
--- a/cui/source/inc/cuitabline.hxx
+++ b/cui/source/inc/cuitabline.hxx
@@ -197,6 +197,7 @@ private:
 sal_Bool FillXLSet_Impl();
 #endif
 
+void InitSymbols(MenuButton* pButton);
 void SymbolSelected(MenuButton* pButton);
 void FillListboxes();
 public:
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 255db52..1436c0a 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -265,6 +265,157 @@ void SvxLineTabPage::Construct()
 FillListboxes();
 }
 
+void SvxLineTabPage::InitSymbols(MenuButton* pButton)
+{
+//Popup initialisieren
+if(!pButton->GetPopupMenu()->GetPopupMenu( MN_GALLERY ))
+{
+// Gallery-Eintraege besorgen
+GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, aGrfNames);
+
+PopupMenu* pPopup = new PopupMenu;
+rtl::OUString aEmptyStr;
+const rtl::OUString *pUIName = NULL;
+sal_uInt32 i = 0;
+for(std::vector::iterator it = aGrfNames.begin(); it != 
aGrfNames.end(); ++it, ++i)
+{
+pUIName = &(*it);
+
+// convert URL encodings to UI characters (eg %20 for spaces)
+rtl::OUString aPhysicalName;
+if (utl::LocalFileHelper::ConvertURLToPhysicalName(*it, 
aPhysicalName))
+{
+pUIName = &aPhysicalName;
+}
+
+SvxBrushItem* pBrushItem = new SvxBrushItem(*it, aEmptyStr, 
GPOS_AREA, SID_ATTR_BRUSH);
+pBrushItem->SetDoneLink(STATIC_LINK(this, SvxLineTabPage, 
GraphicArrivedHdl_Impl));
+
+SvxBmpItemInfo* pInfo = new SvxBmpItemInfo();
+pInfo->pBrushItem = pBrushItem;
+pInfo->nItemId = (sal_uInt16)(MN_GALLERY_ENTRY + i);
+if ( i < aGrfBrushItems.size() ) {
+aGrfBrushItems.insert( aGrfBrushItems.begin() + i, pInfo );
+} else {
+aGrfBrushItems.push_back( pInfo );
+}
+const Graphic* pGraphic = pBrushItem->GetGraphic();
+
+if(pGraphic)
+{
+Bitmap aBitmap(pGraphic->GetBitmap());
+Size aSize(aBitmap.GetSizePixel());
+if(aSize.Width()  > MAX_BMP_WIDTH ||
+   aSize.Height() > MAX_BMP_HEIGHT)
+{
+sal_Bool bWidth = aSize.Width() > aSize.Height();
+double nScale = bWidth ?
+(double)MAX_BMP_WIDTH / 
(double)aSize.Width():
+(double)MAX_BMP_HEIGHT / 
(double)aSize.Height();
+aBitmap.Scale(nScale, nScale);
+
+}
+Image aImage(aBitmap);
+pPopup->InsertItem(pInfo->nItemId, *pUIName, aImage );
+}
+else
+{
+Image aImage;
+pPopup->InsertItem(pInfo->nItemId, *pUIName, aImage );
+}
+}
+aSymbolMB.GetPopupMenu()->SetPopupMenu( MN_GALLERY, pPopup );
+
+if(aGrfNames.empty())
+aSymbolMB.GetPopupMenu()->EnableItem(MN_GALLERY, sal_False);
+}
+
+if(!pButton->GetPopupMenu()->GetPopupMenu( MN_SYMBOLS ) && pSymbolList)
+{
+VirtualDevice aVDev;
+aVDev.SetMapMode(MapMode(MAP_100TH_MM));
+SdrModel* pModel = new SdrMo

[Libreoffice-commits] .: sw/source

2012-03-26 Thread Kohei Yoshida
 sw/source/core/inc/frmtool.hxx |2 +-
 sw/source/core/layout/calcmove.cxx |4 ++--
 sw/source/core/layout/fly.cxx  |   10 +-
 sw/source/core/layout/frmtool.cxx  |   16 
 sw/source/core/layout/laycache.cxx |4 ++--
 sw/source/core/layout/pagechg.cxx  |4 ++--
 sw/source/core/layout/tabfrm.cxx   |6 +++---
 sw/source/core/text/txtfly.cxx |2 +-
 8 files changed, 24 insertions(+), 24 deletions(-)

New commits:
commit 19648377e1e4ad5c8c342dc45aeaca83f91b4b27
Author: Nicolas Christener 
Date:   Wed Mar 21 23:26:30 2012 +0100

Rename WEIT_WECH to FAR_AWAY

diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index ba1b0f4..e31d8b9 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -56,7 +56,7 @@ struct SwFindRowSpanCacheObj;
 #define MA_FASTCALL
 #endif
 
-#define WEIT_WECH   LONG_MAX - 2//Initale Position der Flys.
+#define FAR_AWAY   LONG_MAX - 2//Initale Position der Flys.
 #define BROWSE_HEIGHT   56700L * 10L   //10 Meter
 
 #define GRFNUM_NO 0
diff --git a/sw/source/core/layout/calcmove.cxx 
b/sw/source/core/layout/calcmove.cxx
index 33e6722..eeccc20 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -669,7 +669,7 @@ void lcl_CheckObjects( SwSortedObjs* pSortedObjs, SwFrm* 
pFrm, long& rBot )
 if ( pObj->ISA(SwFlyFrm) )
 {
 SwFlyFrm *pFly = static_cast(pObj);
-if( pFly->Frm().Top() != WEIT_WECH &&
+if( pFly->Frm().Top() != FAR_AWAY &&
 ( pFrm->IsPageFrm() ? pFly->IsFlyLayFrm() :
   ( pFly->IsFlyAtCntFrm() &&
 ( pFrm->IsBodyFrm() ? pFly->GetAnchorFrm()->IsInDocBody() :
@@ -1012,7 +1012,7 @@ sal_Bool SwCntntFrm::MakePrtArea( const SwBorderAttrs 
&rAttrs )
 SwAnchoredObject* pObj = (*GetDrawObjs())[i];
 const SwFrmFmt& rFmt = pObj->GetFrmFmt();
 const sal_Bool bFly = pObj->ISA(SwFlyFrm);
-if ((bFly && (WEIT_WECH == pObj->GetObjRect().Width()))
+if ((bFly && (FAR_AWAY == pObj->GetObjRect().Width()))
 || rFmt.GetFrmSize().GetWidthPercent())
 {
 continue;
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index b6e7b1f..cc7c170 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -192,7 +192,7 @@ SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm 
*pAnch ) :
 
 //Und erstmal in den Wald stellen die Kiste, damit bei neuen Dokument nicht
 //unnoetig viel formatiert wird.
-Frm().Pos().X() = Frm().Pos().Y() = WEIT_WECH;
+Frm().Pos().X() = Frm().Pos().Y() = FAR_AWAY;
 }
 
 // OD 2004-01-19 #110582#
@@ -1339,7 +1339,7 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs )
 
 if ( !bValidSize )
 {
-if ( Frm().Top() == WEIT_WECH && Frm().Left() == WEIT_WECH )
+if ( Frm().Top() == FAR_AWAY && Frm().Left() == FAR_AWAY )
 {
 //Sicherheitsschaltung wegnehmen (siehe SwFrm::CTor)
 Frm().Pos().X() = Frm().Pos().Y() = 0;
@@ -1414,7 +1414,7 @@ void SwFlyFrm::Format( const SwBorderAttrs *pAttrs )
 // OD 06.11.2003 #i22305# - consider
 // only Writer fly frames, which follow the text 
flow.
 if ( pFly->IsFlyLayFrm() &&
- pFly->Frm().Top() != WEIT_WECH &&
+ pFly->Frm().Top() != FAR_AWAY &&
  
pFly->GetFmt()->GetFollowTextFlow().GetValue() )
 {
 SwTwips nDist = -(pFly->Frm().*fnRect->
@@ -2149,7 +2149,7 @@ void SwFrm::AppendFly( SwFlyFrm *pNew )
 SwPageFrm *pPage = FindPageFrm();
 if ( pPage )
 {
-if ( pNew->IsFlyAtCntFrm() && pNew->Frm().Top() == WEIT_WECH )
+if ( pNew->IsFlyAtCntFrm() && pNew->Frm().Top() == FAR_AWAY )
 {
 //Versuch die Seitenformatierung von neuen Dokumenten etwas
 //guenstiger zu gestalten.
@@ -2424,7 +2424,7 @@ void SwLayoutFrm::NotifyLowerObjs( const bool 
_bUnlockPosOfObjs )
 {
 SwFlyFrm* pFly = static_cast(pObj);
 
-if ( pFly->Frm().Left() == WEIT_WECH )
+if ( pFly->Frm().Left() == FAR_AWAY )
 continue;
 
 if ( pFly->IsAnLower( this ) )
diff --git a/sw/source/core/layout/frmtool.cxx 
b/sw/source/core/layout/frmtool.cxx
index c19dbf7..fe42863 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -692,7 +692,7 @@ SwFlyNotify::~SwFlyNotify()
 {
 pFly->NotifyDrawObj();
 }
-if ( bPosChgd && aFrm.Pos().X() != WEIT_WECH )
+if ( bPosChgd && aFrm.Pos().X() != FAR_AWAY )
 {

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

2012-03-23 Thread Kohei Yoshida
 sc/inc/dpgroup.hxx |   33 +---
 sc/source/core/data/dpdimsave.cxx  |4 -
 sc/source/core/data/dpgroup.cxx|   99 ++---
 sc/source/filter/excel/xepivot.cxx |2 
 4 files changed, 25 insertions(+), 113 deletions(-)

New commits:
commit 16bbecab811a7ea95439bcbdf99050f766d18a9d
Author: Kohei Yoshida 
Date:   Sat Mar 24 00:13:30 2012 -0400

ScDPDateGroupHelper class is no more.

diff --git a/sc/inc/dpgroup.hxx b/sc/inc/dpgroup.hxx
index fadb830..fe5fd62 100644
--- a/sc/inc/dpgroup.hxx
+++ b/sc/inc/dpgroup.hxx
@@ -41,28 +41,6 @@
 class ScDocument;
 class SvNumberFormatter;
 
-//  ScDPDateGroupHelper is used as part of ScDPGroupDimension (additional dim.)
-//  or ScDPNumGroupDimension (innermost, replaces the original dim.).
-//  Source index, name and result collection are stored at the parent.
-
-class ScDPDateGroupHelper
-{
-ScDPNumGroupInfoaNumInfo;   // only start and end (incl. auto 
flags) are used
-sal_Int32   nDatePart;  // single part
-longmnGroupDim;
-
-public:
-ScDPDateGroupHelper( const ScDPNumGroupInfo& rInfo, long nDim, 
sal_Int32 nPart );
-~ScDPDateGroupHelper();
-
-void SetGroupDim(long nDim);
-
-sal_Int32   GetDatePart() const { return nDatePart; }
-const ScDPNumGroupInfo& GetNumInfo() const { return aNumInfo; }
-
-void FillColumnEntries(const ScDPCache* pCache, std::vector& 
rEntries) const;
-};
-
 typedef ::std::vector ScDPItemDataVec;
 
 class ScDPGroupItem
@@ -90,9 +68,9 @@ class ScDPGroupDimension
 longnSourceDim;
 longnGroupDim;
 rtl::OUString   aGroupName;
-ScDPDateGroupHelper*pDateHelper;
 ScDPGroupItemVecaItems;
-   mutable  ::std::vector< SCROW >maMemberEntries;
+mutable std::vector maMemberEntries;
+bool mbDateDimension;
 public:
 ScDPGroupDimension( long nSource, const String& rNewName );
 ScDPGroupDimension( const ScDPGroupDimension& rOther );
@@ -112,12 +90,11 @@ public:
 const ScDPGroupItem* GetGroupForName( const ScDPItemData& rName ) const;  
// rName = entry in group dim.
 const ScDPGroupItem* GetGroupByIndex( size_t nIndex ) const;
 
-voidMakeDateHelper( const ScDPNumGroupInfo& rInfo, sal_Int32 nPart 
);
-
 voidDisposeData();
 
 size_t  GetItemCount() const { return aItems.size(); }
 
+void SetDateDimension();
 bool IsDateDimension() const;
 };
 
@@ -126,8 +103,8 @@ typedef ::std::vector 
ScDPGroupDimensionVec;
 class SC_DLLPUBLIC ScDPNumGroupDimension
 {
 mutable ScDPNumGroupInfoaGroupInfo; // settings
-ScDPDateGroupHelper*pDateHelper;
 mutable std::vector  maMemberEntries;
+bool mbDateDimension;
 
 public:
 ScDPNumGroupDimension();
@@ -141,7 +118,7 @@ public:
 
 const std::vector& GetNumEntries(SCCOL nSourceDim, const ScDPCache* 
pCache) const;
 
-void MakeDateHelper( const ScDPNumGroupInfo& rInfo, long nDim, sal_Int32 
nPart );
+void SetDateDimension();
 
 voidDisposeData();
 
diff --git a/sc/source/core/data/dpdimsave.cxx 
b/sc/source/core/data/dpdimsave.cxx
index 30ddd74..80257be 100644
--- a/sc/source/core/data/dpdimsave.cxx
+++ b/sc/source/core/data/dpdimsave.cxx
@@ -379,7 +379,7 @@ void ScDPSaveGroupDimension::AddToData( ScDPGroupTableData& 
rData ) const
 {
 // date grouping
 
-aDim.MakeDateHelper( aDateInfo, nDatePart );
+aDim.SetDateDimension();
 }
 else
 {
@@ -459,7 +459,7 @@ void ScDPSaveNumGroupDimension::AddToData( 
ScDPGroupTableData& rData ) const
 {
 ScDPNumGroupDimension aDim( aGroupInfo );   // aGroupInfo: 
value grouping
 if ( nDatePart )
-aDim.MakeDateHelper( aDateInfo, nSource, nDatePart );// date 
grouping
+aDim.SetDateDimension();
 
 rData.SetNumGroupDimension( nSource, aDim );
 }
diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx
index 5f8865c..a129fec 100644
--- a/sc/source/core/data/dpgroup.cxx
+++ b/sc/source/core/data/dpgroup.cxx
@@ -240,19 +240,6 @@ bool ScDPGroupDateFilter::match( const ScDPItemData & 
rCellData ) const
 
 return false;
 }
-// ---
-
-ScDPDateGroupHelper::ScDPDateGroupHelper(
-const ScDPNumGroupInfo& rInfo, long nDim, sal_Int32 nPart ) :
-aNumInfo( rInfo ),
-nDatePart( nPart ),
-mnGroupDim(nDim)
-{
-}
-
-ScDPDateGroupHelper::~ScDPDateGroupHelper()
-{
-}
 
 namespace {
 
@@ -304,18 +291,6 @@ bool isDateInGroup(const ScDPItemData& rGroupItem, const 
ScDPItemData& rChildIte
 
 }
 
-void ScDPDateGroupHelper::SetGroupDim(long nDim)
-{
-mnGroupDim = nDim;
-}
-
-void ScDPDateGr

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

2012-03-23 Thread Kohei Yoshida
 sc/inc/dpgroup.hxx  |4 ---
 sc/source/core/data/dpgroup.cxx |   50 +---
 2 files changed, 27 insertions(+), 27 deletions(-)

New commits:
commit 7a1401e953e10194a7d693e590dc4e6c34a37ec4
Author: Kohei Yoshida 
Date:   Fri Mar 23 23:49:43 2012 -0400

More on avoiding use of date helper.

diff --git a/sc/inc/dpgroup.hxx b/sc/inc/dpgroup.hxx
index eb46685..fadb830 100644
--- a/sc/inc/dpgroup.hxx
+++ b/sc/inc/dpgroup.hxx
@@ -112,8 +112,6 @@ public:
 const ScDPGroupItem* GetGroupForName( const ScDPItemData& rName ) const;  
// rName = entry in group dim.
 const ScDPGroupItem* GetGroupByIndex( size_t nIndex ) const;
 
-const ScDPDateGroupHelper* GetDateHelper() const{ return pDateHelper; }
-
 voidMakeDateHelper( const ScDPNumGroupInfo& rInfo, sal_Int32 nPart 
);
 
 voidDisposeData();
@@ -141,8 +139,6 @@ public:
 
 const ScDPNumGroupInfo& GetInfo() const { return aGroupInfo; }
 
-const ScDPDateGroupHelper* GetDateHelper() const{ return pDateHelper; }
-
 const std::vector& GetNumEntries(SCCOL nSourceDim, const ScDPCache* 
pCache) const;
 
 void MakeDateHelper( const ScDPNumGroupInfo& rInfo, long nDim, sal_Int32 
nPart );
diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx
index 872ddfc..5f8865c 100644
--- a/sc/source/core/data/dpgroup.cxx
+++ b/sc/source/core/data/dpgroup.cxx
@@ -722,6 +722,7 @@ void 
ScDPGroupTableData::ModifyFilterCriteria(vector&
 
 // Go through all the filtered field names and process them appropriately.
 
+const ScDPCache* pCache = GetCacheTable().getCache();
 vector::const_iterator itrEnd = rCriteria.end();
 GroupFieldMapType::const_iterator itrGrpEnd = aGroupFieldIds.end();
 for (vector::const_iterator itr = 
rCriteria.begin(); itr != itrEnd; ++itr)
@@ -740,20 +741,23 @@ void 
ScDPGroupTableData::ModifyFilterCriteria(vector&
 ScDPCacheTable::Criterion aCri;
 aCri.mnFieldIndex = itr->mnFieldIndex;
 const ScDPNumGroupDimension& rNumGrpDim = 
pNumGroups[itr->mnFieldIndex];
-const ScDPDateGroupHelper* pDateHelper = 
rNumGrpDim.GetDateHelper();
+const ScDPNumGroupInfo* pNumInfo = 
pCache->GetNumGroupInfo(itr->mnFieldIndex);
 
-if (pDateHelper)
-{
-// grouped by dates.
-aCri.mpFilter.reset(
-new ScDPGroupDateFilter(
-pFilter->getMatchValue(), 
*pDoc->GetFormatTable()->GetNullDate(), pDateHelper->GetNumInfo()));
-}
-else
+if (pNumInfo)
 {
-// This dimension is grouped by numeric ranges.
-aCri.mpFilter.reset(
-new ScDPGroupNumFilter(pFilter->getMatchValue(), 
rNumGrpDim.GetInfo()));
+if (rNumGrpDim.IsDateDimension())
+{
+// grouped by dates.
+aCri.mpFilter.reset(
+new ScDPGroupDateFilter(
+pFilter->getMatchValue(), 
*pDoc->GetFormatTable()->GetNullDate(), *pNumInfo));
+}
+else
+{
+// This dimension is grouped by numeric ranges.
+aCri.mpFilter.reset(
+new ScDPGroupNumFilter(pFilter->getMatchValue(), 
*pNumInfo));
+}
 }
 
 aNewCriteria.push_back(aCri);
@@ -770,16 +774,17 @@ void 
ScDPGroupTableData::ModifyFilterCriteria(vector&
 
 const ScDPGroupDimension* pGrpDim = itrGrp->second;
 long nSrcDim = pGrpDim->GetSourceDim();
-const ScDPDateGroupHelper* pDateHelper = pGrpDim->GetDateHelper();
+long nGrpDim = pGrpDim->GetGroupDim();
+const ScDPNumGroupInfo* pNumInfo = 
pCache->GetNumGroupInfo(nGrpDim);
 
-if (pDateHelper)
+if (pGrpDim->IsDateDimension() && pNumInfo)
 {
 // external number group
 ScDPCacheTable::Criterion aCri;
 aCri.mnFieldIndex = nSrcDim;  // use the source dimension, not 
the group dimension.
 aCri.mpFilter.reset(
 new ScDPGroupDateFilter(
-pFilter->getMatchValue(), 
*pDoc->GetFormatTable()->GetNullDate(), pDateHelper->GetNumInfo()));
+pFilter->getMatchValue(), 
*pDoc->GetFormatTable()->GetNullDate(), *pNumInfo));
 
 aNewCriteria.push_back(aCri);
 }
@@ -960,14 +965,14 @@ sal_Bool ScDPGroupTableData::IsNumOrDateGroup(long 
nDimension) const
 if ( nDimension < nSourceCou

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

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

New commits:
commit 62cd23f0cf538dccc30f1a38578d4c5925703029
Author: Markus Mohrhard 
Date:   Fri Mar 23 22:54:12 2012 +0100

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

Signed-off-by: Kohei Yoshida 

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] .: Branch 'libreoffice-3-5' - sc/source

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

New commits:
commit 9e00196c1a59eef1889f561e2c9891fdc280a333
Author: Markus Mohrhard 
Date:   Fri Mar 23 02:05:36 2012 +0100

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

Signed-off-by: Kohei Yoshida 

diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx
index 71d8114..7137f90 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&);
@@ -244,6 +245,7 @@ ScMatrixImpl::ScMatrixImpl(SCSIZE nC, SCSIZE nR, 
ScMatrix::DensityType eType) :
 pErrorInterpreter(NULL),
 mbCloneIfConst(true)
 {
+maCachedSize = maMat.size();
 }
 
 ScMatrixImpl::~ScMatrixImpl()
@@ -254,6 +256,7 @@ ScMatrixImpl::~ScMatrixImpl()
 void ScMatrixImpl::Clear()
 {
 maMat.clear();
+maCachedSize = maMat.size();
 }
 
 void ScMatrixImpl::SetImmutable(bool bVal)
@@ -269,6 +272,7 @@ bool ScMatrixImpl::IsImmutable() const
 void ScMatrixImpl::Resize(SCSIZE nC, SCSIZE nR)
 {
 maMat.resize(nR, nC);
+maCachedSize = maMat.size();
 }
 
 ScMatrix::DensityType ScMatrixImpl::GetDensityType() const
@@ -283,21 +287,18 @@ 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;
 }
 
 SCSIZE ScMatrixImpl::CalcOffset( SCSIZE nC, SCSIZE nR) const
@@ -307,21 +308,19 @@ SCSIZE ScMatrixImpl::CalcOffset( SCSIZE nC, SCSIZE nR) 
const
 
 bool ScMatrixImpl::ValidColRowReplicated( SCSIZE & rC, SCSIZE & rR ) const
 {
-pair 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;
@@ -645,8 +644,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");
@@ -654,12 +652,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 )
@@ -726,8 +726,7 @@ template 
 bool EvalMatrix(const MatrixImplType& rMat)
 {
 _Evaluator aEval;
-pair 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)
@@ -917,7 +916,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] .: 10 commits - sc/inc sc/source

2012-03-23 Thread Kohei Yoshida
 sc/inc/dpcache.hxx |   12 +++
 sc/inc/dpgroup.hxx |   12 +++
 sc/inc/dpitemdata.hxx  |5 -
 sc/inc/dpmacros.hxx|   36 ++
 sc/inc/dpnumgroupinfo.hxx  |5 +
 sc/inc/dpobject.hxx|6 +
 sc/inc/dptabdat.hxx|8 ++
 sc/inc/dptabres.hxx|   14 ++--
 sc/source/core/data/dpcache.cxx|  109 +++--
 sc/source/core/data/dpdimsave.cxx  |6 -
 sc/source/core/data/dpgroup.cxx|   60 +-
 sc/source/core/data/dpitemdata.cxx |2 
 sc/source/core/data/dpnumgroupinfo.cxx |   18 +
 sc/source/core/data/dpobject.cxx   |   22 +-
 sc/source/core/data/dpsave.cxx |2 
 sc/source/core/data/dptabdat.cxx   |   10 ++-
 sc/source/core/data/dptabres.cxx   |   18 ++---
 sc/source/ui/docshell/dbdocfun.cxx |8 --
 sc/source/ui/inc/dbfunc.hxx|6 +
 sc/source/ui/view/dbfunc3.cxx  |   13 ++-
 20 files changed, 300 insertions(+), 72 deletions(-)

New commits:
commit d9cc468b307d1f1e18d9561c4dbaf0a744ababa9
Author: Kohei Yoshida 
Date:   Fri Mar 23 22:15:39 2012 -0400

Let's just centrally reload group data in DataPilotUpdate()...

It's a no-op when there is no group dimensions anyways.

diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index 7e392d5..5bc66c9 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1327,6 +1327,7 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, 
const ScDPObject* pNewOb
 if ( pNewObj == pOldObj && pDestObj->IsImportData() )
 pDestObj->ClearTableData();
 
+pDestObj->ReloadGroupTableData();
 pDestObj->InvalidateData(); // before getting the 
new output area
 
 //  make sure the table has a name (not set by dialog)
@@ -1474,9 +1475,6 @@ sal_uLong ScDBDocFunc::RefreshPivotTables(ScDPObject* 
pDPObj, bool bApi)
 for (; it != itEnd; ++it)
 {
 ScDPObject* pObj = *it;
-if (bHasGroups)
-// Re-build table data for each pivot table when the original 
contains group fields.
-pObj->ReloadGroupTableData();
 
 // This action is intentionally not undoable since it modifies cache.
 DataPilotUpdate(pObj, pObj, false, bApi);
@@ -1515,7 +1513,6 @@ void ScDBDocFunc::RefreshPivotTableGroups(ScDPObject* 
pDPObj)
 pSaveData->SetDimensionData(pDimData);
 }
 
-pObj->ReloadGroupTableData();
 // This action is intentionally not undoable since it modifies cache.
 DataPilotUpdate(pObj, pObj, false, false);
 }
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 9a3faeb..e8bfb3f 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -665,7 +665,6 @@ bool ScDBFunc::MakePivotTable(
 bool bAllowMove = (pDPObj != NULL);   // allow re-positioning when editing 
existing table
 
 ScDBDocFunc aFunc( *pDocSh );
-pDPObj->ReloadGroupTableData();
 bool bSuccess = aFunc.DataPilotUpdate(pDPObj, &aObj, true, false, 
bAllowMove);
 
 CursorPosChanged(); // shells may be switched
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 694324f..bf3402c 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -599,7 +599,6 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu()
 }
 pDim->UpdateMemberVisibility(aResult);
 
-pDPObj->ReloadGroupTableData();
 ScDBDocFunc aFunc(*pViewData->GetDocShell());
 aFunc.DataPilotUpdate(pDPObj, pDPObj, true, false);
 }
commit 16168d7d589d22b1efd2a666d08d96233783457f
Author: Kohei Yoshida 
Date:   Fri Mar 23 22:05:03 2012 -0400

We don't need date helper in FillGroupValues().

diff --git a/sc/inc/dpgroup.hxx b/sc/inc/dpgroup.hxx
index b9271fd..eb46685 100644
--- a/sc/inc/dpgroup.hxx
+++ b/sc/inc/dpgroup.hxx
@@ -89,7 +89,7 @@ class ScDPGroupDimension
 {
 longnSourceDim;
 longnGroupDim;
-String  aGroupName;
+rtl::OUString   aGroupName;
 ScDPDateGroupHelper*pDateHelper;
 ScDPGroupItemVecaItems;
mutable  ::std::vector< SCROW >maMemberEntries;
@@ -105,7 +105,7 @@ public:
 
 longGetSourceDim() const{ return nSourceDim; }
 longGetGroupDim() const { return nGroupDim; }
-const  String& GetName() const   { return aGroupName; }
+const rtl::OUString& GetName() const { return aGroupName; }
 
 const std::vector< SCROW >&  GetColumnEntries( const ScDPCacheTable&  
rCacheTable ) const;
 const ScDPGroupItem* GetGroupF

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

2012-03-23 Thread Kohei Yoshida
 sc/inc/globstr.hrc|3 ++-
 sc/source/ui/src/globstr.src  |4 
 sc/source/ui/view/dbfunc3.cxx |3 +--
 3 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 35fe6b9587a22e9faa669ebab05bf577f09a3438
Author: Kohei Yoshida 
Date:   Fri Mar 23 10:36:32 2012 -0400

Localize the group prefix for pivot table defult group names.

diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc
index 5157eb6..b02d250 100644
--- a/sc/inc/globstr.hrc
+++ b/sc/inc/globstr.hrc
@@ -599,8 +599,9 @@
 
 #define STR_UNSAVED_EXT_REF 465
 #define STR_CLOSE_WITH_UNSAVED_REFS 466
+#define STR_PIVOT_GROUP 467
 
-#define STR_COUNT   467
+#define STR_COUNT   468
 
 
 #endif
diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src
index 164e12d..dcc4adb 100644
--- a/sc/source/ui/src/globstr.src
+++ b/sc/source/ui/src/globstr.src
@@ -553,6 +553,10 @@ Resource RID_GLOBSTR
 {
 Text [ en-US ] = "Data" ;
 };
+String STR_PIVOT_GROUP
+{
+Text [ en-US ] = "Group" ;
+};
 String STR_PIVOTFUNC_SUM
 {
 Text [ en-US ] = "SUM" ;
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index f6eb887..6742928 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -1221,8 +1221,7 @@ void ScDBFunc::GroupDataPilot()
 }
 rtl::OUString aGroupDimName = pGroupDimension->GetGroupDimName();
 
-//! localized prefix string
-rtl::OUString aGroupName = pGroupDimension->CreateGroupName( 
String::CreateFromAscii("Group") );
+rtl::OUString aGroupName = 
pGroupDimension->CreateGroupName(ScGlobal::GetRscString(STR_PIVOT_GROUP));
 ScDPSaveGroupItem aGroup( aGroupName );
 ScDPUniqueStringSet::const_iterator it = aEntries.begin(), itEnd = 
aEntries.end();
 for (; it != itEnd; ++it)
___
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-03-23 Thread Kohei Yoshida
 sc/source/filter/html/htmlexp.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 2ccb55183e1131039f062abbbd95caf1451c5efe
Author: Markus Mohrhard 
Date:   Fri Mar 23 04:27:45 2012 +0100

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

Signed-off-by: Kohei Yoshida 

diff --git a/sc/source/filter/html/htmlexp.cxx 
b/sc/source/filter/html/htmlexp.cxx
index 0e8fee9..16f4826 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -777,7 +777,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] .: sc/qa

2012-03-22 Thread Kohei Yoshida
 sc/qa/unit/ucalc.cxx |  102 ---
 1 file changed, 49 insertions(+), 53 deletions(-)

New commits:
commit e4380ae1e7d5330e26f4a382f3a86a6059b9b53f
Author: Kohei Yoshida 
Date:   Thu Mar 22 23:15:07 2012 -0400

Test for changing dimension member visibility & a little cleanup.

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index cb6ab44..965424f 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -1297,6 +1297,17 @@ ScDPObject* createDPFromRange(
 return createDPFromSourceDesc(pDoc, aSheetDesc, aFields, nFieldCount, 
bFilterButton);
 }
 
+ScRange refresh(ScDPObject* pDPObj)
+{
+bool bOverFlow = false;
+ScRange aOutRange = pDPObj->GetNewOutputRange(bOverFlow);
+CPPUNIT_ASSERT_MESSAGE("Table overflow!?", !bOverFlow);
+
+pDPObj->Output(aOutRange.aStart);
+aOutRange = pDPObj->GetOutRange();
+return aOutRange;
+}
+
 ScRange refreshGroups(ScDPCollection* pDPs, ScDPObject* pDPObj)
 {
 // We need to first create group data in the cache, then the group data in
@@ -1307,13 +1318,7 @@ ScRange refreshGroups(ScDPCollection* pDPs, ScDPObject* 
pDPObj)
 CPPUNIT_ASSERT_MESSAGE("There should be only one table linked to this 
cache.", aRefs.size() == 1);
 pDPObj->ReloadGroupTableData();
 
-bool bOverFlow = false;
-ScRange aOutRange = pDPObj->GetNewOutputRange(bOverFlow);
-CPPUNIT_ASSERT_MESSAGE("Table overflow!?", !bOverFlow);
-
-pDPObj->Output(aOutRange.aStart);
-aOutRange = pDPObj->GetOutRange();
-return aOutRange;
+return refresh(pDPObj);
 }
 
 class AutoCalcSwitch
@@ -1554,13 +1559,7 @@ void Test::testPivotTableLabels()
pDPs->GetCount() == 1);
 pDPObj->SetName(pDPs->CreateNewName());
 
-bool bOverFlow = false;
-ScRange aOutRange = pDPObj->GetNewOutputRange(bOverFlow);
-CPPUNIT_ASSERT_MESSAGE("Table overflow!?", !bOverFlow);
-
-pDPObj->Output(aOutRange.aStart);
-aOutRange = pDPObj->GetOutRange();
-
+ScRange aOutRange = refresh(pDPObj);
 {
 // Expected output table content.  0 = empty cell
 const char* aOutputCheck[][5] = {
@@ -1616,13 +1615,7 @@ void Test::testPivotTableDateLabels()
pDPs->GetCount() == 1);
 pDPObj->SetName(pDPs->CreateNewName());
 
-bool bOverFlow = false;
-ScRange aOutRange = pDPObj->GetNewOutputRange(bOverFlow);
-CPPUNIT_ASSERT_MESSAGE("Table overflow!?", !bOverFlow);
-
-pDPObj->Output(aOutRange.aStart);
-aOutRange = pDPObj->GetOutRange();
-
+ScRange aOutRange = refresh(pDPObj);
 {
 // Expected output table content.  0 = empty cell
 const char* aOutputCheck[][5] = {
@@ -1705,12 +1698,7 @@ void Test::testPivotTableFilters()
pDPs->GetCount() == 1);
 pDPObj->SetName(pDPs->CreateNewName());
 
-bool bOverFlow = false;
-ScRange aOutRange = pDPObj->GetNewOutputRange(bOverFlow);
-CPPUNIT_ASSERT_MESSAGE("Table overflow!?", !bOverFlow);
-
-pDPObj->Output(aOutRange.aStart);
-aOutRange = pDPObj->GetOutRange();
+ScRange aOutRange = refresh(pDPObj);
 {
 // Expected output table content.  0 = empty cell
 const char* aOutputCheck[][2] = {
@@ -1743,8 +1731,7 @@ void Test::testPivotTableFilters()
 OUString aPage(RTL_CONSTASCII_USTRINGPARAM("A"));
 pDim->SetCurrentPage(&aPage);
 pDPObj->SetSaveData(aSaveData);
-pDPObj->Output(aOutRange.aStart);
-aOutRange = pDPObj->GetOutRange();
+aOutRange = refresh(pDPObj);
 {
 // Expected output table content.  0 = empty cell
 const char* aOutputCheck[][2] = {
@@ -1773,8 +1760,7 @@ void Test::testPivotTableFilters()
 rEntry.GetQueryItem().mfVal = 1;
 aDesc.SetQueryParam(aQueryParam);
 pDPObj->SetSheetDesc(aDesc);
-pDPObj->Output(aOutRange.aStart);
-aOutRange = pDPObj->GetOutRange();
+aOutRange = refresh(pDPObj);
 {
 // Expected output table content.  0 = empty cell
 const char* aOutputCheck[][2] = {
@@ -1852,12 +1838,7 @@ void Test::testPivotTableNamedSource()
pDPs->GetCount() == 1);
 pDPObj->SetName(pDPs->CreateNewName());
 
-bool bOverFlow = false;
-ScRange aOutRange = pDPObj->GetNewOutputRange(bOverFlow);
-CPPUNIT_ASSERT_MESSAGE("Table overflow!?", !bOverFlow);
-
-pDPObj->Output(aOutRange.aStart);
-aOutRange = pDPObj->GetOutRange();
+ScRange aOutRange = refresh(pDPObj);
 {
 // Expected output table content.  0 = empty cell
 const char* aOutputCheck[][5] = {
@@ -2111,12 +2092,7 @@ void Test::testPivotTableDuplicateDataFields()
pDPs->GetCount() == 1);
 pDPObj->SetName(pDPs->CreateNewName());
 
-bool bOverFlow

[Libreoffice-commits] .: sc/source

2012-03-22 Thread Kohei Yoshida
 sc/source/core/data/dpobject.cxx   |3 +++
 sc/source/ui/docshell/dbdocfun.cxx |2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 76e533a5c6a54ffbbb98880d966e5b060e9626b6
Author: Kohei Yoshida 
Date:   Thu Mar 22 22:38:56 2012 -0400

More bug fixes related to grouped dimension handling.

diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 2f0e510..9e7af6d 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -564,6 +564,9 @@ void ScDPObject::ReloadGroupTableData()
 // No dimension data. Most likey it doesn't have any group dimensions.
 return;
 
+if (!mpTableData)
+return;
+
 ScDPGroupTableData* pData = 
dynamic_cast(mpTableData.get());
 if (pData)
 {
diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index afb3513..6339e5f 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1328,7 +1328,7 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, 
const ScDPObject* pNewOb
 pDestObj->ClearTableData();
 
 if (pDestObj->HasGroups())
-pDestObj->ClearTableData();
+pDestObj->ReloadGroupTableData();
 
 pDestObj->InvalidateData(); // before getting the 
new output area
 
___
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-22 Thread Kohei Yoshida
 sc/inc/dpobject.hxx|1 +
 sc/source/core/data/dpobject.cxx   |   12 
 sc/source/core/data/dpsave.cxx |2 +-
 sc/source/ui/docshell/dbdocfun.cxx |3 +++
 sc/source/ui/view/gridwin2.cxx |7 +++
 5 files changed, 20 insertions(+), 5 deletions(-)

New commits:
commit 1d8b583b0676f9c9eed8efd092445908ebea26d9
Author: Kohei Yoshida 
Date:   Thu Mar 22 22:20:04 2012 -0400

Get correct string value for group item value.

Unlike the old version, the new version no longer stores string value
for non-string items.  We need to call GetFormattedString() for that.

diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index e112e6c..5255b72 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -1246,7 +1246,7 @@ void 
ScDPSaveData::BuildAllDimensionMembers(ScDPTableData* pData)
 for (size_t j = 0; j < mMemberCount; ++j)
 {
 const ScDPItemData* pMemberData = pData->GetMemberById( nDimIndex, 
rMembers[j] );
-::rtl::OUString aMemName = pMemberData->GetString();
+rtl::OUString aMemName = pData->GetFormattedString(nDimIndex, 
*pMemberData);
 if (iter->GetExistingMemberByName(aMemName))
 // this member instance already exists. nothing to do.
 continue;
commit 7f68157264ec5c474b2a0827d2ee35af20ff0c3d
Author: Kohei Yoshida 
Date:   Thu Mar 22 22:03:55 2012 -0400

When updating pivot table with groups, we need to clear the table data.

diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index 917759d..8c1ed99 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -138,6 +138,7 @@ public:
 voidInvalidateData();
 void ClearTableData();
 void ReloadGroupTableData();
+bool HasGroups() const;
 
 voidOutput( const ScAddress& rPos );
 ScRange GetNewOutputRange( bool& rOverflow );
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 9da61d1..2f0e510 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -584,6 +584,18 @@ void ScDPObject::ReloadGroupTableData()
 bSettingsChanged = true;
 }
 
+bool ScDPObject::HasGroups() const
+{
+if (!pSaveData)
+return false;
+
+const ScDPDimensionSaveData* pDimData = 
pSaveData->GetExistingDimensionData();
+if (!pDimData)
+return false;
+
+return pDimData->HasGroupDimensions();
+}
+
 void ScDPObject::ClearSource()
 {
 Reference< XComponent > xObjectComp( xSource, UNO_QUERY );
diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index c1464b1..afb3513 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1327,6 +1327,9 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, 
const ScDPObject* pNewOb
 if ( pNewObj == pOldObj && pDestObj->IsImportData() )
 pDestObj->ClearTableData();
 
+if (pDestObj->HasGroups())
+pDestObj->ClearTableData();
+
 pDestObj->InvalidateData(); // before getting the 
new output area
 
 //  make sure the table has a name (not set by dialog)
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 0f37c83..bf3402c 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -552,9 +552,8 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu()
 return;
 
 ScDPObject* pDPObj = pDPData->mpDPObj;
-ScDPObject aNewDPObj(*pDPObj);
-aNewDPObj.BuildAllDimensionMembers();
-ScDPSaveData* pSaveData = aNewDPObj.GetSaveData();
+pDPObj->BuildAllDimensionMembers();
+ScDPSaveData* pSaveData = pDPObj->GetSaveData();
 
 bool bIsDataLayout;
 OUString aDimName = pDPObj->GetDimName(pDPData->mnDim, bIsDataLayout);
@@ -601,7 +600,7 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu()
 pDim->UpdateMemberVisibility(aResult);
 
 ScDBDocFunc aFunc(*pViewData->GetDocShell());
-aFunc.DataPilotUpdate(pDPObj, &aNewDPObj, true, false);
+aFunc.DataPilotUpdate(pDPObj, pDPObj, true, false);
 }
 
 void ScGridWindow::UpdateVisibleRange()
___
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-22 Thread Kohei Yoshida
 sc/qa/unit/ucalc.cxx |  226 ++-
 1 file changed, 225 insertions(+), 1 deletion(-)

New commits:
commit a3d71e97eaf1958a4d5ab41a6b8788c95d85d2bb
Author: Kohei Yoshida 
Date:   Thu Mar 22 21:26:26 2012 -0400

New unit test for pivot table with date grouping.

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 89315af..cb6ab44 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -75,6 +75,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -161,8 +162,8 @@ public:
 void testPivotTableDuplicateDataFields();
 
 void testPivotTableNormalGrouping();
-
 void testPivotTableNumberGrouping();
+void testPivotTableDateGrouping();
 
 void testSheetCopy();
 void testSheetMove();
@@ -222,6 +223,7 @@ public:
 CPPUNIT_TEST(testPivotTableDuplicateDataFields);
 CPPUNIT_TEST(testPivotTableNormalGrouping);
 CPPUNIT_TEST(testPivotTableNumberGrouping);
+CPPUNIT_TEST(testPivotTableDateGrouping);
 CPPUNIT_TEST(testSheetCopy);
 CPPUNIT_TEST(testSheetMove);
 CPPUNIT_TEST(testExternalRef);
@@ -1245,7 +1247,6 @@ ScDPObject* createDPFromSourceDesc(
 ScDPSaveDimension* pDim = aSaveData.GetNewDimensionByName(aDimName);
 pDim->SetOrientation(static_cast(aFields[i].eOrient));
 pDim->SetUsedHierarchy(0);
-pDim->SetShowEmpty(true);
 
 if (aFields[i].eOrient == sheet::DataPilotFieldOrientation_DATA)
 {
@@ -2424,6 +2425,123 @@ void Test::testPivotTableNumberGrouping()
 m_pDoc->DeleteTab(0);
 }
 
+void Test::testPivotTableDateGrouping()
+{
+m_pDoc->InsertTab(0, OUString(RTL_CONSTASCII_USTRINGPARAM("Data")));
+m_pDoc->InsertTab(1, OUString(RTL_CONSTASCII_USTRINGPARAM("Table")));
+
+// Raw data
+const char* aData[][2] = {
+{ "Date", "Value" },
+{ "2011-01-01", "1" },
+{ "2011-03-02", "2" },
+{ "2012-01-04", "3" },
+{ "2012-02-23", "4" },
+{ "2012-02-24", "5" },
+{ "2012-03-15", "6" },
+{ "2011-09-03", "7" },
+{ "2012-12-25", "8" }
+};
+
+// Dimension definition
+DPFieldDef aFields[] = {
+{ "Date", sheet::DataPilotFieldOrientation_ROW, 0 },
+{ "Value", sheet::DataPilotFieldOrientation_DATA, 
sheet::GeneralFunction_SUM },
+};
+
+ScAddress aPos(1,1,0);
+ScRange aDataRange = insertRangeData(m_pDoc, aPos, aData, 
SAL_N_ELEMENTS(aData));
+CPPUNIT_ASSERT_MESSAGE("failed to insert range data at correct position", 
aDataRange.aStart == aPos);
+
+ScDPObject* pDPObj = createDPFromRange(
+m_pDoc, aDataRange, aFields, SAL_N_ELEMENTS(aFields), false);
+
+ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+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);
+pDPObj->SetName(pDPs->CreateNewName());
+
+ScDPSaveData* pSaveData = pDPObj->GetSaveData();
+CPPUNIT_ASSERT_MESSAGE("No save data !?", pSaveData);
+ScDPDimensionSaveData* pDimData = pSaveData->GetDimensionData();
+CPPUNIT_ASSERT_MESSAGE("No dimension data !?", pDimData);
+
+rtl::OUString aBaseDimName(RTL_CONSTASCII_USTRINGPARAM("Date"));
+
+ScDPNumGroupInfo aInfo;
+aInfo.mbEnable = true;
+aInfo.mbAutoStart = true;
+aInfo.mbAutoEnd = true;
+{
+// Turn the Date dimension into months.  The first of the date
+// dimensions is always a number-group dimension which replaces the
+// original dimension.
+ScDPSaveNumGroupDimension aGroup(aBaseDimName, aInfo, 
sheet::DataPilotFieldGroupBy::MONTHS);
+pDimData->AddNumGroupDimension(aGroup);
+}
+
+{
+// Add quarter dimension.  This will be an additional dimension.
+rtl::OUString aGroupDimName =
+pDimData->CreateDateGroupDimName(
+sheet::DataPilotFieldGroupBy::QUARTERS, *pDPObj, true, NULL);
+ScDPSaveGroupDimension aGroupDim(aBaseDimName, aGroupDimName);
+aGroupDim.SetDateInfo(aInfo, sheet::DataPilotFieldGroupBy::QUARTERS);
+pDimData->AddGroupDimension(aGroupDim);
+
+// Set orientation.
+ScDPSaveDimension* pDim = pSaveData->GetDimensionByName(aGroupDimName);
+pDim->SetOrientation(sheet::DataPilotFieldOrientation_ROW);
+pSaveData->SetPosition(pDim, 0); // set it to the left end.
+}
+
+{
+// Add year dimension.  This is a new dimension also.
+rtl::OUString aGroupDimName =

[Libreoffice-commits] .: sc/qa

2012-03-21 Thread Kohei Yoshida
 sc/qa/unit/ucalc.cxx |  175 ++-
 1 file changed, 174 insertions(+), 1 deletion(-)

New commits:
commit 7be233e60ab8b4e241510758e269c186e5cf02e3
Author: Kohei Yoshida 
Date:   Wed Mar 21 23:04:44 2012 -0400

New unit test for data pilot grouping (normal grouping).

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index c134f13..15c774c 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -59,6 +59,7 @@
 #include "dpshttab.hxx"
 #include "dpobject.hxx"
 #include "dpsave.hxx"
+#include "dpdimsave.hxx"
 #include "dpcache.hxx"
 
 #include "formula/IFunctionDescription.hxx"
@@ -159,6 +160,8 @@ public:
  */
 void testPivotTableDuplicateDataFields();
 
+void testPivotTableNormalGrouping();
+
 void testSheetCopy();
 void testSheetMove();
 void testExternalRef();
@@ -215,6 +218,7 @@ public:
 CPPUNIT_TEST(testPivotTableNamedSource);
 CPPUNIT_TEST(testPivotTableCache);
 CPPUNIT_TEST(testPivotTableDuplicateDataFields);
+CPPUNIT_TEST(testPivotTableNormalGrouping);
 CPPUNIT_TEST(testSheetCopy);
 CPPUNIT_TEST(testSheetMove);
 CPPUNIT_TEST(testExternalRef);
@@ -1289,6 +1293,25 @@ ScDPObject* createDPFromRange(
 return createDPFromSourceDesc(pDoc, aSheetDesc, aFields, nFieldCount, 
bFilterButton);
 }
 
+ScRange refreshGroups(ScDPCollection* pDPs, ScDPObject* pDPObj)
+{
+// We need to first create group data in the cache, then the group data in
+// the object.
+std::set aRefs;
+bool bSuccess = pDPs->ReloadGroupsInCache(pDPObj, aRefs);
+CPPUNIT_ASSERT_MESSAGE("Failed to reload group data in cache.", bSuccess);
+CPPUNIT_ASSERT_MESSAGE("There should be only one table linked to this 
cache.", aRefs.size() == 1);
+pDPObj->ReloadGroupTableData();
+
+bool bOverFlow = false;
+ScRange aOutRange = pDPObj->GetNewOutputRange(bOverFlow);
+CPPUNIT_ASSERT_MESSAGE("Table overflow!?", !bOverFlow);
+
+pDPObj->Output(aOutRange.aStart);
+aOutRange = pDPObj->GetOutRange();
+return aOutRange;
+}
+
 class AutoCalcSwitch
 {
 ScDocument* mpDoc;
@@ -2083,7 +2106,6 @@ void Test::testPivotTableDuplicateDataFields()
 CPPUNIT_ASSERT_MESSAGE("there should be only one data pilot table.",
pDPs->GetCount() == 1);
 pDPObj->SetName(pDPs->CreateNewName());
-pDPObj->GetSource();
 
 bool bOverFlow = false;
 ScRange aOutRange = pDPObj->GetNewOutputRange(bOverFlow);
@@ -2145,6 +2167,157 @@ void Test::testPivotTableDuplicateDataFields()
 m_pDoc->DeleteTab(0);
 }
 
+void Test::testPivotTableNormalGrouping()
+{
+m_pDoc->InsertTab(0, OUString(RTL_CONSTASCII_USTRINGPARAM("Data")));
+m_pDoc->InsertTab(1, OUString(RTL_CONSTASCII_USTRINGPARAM("Table")));
+
+// Raw data
+const char* aData[][2] = {
+{ "Name", "Value" },
+{ "A", "1" },
+{ "B", "2" },
+{ "C", "3" },
+{ "D", "4" },
+{ "E", "5" },
+{ "F", "6" },
+{ "G", "7" }
+};
+
+// Dimension definition
+DPFieldDef aFields[] = {
+{ "Name",  sheet::DataPilotFieldOrientation_ROW, 0 },
+{ "Value", sheet::DataPilotFieldOrientation_DATA, 
sheet::GeneralFunction_SUM },
+};
+
+ScAddress aPos(1,1,0);
+ScRange aDataRange = insertRangeData(m_pDoc, aPos, aData, 
SAL_N_ELEMENTS(aData));
+CPPUNIT_ASSERT_MESSAGE("failed to insert range data at correct position", 
aDataRange.aStart == aPos);
+
+ScDPObject* pDPObj = createDPFromRange(
+m_pDoc, aDataRange, aFields, SAL_N_ELEMENTS(aFields), false);
+
+ScDPCollection* pDPs = m_pDoc->GetDPCollection();
+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);
+pDPObj->SetName(pDPs->CreateNewName());
+
+bool bOverFlow = false;
+ScRange aOutRange = pDPObj->GetNewOutputRange(bOverFlow);
+CPPUNIT_ASSERT_MESSAGE("Table overflow!?", !bOverFlow);
+
+pDPObj->Output(aOutRange.aStart);
+aOutRange = pDPObj->GetOutRange();
+{
+// Expected output table content.  0 = empty cell
+const char* aOutputCheck[][2] = {
+{ "Name", 0 },
+{ "A", "1" },
+{ "B", "2" },
+{ "C", "3" },
+{ "D", "4" },
+{ "E", "5" },
+   

[Libreoffice-commits] .: sc/qa

2012-03-21 Thread Kohei Yoshida
 sc/qa/unit/ucalc.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 7d4293b3ba64ffd51731d9a2d478a88a45836aa2
Author: Kohei Yoshida 
Date:   Wed Mar 21 16:28:44 2012 -0400

Make sure that FillLabelData doesn't crash in presence of duplicated dims.

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 2f8d099..c134f13 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -2134,6 +2134,11 @@ void Test::testPivotTableDuplicateDataFields()
 CPPUNIT_ASSERT_MESSAGE("Table output check failed", bSuccess);
 }
 
+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);
+
 pDPs->FreeTable(pDPObj);
 
 m_pDoc->DeleteTab(1);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/qa

2012-03-21 Thread Kohei Yoshida
 sc/qa/unit/ucalc.cxx |  170 ---
 1 file changed, 135 insertions(+), 35 deletions(-)

New commits:
commit 70ce9efbac248f0e7952cda6cfb783798b62d459
Author: Kohei Yoshida 
Date:   Wed Mar 21 15:41:14 2012 -0400

New unit test for pivot table with duplicated data fields.

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 43ea584..2f8d099 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -153,6 +153,12 @@ public:
  */
 void testPivotTableCache();
 
+/**
+ * Test for pivot table containing data fields that reference the same
+ * source field but different functions.
+ */
+void testPivotTableDuplicateDataFields();
+
 void testSheetCopy();
 void testSheetMove();
 void testExternalRef();
@@ -208,6 +214,7 @@ public:
 CPPUNIT_TEST(testPivotTableFilters);
 CPPUNIT_TEST(testPivotTableNamedSource);
 CPPUNIT_TEST(testPivotTableCache);
+CPPUNIT_TEST(testPivotTableDuplicateDataFields);
 CPPUNIT_TEST(testSheetCopy);
 CPPUNIT_TEST(testSheetMove);
 CPPUNIT_TEST(testExternalRef);
@@ -1104,6 +,12 @@ struct DPFieldDef
 {
 const char* pName;
 sheet::DataPilotFieldOrientation eOrient;
+
+/**
+ * Function for data field.  It's used only for data field.  When 0, the
+ * default function (SUM) is used.
+ */
+int eFunc;
 };
 
 template
@@ -1214,7 +1227,6 @@ ScDPObject* createDPFromSourceDesc(
 
 // Check the sanity of the source range.
 const ScRange& rSrcRange = rDesc.GetSourceRange();
-SCCOL nCol1 = rSrcRange.aStart.Col();
 SCROW nRow1 = rSrcRange.aStart.Row();
 SCROW nRow2 = rSrcRange.aEnd.Row();
 CPPUNIT_ASSERT_MESSAGE("source range contains no data!", nRow2 - nRow1 > 
1);
@@ -1222,15 +1234,19 @@ ScDPObject* createDPFromSourceDesc(
 // Set the dimension information.
 for (size_t i = 0; i < nFieldCount; ++i)
 {
-OUString aDimName = pDoc->GetString(nCol1+i, nRow1, 
rSrcRange.aStart.Tab());
-ScDPSaveDimension* pDim = aSaveData.GetDimensionByName(aDimName);
+OUString aDimName = rtl::OUString::createFromAscii(aFields[i].pName);
+ScDPSaveDimension* pDim = aSaveData.GetNewDimensionByName(aDimName);
 pDim->SetOrientation(static_cast(aFields[i].eOrient));
 pDim->SetUsedHierarchy(0);
 pDim->SetShowEmpty(true);
 
 if (aFields[i].eOrient == sheet::DataPilotFieldOrientation_DATA)
 {
-pDim->SetFunction(sheet::GeneralFunction_SUM);
+sheet::GeneralFunction eFunc = sheet::GeneralFunction_SUM;
+if (aFields[i].eFunc)
+eFunc = static_cast(aFields[i].eFunc);
+
+pDim->SetFunction(eFunc);
 pDim->SetReferenceValue(NULL);
 }
 else
@@ -1249,20 +1265,6 @@ ScDPObject* createDPFromSourceDesc(
 aShowInfo.ShowItemsMode = 0;
 aShowInfo.ItemCount = 0;
 pDim->SetAutoShowInfo(&aShowInfo);
-
-//  USHORT nFuncs[] = { sheet::GeneralFunction_AUTO };
-//  pDim->SetSubTotals(1, nFuncs);
-}
-
-for (SCROW nRow = nRow1 + 1; nRow <= nRow2; ++nRow)
-{
-SCCOL nCol = nCol1 + static_cast(i);
-rtl::OUString aVal;
-pDoc->GetString(nCol, nRow, 0, aVal);
-// This call is just to populate the member list for each 
dimension.
-ScDPSaveMember* pMem = pDim->GetMemberByName(aVal);
-pMem->SetShowDetails(true);
-pMem->SetIsVisible(true);
 }
 }
 
@@ -1312,9 +1314,9 @@ void Test::testPivotTable()
 
 // Dimension definition
 DPFieldDef aFields[] = {
-{ "Name",  sheet::DataPilotFieldOrientation_ROW },
-{ "Group", sheet::DataPilotFieldOrientation_COLUMN },
-{ "Score", sheet::DataPilotFieldOrientation_DATA }
+{ "Name",  sheet::DataPilotFieldOrientation_ROW, 0 },
+{ "Group", sheet::DataPilotFieldOrientation_COLUMN, 0 },
+{ "Score", sheet::DataPilotFieldOrientation_DATA, 0 }
 };
 
 // Raw data
@@ -1496,9 +1498,9 @@ void Test::testPivotTableLabels()
 
 // Dimension definition
 DPFieldDef aFields[] = {
-{ "Software", sheet::DataPilotFieldOrientation_ROW },
-{ "Version",  sheet::DataPilotFieldOrientation_COLUMN },
-{ "1.2.3",sheet::DataPilotFieldOrientation_DATA }
+{ "Software", sheet::DataPilotFieldOrientation_ROW, 0 },
+{ "Version",  sheet::DataPilotFieldOrientation_COLUMN, 0 },
+{ "1.2.3",sheet::DataPilotFieldOrientation_DATA, 0 }
 };
 
 // Raw data
@@ -1558,9 +1560,9 @@ void Test::testPivotTableDateLabels()
 
 // Dimension definition
 DPFieldDef aFields[] = {
-{ "Name",  sheet::DataPilotField

[Libreoffice-commits] .: sc/source

2012-03-20 Thread Kohei Yoshida
 sc/source/filter/excel/xepivot.cxx |   12 
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit aeed13079e9cfd95a25b9b4faac6c95b0b4c8f23
Author: Kohei Yoshida 
Date:   Wed Mar 21 00:42:15 2012 -0400

Export to xls correct item values for grouped fields.

diff --git a/sc/source/filter/excel/xepivot.cxx 
b/sc/source/filter/excel/xepivot.cxx
index 324f802..df41e8c 100644
--- a/sc/source/filter/excel/xepivot.cxx
+++ b/sc/source/filter/excel/xepivot.cxx
@@ -548,18 +548,22 @@ void XclExpPCField::InsertNumDateGroupItems( const 
ScDPObject& rDPObj, const ScD
 return;
 
 ScSheetDPData aDPData(GetDocPtr(), *pSrcDesc, pCache);
-const std::vector< SCROW > aOrignial = aDPData.GetColumnEntries( 
static_cast< long >( GetBaseFieldIndex() ) );
+long nDim = GetFieldIndex();
+const std::vector< SCROW > aOrignial = aDPData.GetColumnEntries(nDim);
 // get the string collection with generated grouping elements
 ScDPNumGroupDimension aTmpDim( rNumInfo );
 if( nDatePart != 0 )
 aTmpDim.MakeDateHelper( rNumInfo, mnFieldIdx, nDatePart );
 const std::vector& aMemberIds = aTmpDim.GetNumEntries(
-static_cast(GetBaseFieldIndex()), 
aDPData.GetCacheTable().getCache());
+static_cast(nDim), pCache);
 for ( size_t  nIdx = 0 ; nIdx < aMemberIds.size(); nIdx++ )
 {
-const ScDPItemData* pData = aDPData.GetMemberById(  static_cast< 
long >( GetBaseFieldIndex() ) , aMemberIds[ nIdx] );
+const ScDPItemData* pData = aDPData.GetMemberById(nDim , 
aMemberIds[nIdx]);
 if ( pData )
-InsertGroupItem( new XclExpPCItem( pData->GetString() ) );
+{
+rtl::OUString aStr = pCache->GetFormattedString(nDim, *pData);
+InsertGroupItem(new XclExpPCItem(aStr));
+}
 }
 }
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/qa

2012-03-20 Thread Kohei Yoshida
 sc/qa/unit/ucalc.cxx |   50 ++
 1 file changed, 50 insertions(+)

New commits:
commit fdcac5fa84b5fba908a0e59b0ceb953da58e8609
Author: Kohei Yoshida 
Date:   Tue Mar 20 16:27:20 2012 -0400

Added more code to test the integrity of the source data arrays.

Source data array stores item IDs and represents the original data
series before normalization.

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 5324601..43ea584 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -147,6 +147,10 @@ public:
  */
 void testPivotTableNamedSource();
 
+/**
+ * Test for pivot table cache.  Each dimension in the pivot cache stores
+ * only unique values that are sorted in ascending order.
+ */
 void testPivotTableCache();
 
 void testSheetCopy();
@@ -1987,6 +1991,52 @@ void Test::testPivotTableCache()
 pItem = aCache.GetItemDataById(2, 6);
 CPPUNIT_ASSERT_MESSAGE("wrong item value", !pItem);
 
+{
+// Check the integrity of the source data.
+ScDPItemData aTest;
+long nDim;
+
+{
+// Dimension 0: Z, R, A, F, Y, 12
+nDim = 0;
+const char* aChecks[] = { "Z", "R", "A", "F", "Y" };
+for (size_t i = 0; i < SAL_N_ELEMENTS(aChecks); ++i)
+{
+pItem = aCache.GetItemDataById(nDim, 
aCache.GetItemDataId(nDim, i, false));
+aTest.SetString(rtl::OUString::createFromAscii(aChecks[i]));
+CPPUNIT_ASSERT_MESSAGE("wrong data value", pItem && *pItem == 
aTest);
+}
+
+pItem = aCache.GetItemDataById(nDim, aCache.GetItemDataId(nDim, 5, 
false));
+aTest.SetValue(12);
+CPPUNIT_ASSERT_MESSAGE("wrong data value", pItem && *pItem == 
aTest);
+}
+
+{
+// Dimension 1: A, A, B, B, C, C
+nDim = 1;
+const char* aChecks[] = { "A", "A", "B", "B", "C", "C" };
+for (size_t i = 0; i < SAL_N_ELEMENTS(aChecks); ++i)
+{
+pItem = aCache.GetItemDataById(nDim, 
aCache.GetItemDataId(nDim, i, false));
+aTest.SetString(rtl::OUString::createFromAscii(aChecks[i]));
+CPPUNIT_ASSERT_MESSAGE("wrong data value", pItem && *pItem == 
aTest);
+}
+}
+
+{
+// Dimension 2: 30, 20, 45, 12, 8, 15
+nDim = 2;
+double aChecks[] = { 30, 20, 45, 12, 8, 15 };
+for (size_t i = 0; i < SAL_N_ELEMENTS(aChecks); ++i)
+{
+pItem = aCache.GetItemDataById(nDim, 
aCache.GetItemDataId(nDim, i, false));
+aTest.SetValue(aChecks[i]);
+CPPUNIT_ASSERT_MESSAGE("wrong data value", pItem && *pItem == 
aTest);
+}
+}
+}
+
 m_pDoc->DeleteTab(0);
 }
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-19 Thread Kohei Yoshida
 sc/source/core/data/dpobject.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit f1a2c10b72a87a3826861562430fc80e3ffd6048
Author: Kohei Yoshida 
Date:   Mon Mar 19 19:12:57 2012 -0400

Fix a crash on launching the pivot layout dialog with duplicated data 
fields.

diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 6348b7f..9da61d1 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -2058,6 +2058,9 @@ bool ScDPObject::FillLabelDataForDimension(
 rLabelData.mnOriginalDim = static_cast(nOrigPos);
 rLabelData.maLayoutName = aLayoutName;
 rLabelData.maSubtotalName = aSubtotalName;
+if (nOrigPos >= 0)
+// This is a duplicated dimension. Use the original dimension 
index.
+nDim = nOrigPos;
 GetHierarchies(nDim, rLabelData.maHiers);
 GetMembers(nDim, GetUsedHierarchy(nDim), rLabelData.maMembers);
 lcl_FillLabelData(rLabelData, xDimProp);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-19 Thread Kohei Yoshida
 sc/source/core/data/dpcache.cxx |   27 +--
 1 file changed, 25 insertions(+), 2 deletions(-)

New commits:
commit 5b63983e226ad12980a15704d3e2276d9321da24
Author: Kohei Yoshida 
Date:   Mon Mar 19 15:19:26 2012 -0400

Record sort order during the first sort by the value, and use it the 2nd 
time.

This avoids comparison of raw values (ScDPItemData) during the 2nd sort.
Comparison of raw values can be expensive especially when the item sets 
mostly
consist of string values.

diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 369c5b3..f13a481 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -247,8 +247,9 @@ struct Bucket
 ScDPItemData maValue;
 SCROW mnOrderIndex;
 SCROW mnDataIndex;
+SCROW mnValueSortIndex;
 Bucket(const ScDPItemData& rValue, SCROW nOrder, SCROW nData) :
-maValue(rValue), mnOrderIndex(nOrder), mnDataIndex(nData) {}
+maValue(rValue), mnOrderIndex(nOrder), mnDataIndex(nData), 
mnValueSortIndex(0) {}
 };
 
 struct LessByValue : std::binary_function
@@ -259,6 +260,14 @@ struct LessByValue : std::binary_function
 }
 };
 
+struct LessByValueSortIndex : std::binary_function
+{
+bool operator() (const Bucket& left, const Bucket& right) const
+{
+return left.mnValueSortIndex < right.mnValueSortIndex;
+}
+};
+
 struct LessByDataIndex : std::binary_function
 {
 bool operator() (const Bucket& left, const Bucket& right) const
@@ -297,6 +306,17 @@ public:
 }
 };
 
+class TagValueSortOrder : std::unary_function
+{
+SCROW mnCurIndex;
+public:
+TagValueSortOrder() : mnCurIndex(0) {}
+void operator() (Bucket& v)
+{
+v.mnValueSortIndex = mnCurIndex++;
+}
+};
+
 void processBuckets(std::vector& aBuckets, ScDPCache::Field& rField)
 {
 if (aBuckets.empty())
@@ -305,6 +325,9 @@ void processBuckets(std::vector& aBuckets, 
ScDPCache::Field& rField)
 // Sort by the value.
 std::sort(aBuckets.begin(), aBuckets.end(), LessByValue());
 
+// Remember this sort order.
+std::for_each(aBuckets.begin(), aBuckets.end(), TagValueSortOrder());
+
 {
 // Set order index such that unique values have identical index value.
 SCROW nCurIndex = 0;
@@ -329,7 +352,7 @@ void processBuckets(std::vector& aBuckets, 
ScDPCache::Field& rField)
 std::for_each(aBuckets.begin(), aBuckets.end(), 
PushBackOrderIndex(rField.maData));
 
 // Sort by the value again.
-std::sort(aBuckets.begin(), aBuckets.end(), LessByValue());
+std::sort(aBuckets.begin(), aBuckets.end(), LessByValueSortIndex());
 
 // Unique by value.
 std::vector::iterator itUniqueEnd =
___
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-03-19 Thread Kohei Yoshida
 sc/source/ui/app/transobj.cxx   |3 ---
 sc/source/ui/docshell/impex.cxx |   20 ++--
 2 files changed, 14 insertions(+), 9 deletions(-)

New commits:
commit a58d877fd576bacd738972a78c8310d4eccb0daa
Author: Markus Mohrhard 
Date:   Tue Mar 13 01:19:48 2012 +0100

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

Signed-off-by: Kohei Yoshida 

diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index ae73542..3d70f84 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 5abf7d5..c183387 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -69,6 +69,7 @@ class StarBASIC;
 #include "editable.hxx"
 #include "compiler.hxx"
 #include "warnbox.hxx"
+#include "clipparam.hxx"
 
 #include "impex.hxx"
 
@@ -1436,26 +1437,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
@@ -1463,7 +1471,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 )
@@ -1486,7 +1494,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;
@@ -1495,7 +1503,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] .: sc/source

2012-03-16 Thread Kohei Yoshida
 sc/source/filter/xml/xmldpimp.cxx |   13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 3ae3f098ed4e6495c0be0748dacf03dd8e0fe091
Author: Kohei Yoshida 
Date:   Sat Mar 17 00:07:33 2012 -0400

Fixed potential memory leak & UniString removal.

diff --git a/sc/source/filter/xml/xmldpimp.cxx 
b/sc/source/filter/xml/xmldpimp.cxx
index ee8e3aa..8fa7312 100644
--- a/sc/source/filter/xml/xmldpimp.cxx
+++ b/sc/source/filter/xml/xmldpimp.cxx
@@ -1037,11 +1037,14 @@ SvXMLImportContext 
*ScXMLDataPilotFieldContext::CreateChildContext( sal_uInt16 n
 void ScXMLDataPilotFieldContext::AddMember(ScDPSaveMember* pMember)
 {
 if (pDim)
+{
 pDim->AddMember(pMember);
-
-if (!pMember->GetIsVisible())
-// This member is hidden.
-mbHasHiddenMember = true;
+if (!pMember->GetIsVisible())
+// This member is hidden.
+mbHasHiddenMember = true;
+}
+else
+delete pMember;
 }
 
 void ScXMLDataPilotFieldContext::SetSubTotalName(const OUString& rName)
@@ -1636,7 +1639,7 @@ void ScXMLDataPilotMemberContext::EndElement()
 {
 if (bHasName)   // #i53407# don't check sName, empty name is allowed
 {
-ScDPSaveMember* pMember = new ScDPSaveMember(String(sName));
+ScDPSaveMember* pMember = new ScDPSaveMember(sName);
 if (!maDisplayName.isEmpty())
 pMember->SetLayoutName(maDisplayName);
 pMember->SetIsVisible(bDisplay);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: svx/inc

2012-03-16 Thread Kohei Yoshida
 svx/inc/svx/linectrl.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 32502a98bc16d74eafc071d43004674aa384ef0e
Author: Winfried Donkers 
Date:   Fri Mar 16 18:13:49 2012 +0100

correction of typo in comment

diff --git a/svx/inc/svx/linectrl.hxx b/svx/inc/svx/linectrl.hxx
index 2c3d10c..8c43a11 100644
--- a/svx/inc/svx/linectrl.hxx
+++ b/svx/inc/svx/linectrl.hxx
@@ -154,7 +154,7 @@ public:
 };
 
 //
-// class SvxColorToolBoxControl
+// class SvxLineEndToolBoxControl
 //
 
 class SVX_DLLPUBLIC SvxLineEndToolBoxControl : public SfxToolBoxControl
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/inc

2012-03-16 Thread Kohei Yoshida
 sc/inc/dpitemdata.hxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 99b9c0bfccd73a97d99666986cc9e84a0e8f9aeb
Author: Kohei Yoshida 
Date:   Fri Mar 16 23:34:31 2012 -0400

Added class description.

diff --git a/sc/inc/dpitemdata.hxx b/sc/inc/dpitemdata.hxx
index 20535a8..b0f361b 100644
--- a/sc/inc/dpitemdata.hxx
+++ b/sc/inc/dpitemdata.hxx
@@ -44,6 +44,14 @@
 
 class ScDocument;
 
+/**
+ * When assigning a string value, you can also assign an interned string
+ * whose life-cycle is managed by the pivot cache that it belongs to.  Those
+ * methods that take a string pointer assume that the string is interned.
+ *
+ * Do make sure that an item with an interned string won't persist after
+ * the pivot cache has been destroyed or reloaded.
+ */
 class SC_DLLPUBLIC ScDPItemData
 {
 friend class ScDPCache;
___
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-16 Thread Kohei Yoshida
 sc/inc/dpcache.hxx |5 +++
 sc/inc/dpitemdata.hxx  |   10 +--
 sc/source/core/data/dpcache.cxx|   28 --
 sc/source/core/data/dpitemdata.cxx |   47 ++---
 4 files changed, 72 insertions(+), 18 deletions(-)

New commits:
commit f81d15c3bab32938b5b475e16ae2a746a7a32ea9
Author: Kohei Yoshida 
Date:   Fri Mar 16 21:44:55 2012 -0400

Use shared string pool to share string instances among string item values.

This brings down the reload time from 22 seconds to 4.3 seconds with
my test document.  This is what I've been looking for!

diff --git a/sc/inc/dpcache.hxx b/sc/inc/dpcache.hxx
index 839f64b..2591b3d 100644
--- a/sc/inc/dpcache.hxx
+++ b/sc/inc/dpcache.hxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -58,6 +59,8 @@ struct ScDPNumGroupInfo;
  */
 class SC_DLLPUBLIC ScDPCache : boost::noncopyable
 {
+typedef boost::unordered_set 
StringSetType;
+
 public:
 typedef std::vector ItemsType;
 typedef std::set ObjectSetType;
@@ -112,6 +115,7 @@ private:
 
 FieldsType maFields;
 GroupFieldsType maGroupFields;
+mutable StringSetType maStringPool;
 
 LabelsType maLabelNames;// Stores dimension names.
 mdds::flat_segment_tree maEmptyRows;
@@ -119,6 +123,7 @@ private:
 bool mbDisposing;
 
 public:
+const rtl::OUString* InternString(const rtl::OUString& rStr) const;
 void AddReference(ScDPObject* pObj) const;
 void RemoveReference(ScDPObject* pObj) const;
 const ObjectSetType& GetAllReferences() const;
diff --git a/sc/inc/dpitemdata.hxx b/sc/inc/dpitemdata.hxx
index e30eae3..20535a8 100644
--- a/sc/inc/dpitemdata.hxx
+++ b/sc/inc/dpitemdata.hxx
@@ -49,7 +49,7 @@ class SC_DLLPUBLIC ScDPItemData
 friend class ScDPCache;
 
 public:
-enum Type { GroupValue = 0, RangeStart, Value, String, Error, Empty };
+enum Type { GroupValue = 0, RangeStart = 1, Value = 2, String = 3, Error = 
4, Empty = 5 };
 
 static const sal_Int32 DateFirst;
 static const sal_Int32 DateLast;
@@ -63,12 +63,13 @@ public:
 private:
 
 union {
-rtl::OUString* mpString;
+const rtl::OUString* mpString;
 GroupValueAttr maGroupValue;
 double mfValue;
 };
 
-Type meType;
+sal_uInt8 meType:3;
+bool mbStringInterned:1;
 
 void DisposeString();
 
@@ -79,16 +80,19 @@ public:
 ScDPItemData();
 ScDPItemData(const ScDPItemData& r);
 ScDPItemData(const rtl::OUString& rStr);
+ScDPItemData(const rtl::OUString* pStr);
 ScDPItemData(sal_Int32 nGroupType, sal_Int32 nValue);
 ~ScDPItemData();
 
 Type GetType() const;
 void SetString(const rtl::OUString& rS);
+void SetString(const rtl::OUString* pS);
 void SetValue(double fVal);
 void SetRangeStart(double fVal);
 void SetRangeFirst();
 void SetRangeLast();
 void SetErrorString(const rtl::OUString& rS);
+void SetErrorString(const rtl::OUString* pS);
 bool IsCaseInsEqual(const ScDPItemData& r) const;
 
 // exact equality
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 216c2ff..369c5b3 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -138,7 +138,9 @@ rtl::OUString createLabelString(ScDocument* pDoc, SCCOL 
nCol, SCROW nRow, SCTAB
 return aDocStr;
 }
 
-void initFromCell(ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, 
ScDPItemData& rData, sal_uLong& rNumFormat)
+void initFromCell(
+ScDPCache& rCache, ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab,
+ScDPItemData& rData, sal_uLong& rNumFormat)
 {
 rtl::OUString aDocStr = pDoc->GetString(nCol, nRow, nTab);
 rNumFormat = 0;
@@ -147,7 +149,7 @@ void initFromCell(ScDocument* pDoc, SCCOL nCol, SCROW nRow, 
SCTAB nTab, ScDPItem
 
 if (pDoc->GetErrCode(aPos))
 {
-rData.SetErrorString(aDocStr);
+rData.SetErrorString(rCache.InternString(aDocStr));
 }
 else if (pDoc->HasValueData(nCol, nRow, nTab))
 {
@@ -157,12 +159,12 @@ void initFromCell(ScDocument* pDoc, SCCOL nCol, SCROW 
nRow, SCTAB nTab, ScDPItem
 }
 else if (pDoc->HasData(nCol, nRow, nTab))
 {
-rData.SetString(aDocStr);
+rData.SetString(rCache.InternString(aDocStr));
 }
 }
 
 void getItemValue(
-ScDPItemData& rData, const Reference& xRow, sal_Int32 nType,
+ScDPCache& rCache, ScDPItemData& rData, const Reference& xRow, 
sal_Int32 nType,
 long nCol, const Date& rNullDate, short& rNumType)
 {
 rNumType = NUMBERFORMAT_NUMBER;
@@ -232,7 +234,7 @@ void getItemValue(
 case sdbc::DataType::VARBINARY:
 case sdbc::DataType::LONGVARBINARY:
 default:
-rData.SetString(xRow->getString(nCol));
+rData.SetString(rCache.InternString(xRow->getString(nCol

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

2012-03-16 Thread Kohei Yoshida
 sc/source/ui/app/inputhdl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c39e96d984b5907f8e0c0247828c8e35f2e9ce72
Author: Noel Power 
Date:   Thu Mar 15 20:10:12 2012 +

fix to update inputbar when setting a range for a formula fdo#46809

Signed-off-by: Kohei Yoshida 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 95d2b7f..e461b0b 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1719,7 +1719,7 @@ void ScInputHandler::UpdateActiveView()
 else
 pTableView = NULL;
 
-if (pInputWin && pInputWin->IsInputActive())
+if (pInputWin && eMode == SC_INPUT_TOP )
 pTopView = pInputWin->GetEditView();
 else
 pTopView = NULL;
___
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-03-16 Thread Kohei Yoshida
 sc/source/ui/view/viewfun5.cxx |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 76f3a63432e70d017760a2087652a1abc9b126d3
Author: Markus Mohrhard 
Date:   Fri Mar 16 10:45:01 2012 +0100

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

Signed-off-by: Kohei Yoshida 

diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index eae1329..cdf373a 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -322,9 +322,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] .: Branch 'libreoffice-3-5' - sc/source

2012-03-16 Thread Kohei Yoshida
 sc/source/core/data/cell.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 14ed2c61066b38d812bb68c4c1f02f8cb7c97f4d
Author: Markus Mohrhard 
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

Signed-off-by: Kohei Yoshida 

diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 9b431fa..4ed94b9 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -861,9 +861,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
@@ -900,6 +897,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();
___
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-03-16 Thread Kohei Yoshida
 sc/source/ui/inc/namepast.hxx |1 +
 sc/source/ui/namedlg/namepast.cxx |5 ++---
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 70b5ab86907bb0ee75b2e70505cca1d386ae0025
Author: Markus Mohrhard 
Date:   Thu Mar 15 15:57:54 2012 +0100

ScNameMgrTable takes a reference, fdo#47307

Signed-off-by: Kohei Yoshida 

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::vector maSelectedNames;
+boost::ptr_map 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::map aCopyMap;
-boost::ptr_map aRangeMap;
 pDoc->GetRangeNameMap(aCopyMap);
 std::map::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] .: sc/qa

2012-03-16 Thread Kohei Yoshida
 sc/qa/unit/ucalc.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 16ab673ccbed29d460aaca93cb09663fdd63dc19
Author: Kohei Yoshida 
Date:   Fri Mar 16 12:43:33 2012 -0400

More wording tweak. Members are sorted only in source dims (for now).

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index b7a2df2..5324601 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -1904,9 +1904,10 @@ void Test::testPivotTableCache()
 aDimName = aCache.GetDimensionName(2);
 CPPUNIT_ASSERT_MESSAGE("wrong dimension name", aDimName.equalsAscii("F3"));
 
-// In each dimension, member ID values also represent their sort order.
-// Value items are sorted before string ones.  Also, no duplicate
-// dimension members should exist.
+// In each dimension, member ID values also represent their sort order (in
+// source dimensions only, not in group dimensions). Value items are
+// sorted before string ones. Also, no duplicate dimension members should
+// exist.
 
 // Dimension 0 - a mix of strings and values.
 long nMemCount = aCache.GetDimMemberCount(0);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/qa

2012-03-16 Thread Kohei Yoshida
 sc/qa/unit/ucalc.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit eee16791673412f44435b6357248b34ef7613296
Author: Kohei Yoshida 
Date:   Fri Mar 16 12:41:43 2012 -0400

Better wording.

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 5d71971..b7a2df2 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -1904,9 +1904,9 @@ void Test::testPivotTableCache()
 aDimName = aCache.GetDimensionName(2);
 CPPUNIT_ASSERT_MESSAGE("wrong dimension name", aDimName.equalsAscii("F3"));
 
-// In each dimension, member ID values also represent their order;
-// dimension members are sorted in ascending order.  And values come
-// before strings.  Also, no duplicate dimension members exist.
+// In each dimension, member ID values also represent their sort order.
+// Value items are sorted before string ones.  Also, no duplicate
+// dimension members should exist.
 
 // Dimension 0 - a mix of strings and values.
 long nMemCount = aCache.GetDimMemberCount(0);
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-03-16 Thread Kohei Yoshida
 sc/inc/dpcache.hxx  |2 
 sc/qa/unit/ucalc.cxx|  139 
 sc/source/core/data/dpcache.cxx |2 
 3 files changed, 141 insertions(+), 2 deletions(-)

New commits:
commit 8cd1517e5e414e339085554d93e447cc0cc85213
Author: Kohei Yoshida 
Date:   Fri Mar 16 12:34:40 2012 -0400

New unit test for testing pivot cache.

diff --git a/sc/inc/dpcache.hxx b/sc/inc/dpcache.hxx
index bd2fa5a..839f64b 100644
--- a/sc/inc/dpcache.hxx
+++ b/sc/inc/dpcache.hxx
@@ -134,7 +134,7 @@ public:
 SCCOL GetDimensionIndex(const rtl::OUString& sName) const;
 sal_uLong GetNumberFormat( long nDim ) const;
 bool  IsDateDimension( long nDim ) const ;
-SCROW GetDimMemberCount( SCCOL nDim ) const;
+long GetDimMemberCount(long nDim) const;
 SCROW GetOrder( long nDim, SCROW nIndex ) const;
 
 const ItemsType& GetDimMemberValues( SCCOL nDim ) const;
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index cf1526f..5d71971 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -59,6 +59,7 @@
 #include "dpshttab.hxx"
 #include "dpobject.hxx"
 #include "dpsave.hxx"
+#include "dpcache.hxx"
 
 #include "formula/IFunctionDescription.hxx"
 
@@ -146,6 +147,8 @@ public:
  */
 void testPivotTableNamedSource();
 
+void testPivotTableCache();
+
 void testSheetCopy();
 void testSheetMove();
 void testExternalRef();
@@ -200,6 +203,7 @@ public:
 CPPUNIT_TEST(testPivotTableDateLabels);
 CPPUNIT_TEST(testPivotTableFilters);
 CPPUNIT_TEST(testPivotTableNamedSource);
+CPPUNIT_TEST(testPivotTableCache);
 CPPUNIT_TEST(testSheetCopy);
 CPPUNIT_TEST(testSheetMove);
 CPPUNIT_TEST(testExternalRef);
@@ -1099,6 +1103,26 @@ struct DPFieldDef
 };
 
 template
+ScRange insertRangeData(ScDocument* pDoc, const ScAddress& rPos, const char* 
aData[][_Size], size_t nRowCount)
+{
+for (size_t i = 0; i < _Size; ++i)
+{
+for (size_t j = 0; j < nRowCount; ++j)
+{
+SCCOL nCol = i + rPos.Col();
+SCROW nRow = j + rPos.Row();
+pDoc->SetString(nCol, nRow, rPos.Tab(), OUString(aData[j][i], 
strlen(aData[j][i]), RTL_TEXTENCODING_UTF8));
+}
+}
+
+ScRange aRange(rPos);
+aRange.aEnd.SetCol(rPos.Col()+_Size-1);
+aRange.aEnd.SetRow(rPos.Row()+nRowCount-1);
+printRange(pDoc, aRange, "Range data content");
+return aRange;
+}
+
+template
 ScRange insertDPSourceData(ScDocument* pDoc, DPFieldDef aFields[], size_t 
nFieldCount, const char* aData[][_Size], size_t nDataCount)
 {
 // Insert field names in row 0.
@@ -1850,6 +1874,121 @@ void Test::testPivotTableNamedSource()
 m_pDoc->DeleteTab(0);
 }
 
+void Test::testPivotTableCache()
+{
+m_pDoc->InsertTab(0, OUString(RTL_CONSTASCII_USTRINGPARAM("Data")));
+
+// Raw data
+const char* aData[][3] = {
+{ "F1", "F2", "F3" },
+{ "Z",  "A", "30" },
+{ "R",  "A", "20" },
+{ "A",  "B", "45" },
+{ "F",  "B", "12" },
+{ "Y",  "C",  "8" },
+{ "12", "C", "15" },
+};
+
+ScAddress aPos(1,1,0);
+ScRange aDataRange = insertRangeData(m_pDoc, aPos, aData, 
SAL_N_ELEMENTS(aData));
+CPPUNIT_ASSERT_MESSAGE("failed to insert range data at correct position", 
aDataRange.aStart == aPos);
+
+ScDPCache aCache(m_pDoc);
+aCache.InitFromDoc(m_pDoc, aDataRange);
+long nDimCount = aCache.GetColumnCount();
+CPPUNIT_ASSERT_MESSAGE("wrong dimension count.", nDimCount == 3);
+rtl::OUString aDimName = aCache.GetDimensionName(0);
+CPPUNIT_ASSERT_MESSAGE("wrong dimension name", aDimName.equalsAscii("F1"));
+aDimName = aCache.GetDimensionName(1);
+CPPUNIT_ASSERT_MESSAGE("wrong dimension name", aDimName.equalsAscii("F2"));
+aDimName = aCache.GetDimensionName(2);
+CPPUNIT_ASSERT_MESSAGE("wrong dimension name", aDimName.equalsAscii("F3"));
+
+// In each dimension, member ID values also represent their order;
+// dimension members are sorted in ascending order.  And values come
+// before strings.  Also, no duplicate dimension members exist.
+
+// Dimension 0 - a mix of strings and values.
+long nMemCount = aCache.GetDimMemberCount(0);
+CPPUNIT_ASSERT_MESSAGE("wrong dimension member count", nMemCount == 6);
+const ScDPItemData* pItem = aCache.GetItemDataById(0, 0);
+CPPUNIT_ASSERT_MESSAGE("wrong item value", pItem &&
+   pItem->GetType() == ScDPItemData::Value &&
+   pItem->GetValue() == 12);
+pItem = a

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

2012-03-16 Thread Kohei Yoshida
 sc/inc/dpcache.hxx   |2 -
 sc/source/core/data/dpcache.cxx  |   44 +++
 sc/source/core/data/dpcachetable.cxx |   17 +++--
 3 files changed, 9 insertions(+), 54 deletions(-)

New commits:
commit 357059019541c36e5eb0bc3c98d5ed2f12d41371
Author: Kohei Yoshida 
Date:   Fri Mar 16 09:35:40 2012 -0400

Prevent out-of-bound array access.

Source range may not start from column 0.

diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 70c..3e5b433 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -370,7 +370,7 @@ bool ScDPCache::InitFromDoc(ScDocument* pDoc, const 
ScRange& rRange)
 for (sal_uInt16 nCol = nStartCol; nCol <= nEndCol; ++nCol)
 {
 AddLabel(createLabelString(pDoc, nCol, nStartRow, nDocTab));
-Field& rField = maFields[nCol];
+Field& rField = maFields[nCol-nStartCol];
 std::vector aBuckets;
 aBuckets.reserve(nEndRow-nStartRow); // skip the topmost label cell.
 
commit b41cf4c6153e9c4f7f56d0441a649664ffd4c7c2
Author: Kohei Yoshida 
Date:   Fri Mar 16 00:00:59 2012 -0400

We shouldn't skip empty columns, or else column index becomes out of sync.

diff --git a/sc/source/core/data/dpcachetable.cxx 
b/sc/source/core/data/dpcachetable.cxx
index 4b7338f..dc7a63a 100644
--- a/sc/source/core/data/dpcachetable.cxx
+++ b/sc/source/core/data/dpcachetable.cxx
@@ -161,6 +161,7 @@ void ScDPCacheTable::fillTable(
 // Data rows
 for (SCCOL nCol = 0; nCol < nColCount; ++nCol)
 {
+maFieldEntries.push_back( vector() );
 SCROW nMemCount = getCache()->GetDimMemberCount( nCol );
 if ( nMemCount )
 {
@@ -188,7 +189,6 @@ void ScDPCacheTable::fillTable(
 
 aAdded[nOrder] = nIndex;
 }
-maFieldEntries.push_back( vector() );
 for ( SCROW nRow = 0; nRow < nMemCount; nRow++ )
 {
 if ( aAdded[nRow] != -1 )
@@ -216,6 +216,7 @@ void ScDPCacheTable::fillTable()
 // Data rows
 for (SCCOL nCol = 0; nCol < nColCount; ++nCol)
 {
+maFieldEntries.push_back( vector() );
 SCROW nMemCount = getCache()->GetDimMemberCount( nCol );
 if ( nMemCount )
 {
@@ -234,7 +235,6 @@ void ScDPCacheTable::fillTable()
 
 pAdded[nOrder] = nIndex;
 }
-maFieldEntries.push_back( vector() );
 for ( SCROW nRow = 0; nRow < nMemCount; nRow++ )
 {
 if ( pAdded[nRow] != -1 )
commit 9776cc1503690e4ccb0dd1d8d6cf6c35d5c8f01d
Author: Kohei Yoshida 
Date:   Thu Mar 15 23:40:12 2012 -0400

Check all this in one place i.e. in ValidQuery().

diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 40ca039..70c 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -471,8 +471,12 @@ bool ScDPCache::InitFromDataBase (const 
Reference& xRowSet, const
 
 bool ScDPCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam) const
 {
+if (!rParam.GetEntryCount())
+return true;
+
 if (!rParam.GetEntry(0).bDoQuery)
 return true;
+
 bool bMatchWholeCell = mpDoc->GetDocOptions().IsMatchWholeCell();
 
 SCSIZE nEntryCount = rParam.GetEntryCount();
diff --git a/sc/source/core/data/dpcachetable.cxx 
b/sc/source/core/data/dpcachetable.cxx
index c32d079..4b7338f 100644
--- a/sc/source/core/data/dpcachetable.cxx
+++ b/sc/source/core/data/dpcachetable.cxx
@@ -64,15 +64,6 @@ using ::com::sun::star::uno::UNO_QUERY;
 using ::com::sun::star::uno::UNO_QUERY_THROW;
 using ::com::sun::star::sheet::DataPilotFieldFilter;
 
-
-static sal_Bool lcl_HasQueryEntry( const ScQueryParam& rParam )
-{
-return rParam.GetEntryCount() > 0 &&
-rParam.GetEntry(0).bDoQuery;
-}
-
-// 
-
 bool ScDPCacheTable::RowFlag::isActive() const
 {
 return mbShowByFilter && mbShowByPage;
@@ -186,9 +177,9 @@ void ScDPCacheTable::fillTable(
 maRowFlags.back().mbShowByFilter = false;
 }
 
-if ( lcl_HasQueryEntry(rQuery) &&
-!getCache()->ValidQuery(nRow , rQuery) )
+if (!getCache()->ValidQuery(nRow, rQuery))
 continue;
+
 if ( bIgnoreEmptyRows &&  getCache()->IsRowEmpty( nRow ) )
 continue;
 
commit efdb67ca924dc0072c6984a68c9b97db260464b6
Author: Kohei Yoshida 
Date:   Thu Mar 15 23:32:34 2012 -0400

We don't ever compare equality of two caches.

That'd be super-expensive anyway.

diff --git a/sc/inc/dpcache.hxx b/sc/inc/dpcache.hxx
index 1e26688..bd2fa5a 100644
--- a/sc/inc/dpcache.hxx
+++ b/sc/inc/dpcache.hxx
@@ -152,8 +152,6 @@ public:
 
 con

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

2012-03-15 Thread Kohei Yoshida
 sc/inc/dpcache.hxx  |   16 
 sc/source/core/data/dpcache.cxx |   31 ++-
 2 files changed, 6 insertions(+), 41 deletions(-)

New commits:
commit 0c1a63b1fbbd9540a724f6918675a5559b19c156
Author: Kohei Yoshida 
Date:   Thu Mar 15 20:30:52 2012 -0400

No need to trim capacity any more; it's allocated to the exact size.

diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 4c93501..928e511 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -756,12 +756,6 @@ public:
 void ScDPCache::PostInit()
 {
 maEmptyRows.build_tree();
-FieldsType::iterator it = maFields.begin(), itEnd = maFields.end();
-for (; it != itEnd; ++it)
-{
-// Trim excess capacity.
-ItemsType(it->maItems).swap(it->maItems);
-}
 }
 
 void ScDPCache::Clear()
commit 9e19cf80c080929c914dc0bfa069f22c8526c3b0
Author: Kohei Yoshida 
Date:   Thu Mar 15 20:23:10 2012 -0400

We don't need these extra order index array; items are already sorted.

This shaves off extra 5MB of memory with my test document.

diff --git a/sc/inc/dpcache.hxx b/sc/inc/dpcache.hxx
index 6566979..1e26688 100644
--- a/sc/inc/dpcache.hxx
+++ b/sc/inc/dpcache.hxx
@@ -80,7 +80,10 @@ public:
  */
 boost::scoped_ptr mpGroup;
 
-ItemsType maItems; /// Unique values in the field.
+/**
+ * Unique values in the field, stored in ascending order.
+ */
+ItemsType maItems;
 
 /**
  * Original source data represented as indices to the unique value
@@ -89,17 +92,6 @@ public:
  */
 IndexArrayType maData;
 
-/**
- * Ascending order of field items.
- */
-IndexArrayType maGlobalOrder;
-
-/**
- * Ranks of each unique data represented by their index.  It's a
- * reverse mapping of item index to global order index.
- */
-mutable IndexArrayType maIndexOrder;
-
 sal_uLong mnNumFormat;
 
 Field();
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 08b0d25..4c93501 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -376,12 +376,6 @@ void processBuckets(std::vector& aBuckets, 
ScDPCache::Field& rField)
 size_t nLen = distance(itBeg, itUniqueEnd);
 rField.maItems.reserve(nLen);
 std::for_each(itBeg, itUniqueEnd, PushBackValue(rField.maItems));
-
-// The items are actually already sorted.  So, just insert a sequence
-// of integers from 0 and up.
-rField.maGlobalOrder.reserve(nLen);
-for (size_t i = 0; i < nLen; ++i)
-rField.maGlobalOrder.push_back(i);
 }
 
 }
@@ -1120,24 +1114,9 @@ void ScDPCache::ClearGroupFields()
 std::for_each(maFields.begin(), maFields.end(), ClearGroupItems());
 }
 
-SCROW ScDPCache::GetOrder(long nDim, SCROW nIndex) const
+SCROW ScDPCache::GetOrder(long /*nDim*/, SCROW nIndex) const
 {
-OSL_ENSURE( nDim >=0 && nDim < mnColumnCount, 
"ScDPTableDataCache::GetOrder : out of bound" );
-
-const Field& rField = maFields[nDim];
-if (rField.maIndexOrder.size() !=  rField.maGlobalOrder.size())
-{ //not inited
-SCROW nRow  = 0;
-rField.maIndexOrder.resize(rField.maGlobalOrder.size(), 0);
-for (size_t i = 0, n = rField.maGlobalOrder.size(); i < n; ++i)
-{
-nRow = rField.maGlobalOrder[i];
-rField.maIndexOrder[nRow] = i;
-}
-}
-
-OSL_ENSURE(nIndex >= 0 && sal::static_int_cast(nIndex) < 
rField.maIndexOrder.size() , "ScDPTableDataCache::GetOrder");
-return rField.maIndexOrder[nIndex];
+return nIndex;
 }
 
 ScDocument* ScDPCache::GetDoc() const
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-03-15 Thread Kohei Yoshida
 sc/inc/dpcache.hxx |9 
 sc/inc/dpitemdata.hxx  |2 
 sc/source/core/data/dpcache.cxx|  401 +
 sc/source/core/data/dpdimsave.cxx  |   12 -
 sc/source/core/data/dpitemdata.cxx |   11 +
 5 files changed, 254 insertions(+), 181 deletions(-)

New commits:
commit 20d55ad66f0f94c9f6a583b5406a39717c1c6d46
Author: Kohei Yoshida 
Date:   Thu Mar 15 15:39:51 2012 -0400

Consolidated file-local functions.

diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 140885e..08b0d25 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -62,89 +62,6 @@ using ::com::sun::star::uno::Reference;
 using ::com::sun::star::uno::UNO_QUERY;
 using ::com::sun::star::uno::UNO_QUERY_THROW;
 
-namespace {
-
-void getItemValue(
-ScDPItemData& rData, const Reference& xRow, sal_Int32 nType,
-long nCol, const Date& rNullDate, short& rNumType)
-{
-rNumType = NUMBERFORMAT_NUMBER;
-try
-{
-double fValue = 0.0;
-switch (nType)
-{
-case sdbc::DataType::BIT:
-case sdbc::DataType::BOOLEAN:
-{
-rNumType = NUMBERFORMAT_LOGICAL;
-fValue  = xRow->getBoolean(nCol) ? 1 : 0;
-rData.SetValue(fValue);
-break;
-}
-case sdbc::DataType::TINYINT:
-case sdbc::DataType::SMALLINT:
-case sdbc::DataType::INTEGER:
-case sdbc::DataType::BIGINT:
-case sdbc::DataType::FLOAT:
-case sdbc::DataType::REAL:
-case sdbc::DataType::DOUBLE:
-case sdbc::DataType::NUMERIC:
-case sdbc::DataType::DECIMAL:
-{
-//! do the conversion here?
-fValue = xRow->getDouble(nCol);
-rData.SetValue(fValue);
-break;
-}
-case sdbc::DataType::DATE:
-{
-rNumType = NUMBERFORMAT_DATE;
-
-util::Date aDate = xRow->getDate(nCol);
-fValue = Date(aDate.Day, aDate.Month, aDate.Year) - rNullDate;
-rData.SetValue(fValue);
-break;
-}
-case sdbc::DataType::TIME:
-{
-rNumType = NUMBERFORMAT_TIME;
-
-util::Time aTime = xRow->getTime(nCol);
-fValue = ( aTime.Hours * 3600 + aTime.Minutes * 60 +
-   aTime.Seconds + aTime.HundredthSeconds / 100.0 ) / 
D_TIMEFACTOR;
-rData.SetValue(fValue);
-break;
-}
-case sdbc::DataType::TIMESTAMP:
-{
-rNumType = NUMBERFORMAT_DATETIME;
-
-util::DateTime aStamp = xRow->getTimestamp(nCol);
-fValue = ( Date( aStamp.Day, aStamp.Month, aStamp.Year ) - 
rNullDate ) +
- ( aStamp.Hours * 3600 + aStamp.Minutes * 60 +
-   aStamp.Seconds + aStamp.HundredthSeconds / 100.0 ) 
/ D_TIMEFACTOR;
-rData.SetValue(fValue);
-break;
-}
-case sdbc::DataType::CHAR:
-case sdbc::DataType::VARCHAR:
-case sdbc::DataType::LONGVARCHAR:
-case sdbc::DataType::SQLNULL:
-case sdbc::DataType::BINARY:
-case sdbc::DataType::VARBINARY:
-case sdbc::DataType::LONGVARBINARY:
-default:
-rData.SetString(xRow->getString(nCol));
-}
-}
-catch (uno::Exception&)
-{
-}
-}
-
-}
-
 ScDPCache::GroupItems::GroupItems() {}
 
 ScDPCache::GroupItems::GroupItems(const ScDPNumGroupInfo& rInfo) :
@@ -282,6 +199,85 @@ void initFromCell(ScDocument* pDoc, SCCOL nCol, SCROW 
nRow, SCTAB nTab, ScDPItem
 }
 }
 
+void getItemValue(
+ScDPItemData& rData, const Reference& xRow, sal_Int32 nType,
+long nCol, const Date& rNullDate, short& rNumType)
+{
+rNumType = NUMBERFORMAT_NUMBER;
+try
+{
+double fValue = 0.0;
+switch (nType)
+{
+case sdbc::DataType::BIT:
+case sdbc::DataType::BOOLEAN:
+{
+rNumType = NUMBERFORMAT_LOGICAL;
+fValue  = xRow->getBoolean(nCol) ? 1 : 0;
+rData.SetValue(fValue);
+break;
+}
+case sdbc::DataType::TINYINT:
+case sdbc::DataType::SMALLINT:
+case sdbc::DataType::INTEGER:
+case sdbc::DataType::BIGINT:
+case sdbc::DataType::FLOAT:
+case sdbc::DataType::REAL:
+case sdbc::DataType::DOUBLE:
+case sdbc::DataType::NUMERIC:
+case sdbc::DataType::DECIMAL:
+{
+//! do the conversion here?
+fValue = xRow->getDouble(nCol);

[Libreoffice-commits] .: sc/workben

2012-03-14 Thread Kohei Yoshida
 sc/workben/dpcache/perf-test.cpp |  434 +++
 1 file changed, 434 insertions(+)

New commits:
commit e4fb449706b5847311ed14475d3babd6398973c7
Author: Kohei Yoshida 
Date:   Wed Mar 14 22:46:41 2012 -0400

Some proof-of-concept code for dpcache performance.

diff --git a/sc/workben/dpcache/perf-test.cpp b/sc/workben/dpcache/perf-test.cpp
new file mode 100644
index 000..ab9e80b
--- /dev/null
+++ b/sc/workben/dpcache/perf-test.cpp
@@ -0,0 +1,434 @@
+/* -*- 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 Kohei Yoshida 
+ *
+ * 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.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+using namespace std;
+
+namespace {
+
+class stack_printer
+{
+public:
+explicit stack_printer(const char* msg) :
+msMsg(msg)
+{
+fprintf(stdout, "%s: --begin\n", msMsg.c_str());
+mfStartTime = getTime();
+}
+
+~stack_printer()
+{
+double fEndTime = getTime();
+fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), 
(fEndTime-mfStartTime));
+}
+
+void printTime(int line) const
+{
+double fEndTime = getTime();
+fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), 
line, (fEndTime-mfStartTime));
+}
+
+private:
+double getTime() const
+{
+timeval tv;
+gettimeofday(&tv, NULL);
+return tv.tv_sec + tv.tv_usec / 100.0;
+}
+
+::std::string msMsg;
+double mfStartTime;
+};
+
+typedef std::vector values_type;
+typedef std::vector indices_type;
+
+#if 1
+size_t val_count = 600;
+double multiplier = 30.0;
+bool dump_values = false;
+#else
+size_t val_count = 20;
+double multiplier = 10.0;
+bool dump_values = true;
+#endif
+
+struct field : boost::noncopyable
+{
+values_type items;   /// unique values
+indices_type data;   /// original value series as indices into unique 
values.
+indices_type order;  /// ascending order of the values as indices.
+};
+
+long compare(int left, int right)
+{
+if (left == right)
+return 0;
+if (left < right)
+return -1;
+return 1;
+}
+
+bool has_item(const values_type& items, const indices_type& order, int val, 
long& index)
+{
+index = items.size();
+bool found = false;
+long low = 0;
+long high = items.size() - 1;
+long comp_res;
+while (low <= high)
+{
+long this_index = (low + high) / 2;
+comp_res = compare(items[order[this_index]], val);
+if (comp_res < 0)
+low = this_index + 1;
+else
+{
+high = this_index - 1;
+if (comp_res == 0)
+{
+found = true;
+low = this_index;
+}
+}
+}
+index = low;
+return found;
+}
+
+bool check_items(const values_type& items)
+{
+if (items.empty())
+return false;
+
+// Items are supposed to be all unique values.
+values_type copied(items);
+sort(copied.begin(), copied.end());
+copied.erase(unique(copied.begin(), copied.end()), copied.end());
+return copied.size() == items.size();
+}
+
+bool check_order(const values_type& items, const indices_type& order)
+{
+// Ensure that the order is truly in ascending order.
+if (items.size() != order.size())
+return false;
+
+if (items.empty())
+return false;
+
+indices_type::const_iterator it = order.begin();
+values_type::value_type prev = items[*it];
+for (++it; it != order.end(); ++it)
+{
+values_type::value_type val = items[*it];
+if (prev >= val)
+return false;
+
+prev = val;
+}
+
+return true;
+}
+
+bool check_data(const values_type& items, const indices_type&a

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

2012-03-14 Thread Kohei Yoshida
 sc/inc/dapiuno.hxx  |1 +
 sc/source/ui/unoobj/dapiuno.cxx |   24 ++--
 2 files changed, 15 insertions(+), 10 deletions(-)

New commits:
commit f697d7aa5c26f9fcfd717b76a4827a5bcb38325e
Author: Kohei Yoshida 
Date:   Wed Mar 14 20:40:38 2012 -0400

Fix the UNO API for creating a new group dimension.

diff --git a/sc/inc/dapiuno.hxx b/sc/inc/dapiuno.hxx
index fd3ec8d..98bdca0 100644
--- a/sc/inc/dapiuno.hxx
+++ b/sc/inc/dapiuno.hxx
@@ -422,6 +422,7 @@ protected:
 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess 
>
 GetMembers() const;
 
+ScDocShell* GetDocShell() const;
 protected:
 ScDataPilotDescriptorBase& mrParent;
 ScFieldIdentifier   maFieldId;
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index d1d7d96..45a88e7 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -1193,7 +1193,7 @@ void ScDataPilotTableObj::SetDPObject( ScDPObject* 
pDPObject )
 if ( pDPObj && pDocSh )
 {
 ScDBDocFunc aFunc(*pDocSh);
-aFunc.DataPilotUpdate( pDPObj, pDPObject, sal_True, sal_True );
+aFunc.DataPilotUpdate( pDPObj, pDPObject, true, true );
 }
 }
 
@@ -1565,6 +1565,11 @@ Reference< XNameAccess > 
ScDataPilotChildObjBase::GetMembers() const
 return xMembersNA;
 }
 
+ScDocShell* ScDataPilotChildObjBase::GetDocShell() const
+{
+return mrParent.GetDocShell();
+}
+
 // 
 
 ScDataPilotFieldsObj::ScDataPilotFieldsObj( ScDataPilotDescriptorBase& rParent 
) :
@@ -2569,13 +2574,13 @@ Reference< XDataPilotField > SAL_CALL 
ScDataPilotFieldObj::createNameGroup( cons
 ScDPObject* pDPObj = 0;
 if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) )
 {
-String aDimName = pDim->GetName();
+rtl::OUString aDimName = pDim->GetName();
 
 ScDPSaveData aSaveData = *pDPObj->GetSaveData();
 ScDPDimensionSaveData* pDimData = aSaveData.GetDimensionData(); // 
created if not there
 
 // find original base
-String aBaseDimName( aDimName );
+rtl::OUString aBaseDimName( aDimName );
 const ScDPSaveGroupDimension* pBaseGroupDim = 
pDimData->GetNamedGroupDim( aDimName );
 if ( pBaseGroupDim )
 {
@@ -2595,7 +2600,7 @@ Reference< XDataPilotField > SAL_CALL 
ScDataPilotFieldObj::createNameGroup( cons
 {
 for (nEntry=0; nEntry SAL_CALL 
ScDataPilotFieldObj::createNameGroup( cons
 if ( !pGroupDimension )
 {
 // create a new group dimension
-String aGroupDimName = pDimData->CreateGroupDimName( aBaseDimName, 
*pDPObj, false, NULL );
-pNewGroupDim = new ScDPSaveGroupDimension( aBaseDimName, 
aGroupDimName );
-sNewDim = aGroupDimName;
+sNewDim = pDimData->CreateGroupDimName( aBaseDimName, *pDPObj, 
false, NULL );
+pNewGroupDim = new ScDPSaveGroupDimension( aBaseDimName, sNewDim );
 
 pGroupDimension = pNewGroupDim; // make changes to the new dim 
if none existed
 
@@ -2645,10 +2649,10 @@ Reference< XDataPilotField > SAL_CALL 
ScDataPilotFieldObj::createNameGroup( cons
 }
 }
 }
-String aGroupDimName = pGroupDimension->GetGroupDimName();
+rtl::OUString aGroupDimName = pGroupDimension->GetGroupDimName();
 
 //! localized prefix string
-String aGroupName = pGroupDimension->CreateGroupName( String( 
RTL_CONSTASCII_USTRINGPARAM( "Group" ) ) );
+rtl::OUString aGroupName = pGroupDimension->CreateGroupName( String( 
RTL_CONSTASCII_USTRINGPARAM( "Group" ) ) );
 ScDPSaveGroupItem aGroup( aGroupName );
 Reference< XNameAccess > xMembers = GetMembers();
 if (!xMembers.is())
@@ -2702,7 +2706,7 @@ Reference< XDataPilotField > SAL_CALL 
ScDataPilotFieldObj::createNameGroup( cons
 
 // apply changes
 pDPObj->SetSaveData( aSaveData );
-SetDPObject( pDPObj );
+ScDBDocFunc(*GetDocShell()).RefreshPivotTableGroups(pDPObj);
 }
 
 // if new grouping field has been created (on first group), return it
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: sc/source

2012-03-14 Thread Kohei Yoshida
 sc/source/ui/docshell/dbdocfun.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit f6cba0dbb3819cf2e11f72bc0cdb10d5d90721de
Author: Kohei Yoshida 
Date:   Wed Mar 14 11:27:17 2012 -0400

We need to manually clear the table data in presence of group fields.

There was a hack that did this in ScDPObject, which I removed.  But we
still need to do the same except this time it's outside of ScDPObject.

diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index 2881e1d..c1464b1 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1460,6 +1460,11 @@ 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::set aRefs;
 sal_uLong nErrId = pDPs->ReloadCache(pDPObj, aRefs);
 if (nErrId)
@@ -1469,6 +1474,10 @@ sal_uLong ScDBDocFunc::RefreshPivotTables(ScDPObject* 
pDPObj, bool bApi)
 for (; it != itEnd; ++it)
 {
 ScDPObject* pObj = *it;
+if (bHasGroups)
+// Re-build table data for each pivot table when the original 
contains group fields.
+pObj->ClearTableData();
+
 // This action is intentionally not undoable since it modifies cache.
 DataPilotUpdate(pObj, pObj, false, bApi);
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: cui/source vcl/source

2012-03-14 Thread Kohei Yoshida
 cui/source/tabpages/page.h   |1 +
 cui/source/tabpages/page.src |2 ++
 vcl/source/gdi/print.cxx |3 ++-
 vcl/source/src/print.src |1 +
 4 files changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 467ac438a3864b3f10ca2f14ed7c5497cf75e4de
Author: Takeshi Abe 
Date:   Wed Mar 14 02:07:36 2012 +0900

add 'Japanese Postcard' paper size to both Paper format and Print dialog

diff --git a/cui/source/tabpages/page.h b/cui/source/tabpages/page.h
index 9a6af59..bc7ad78 100644
--- a/cui/source/tabpages/page.h
+++ b/cui/source/tabpages/page.h
@@ -72,6 +72,7 @@
 #define PAPERSIZE_B4_JIS34
 #define PAPERSIZE_B5_JIS35
 #define PAPERSIZE_B6_JIS36
+#define PAPERSIZE_POSTCARD_JP   46
 #define PAPERSIZE_A656
 
 #endif
diff --git a/cui/source/tabpages/page.src b/cui/source/tabpages/page.src
index b1bf107..91873c7 100644
--- a/cui/source/tabpages/page.src
+++ b/cui/source/tabpages/page.src
@@ -418,6 +418,7 @@ StringArray RID_SVXSTRARY_PAPERSIZE_STD
 < "#10 Envelope" ; PAPERSIZE_COM10; > ;
 < "#11 Envelope" ; PAPERSIZE_COM11; > ;
 < "#12 Envelope" ; PAPERSIZE_COM12; > ;
+< "Japanese Postcard" ; PAPERSIZE_POSTCARD_JP; > ;
 };
 };
 StringArray RID_SVXSTRARY_PAPERSIZE_DRAW
@@ -452,6 +453,7 @@ StringArray RID_SVXSTRARY_PAPERSIZE_DRAW
 < "C4 Envelope" ; PAPERSIZE_C4 ; > ;
 < "Dia Slide" ; PAPERSIZE_DIA ; > ;
 < "Screen" ; PAPERSIZE_SCREEN ; > ;
+< "Japanese Postcard" ; PAPERSIZE_POSTCARD_JP; > ;
 };
 };
  // ** EOF
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index e25aa3a..90e8403 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -1267,7 +1267,8 @@ rtl::OUString Printer::GetPaperName( Paper ePaper )
 PAPER_ENV_DL, PAPER_SLIDE_DIA, PAPER_SCREEN, PAPER_C, PAPER_D, 
PAPER_E,
 PAPER_EXECUTIVE, PAPER_FANFOLD_LEGAL_DE, PAPER_ENV_MONARCH, 
PAPER_ENV_PERSONAL,
 PAPER_ENV_9, PAPER_ENV_10, PAPER_ENV_11, PAPER_ENV_12, 
PAPER_KAI16,
-PAPER_KAI32, PAPER_KAI32BIG, PAPER_B4_JIS, PAPER_B5_JIS, 
PAPER_B6_JIS
+PAPER_KAI32, PAPER_KAI32BIG, PAPER_B4_JIS, PAPER_B5_JIS, 
PAPER_B6_JIS,
+PAPER_POSTCARD_JP
 };
 OSL_ENSURE( sal_uInt32(SAL_N_ELEMENTS(PaperIndex)) == 
aPaperStrings.Count(), "localized paper name count wrong" );
 for( int i = 0; i < int(SAL_N_ELEMENTS(PaperIndex)); i++ )
diff --git a/vcl/source/src/print.src b/vcl/source/src/print.src
index e1dab96..986c381 100644
--- a/vcl/source/src/print.src
+++ b/vcl/source/src/print.src
@@ -531,6 +531,7 @@ StringArray RID_STR_PAPERNAMES
 < "B4 (JIS)"; >;
 < "B5 (JIS)"; >;
 < "B6 (JIS)"; >;
+< "Japanese Postcard"; >;
 };
 };
 
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-03-13 Thread Kohei Yoshida
 sc/inc/dpcache.hxx |1 
 sc/inc/dpgroup.hxx |2 
 sc/inc/dpobject.hxx|   19 +++
 sc/qa/unit/ucalc.cxx   |4 
 sc/source/core/data/dpcache.cxx|   10 +-
 sc/source/core/data/dpdimsave.cxx  |9 +
 sc/source/core/data/dpgroup.cxx|5 +
 sc/source/core/data/dpobject.cxx   |  184 ++---
 sc/source/ui/docshell/dbdocfun.cxx |   81 ++--
 sc/source/ui/inc/dbdocfun.hxx  |   16 ++-
 sc/source/ui/unoobj/dapiuno.cxx|9 -
 sc/source/ui/view/dbfunc3.cxx  |   37 ++-
 12 files changed, 311 insertions(+), 66 deletions(-)

New commits:
commit 49d3e30ec975a348b7b3d82c37137eb8ff6bb52e
Author: Kohei Yoshida 
Date:   Wed Mar 14 00:31:56 2012 -0400

When changing grouping in one pivot table, update all linked tables.

We need to do this now because we now store the group field data directly
in the pivot cache, which is shared by all referencing tables.

Also, actions involving modification of the cache is not undoable, and
making it undoable would significantly increase Calc's runtime memory
footprint.  So, no way.

diff --git a/sc/inc/dpcache.hxx b/sc/inc/dpcache.hxx
index 8ece780..ea0c085 100644
--- a/sc/inc/dpcache.hxx
+++ b/sc/inc/dpcache.hxx
@@ -137,6 +137,7 @@ public:
 void ResetGroupItems(long nDim, const ScDPNumGroupInfo& rNumInfo);
 SCROW SetGroupItem(long nDim, const ScDPItemData& rData);
 void GetGroupDimMemberIds(long nDim, std::vector& rIds) const;
+void ClearGroupFields();
 
 SCCOL GetDimensionIndex(const rtl::OUString& sName) const;
 sal_uLong GetNumberFormat( long nDim ) const;
diff --git a/sc/inc/dpgroup.hxx b/sc/inc/dpgroup.hxx
index b81db64..987c806 100644
--- a/sc/inc/dpgroup.hxx
+++ b/sc/inc/dpgroup.hxx
@@ -176,6 +176,8 @@ public:
 ScDPGroupTableData( const ::boost::shared_ptr& 
pSource, ScDocument* pDocument );
 virtual ~ScDPGroupTableData();
 
+boost::shared_ptr GetSourceTableData();
+
 voidAddGroupDimension( const ScDPGroupDimension& rGroup );
 voidSetNumGroupDimension( long nIndex, const 
ScDPNumGroupDimension& rGroup );
 longGetDimensionIndex( const rtl::OUString& rName );
diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index 5b16b59..917759d 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -137,6 +137,7 @@ public:
 
 voidInvalidateData();
 void ClearTableData();
+void ReloadGroupTableData();
 
 voidOutput( const ScAddress& rPos );
 ScRange GetNewOutputRange( bool& rOverflow );
@@ -286,6 +287,8 @@ public:
 UpdateRefMode eMode, const ScRange& r, SCsCOL nDx, SCsROW nDy, 
SCsTAB nDz);
 
 private:
+ScDPCache* getExistingCache(const ScRange& rRange);
+
 void updateCache(const ScRange& rRange, const ScDPDimensionSaveData* 
pDimData, std::set& rRefs);
 bool remove(const ScDPCache* p);
 };
@@ -306,6 +309,8 @@ public:
 const ::rtl::OUString& rName, const ScRange& rRange, const 
ScDPDimensionSaveData* pDimData);
 size_t size() const;
 private:
+ScDPCache* getExistingCache(const rtl::OUString& rName);
+
 void updateCache(
 const rtl::OUString& rName, const ScRange& rRange,
 const ScDPDimensionSaveData* pDimData, std::set& 
rRefs);
@@ -346,6 +351,9 @@ public:
 const ScDPDimensionSaveData* pDimData);
 
 private:
+ScDPCache* getExistingCache(
+sal_Int32 nSdbType, const ::rtl::OUString& rDBName, const 
::rtl::OUString& rCommand);
+
 com::sun::star::uno::Reference 
createRowSet(
 sal_Int32 nSdbType, const ::rtl::OUString& rDBName, const 
::rtl::OUString& rCommand);
 
@@ -359,6 +367,7 @@ public:
 ~ScDPCollection();
 
 sal_uLong ReloadCache(ScDPObject* pDPObj, std::set& rRefs);
+bool ReloadGroupsInCache(ScDPObject* pDPObj, std::set& rRefs);
 
 SC_DLLPUBLIC size_t GetCount() const;
 SC_DLLPUBLIC ScDPObject* operator[](size_t nIndex);
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 6ad497e..fe262ac 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -1053,6 +1053,12 @@ struct ClearGroupItems : 
std::unary_function
 
 }
 
+void ScDPCache::ClearGroupFields()
+{
+maGroupFields.clear();
+std::for_each(maFields.begin(), maFields.end(), ClearGroupItems());
+}
+
 SCROW ScDPCache::GetOrder(long nDim, SCROW nIndex) const
 {
 OSL_ENSURE( nDim >=0 && nDim < mnColumnCount, 
"ScDPTableDataCache::GetOrder : out of bound" );
diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx
index 9b7720d..aca81eb 100644
--- a/sc/source/core/data/dpgroup.cxx
+++ b/sc/source/c

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

2012-03-12 Thread Kohei Yoshida
 sc/source/core/data/dpgroup.cxx|   69 ++---
 sc/source/core/data/dpitemdata.cxx |1 
 2 files changed, 58 insertions(+), 12 deletions(-)

New commits:
commit 32b3e93e04df2b09cb3bdeda8bea32a51bbf1b09
Author: Kohei Yoshida 
Date:   Tue Mar 13 00:17:21 2012 -0400

Get drill-down by double-click to work with number-grouped data.

This never worked before, going back to the OOo days...

diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx
index 57403c0..9b7720d 100644
--- a/sc/source/core/data/dpgroup.cxx
+++ b/sc/source/core/data/dpgroup.cxx
@@ -77,6 +77,46 @@ inline bool IsInteger( double fValue )
 
 }
 
+class ScDPGroupNumFilter : public ScDPCacheTable::FilterBase
+{
+public:
+ScDPGroupNumFilter(const ScDPItemData& rValue, const ScDPNumGroupInfo& 
rInfo);
+virtual ~ScDPGroupNumFilter() {}
+virtual bool match(const ScDPItemData &rCellData) const;
+private:
+ScDPItemData maValue;
+ScDPNumGroupInfo maNumInfo;
+};
+
+ScDPGroupNumFilter::ScDPGroupNumFilter(const ScDPItemData& rValue, const 
ScDPNumGroupInfo& rInfo) :
+maValue(rValue), maNumInfo(rInfo) {}
+
+bool ScDPGroupNumFilter::match(const ScDPItemData& rCellData) const
+{
+if (rCellData.GetType() != ScDPItemData::Value)
+return false;
+
+double fVal = maValue.GetValue();
+if (rtl::math::isInf(fVal))
+{
+if (rtl::math::isSignBitSet(fVal))
+{
+// Less than the min value.
+return rCellData.GetValue() < maNumInfo.mfStart;
+}
+
+// Greater than the max value.
+return maNumInfo.mfEnd < rCellData.GetValue();
+}
+
+double low = fVal;
+double high = low + maNumInfo.mfStep;
+if (maNumInfo.mbIntegerOnly)
+high += 1.0;
+
+return low <= rCellData.GetValue() && rCellData.GetValue() < high;
+}
+
 class ScDPGroupDateFilter : public ScDPCacheTable::FilterBase
 {
 public:
@@ -89,9 +129,9 @@ public:
 private:
 ScDPGroupDateFilter(); // disabled
 
-ScDPItemDatamaValue;
-const Date  maNullDate;
-const ScDPNumGroupInfo  maNumInfo;
+ScDPItemData maValue;
+Date maNullDate;
+ScDPNumGroupInfo maNumInfo;
 };
 
 // 
@@ -682,19 +722,24 @@ void 
ScDPGroupTableData::ModifyFilterCriteria(vector&
 if (IsNumGroupDimension(itr->mnFieldIndex))
 {
 // internal number group field
+ScDPCacheTable::Criterion aCri;
+aCri.mnFieldIndex = itr->mnFieldIndex;
 const ScDPNumGroupDimension& rNumGrpDim = 
pNumGroups[itr->mnFieldIndex];
 const ScDPDateGroupHelper* pDateHelper = 
rNumGrpDim.GetDateHelper();
-if (!pDateHelper)
+
+if (pDateHelper)
 {
-// What do we do here !?
-continue;
+// grouped by dates.
+aCri.mpFilter.reset(
+new ScDPGroupDateFilter(
+pFilter->getMatchValue(), 
*pDoc->GetFormatTable()->GetNullDate(), pDateHelper->GetNumInfo()));
+}
+else
+{
+// This dimension is grouped by numeric ranges.
+aCri.mpFilter.reset(
+new ScDPGroupNumFilter(pFilter->getMatchValue(), 
rNumGrpDim.GetInfo()));
 }
-
-ScDPCacheTable::Criterion aCri;
-aCri.mnFieldIndex = itr->mnFieldIndex;
-aCri.mpFilter.reset(
-new ScDPGroupDateFilter(
-pFilter->getMatchValue(), 
*pDoc->GetFormatTable()->GetNullDate(), pDateHelper->GetNumInfo()));
 
 aNewCriteria.push_back(aCri);
 }
commit 307bfa235b40f013f6c5fda30aced14957b62dd7
Author: Kohei Yoshida 
Date:   Mon Mar 12 22:09:36 2012 -0400

Forgot to add break here...

diff --git a/sc/source/core/data/dpitemdata.cxx 
b/sc/source/core/data/dpitemdata.cxx
index dd370ca..43c01cb 100644
--- a/sc/source/core/data/dpitemdata.cxx
+++ b/sc/source/core/data/dpitemdata.cxx
@@ -278,6 +278,7 @@ void ScDPItemData::Dump(const char* msg) const
 break;
 case RangeStart:
 printf("range start: %g\n", mfValue);
+break;
 default:
 printf("unknown type\n");
 }
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2012-03-12 Thread Kohei Yoshida
 sc/inc/dpitemdata.hxx  |2 --
 sc/source/core/data/dpitemdata.cxx |   11 ---
 unusedcode.easy|2 --
 3 files changed, 15 deletions(-)

New commits:
commit 8a10f9e3e9ecc2f2b626ce27c3a105dffbde5373
Author: Santiago Martinez 
Date:   Mon Mar 12 20:38:51 2012 +0100

Remove unused code in dpitemdata

diff --git a/sc/inc/dpitemdata.hxx b/sc/inc/dpitemdata.hxx
index 3e09d89..10363be 100644
--- a/sc/inc/dpitemdata.hxx
+++ b/sc/inc/dpitemdata.hxx
@@ -79,7 +79,6 @@ public:
 ScDPItemData();
 ScDPItemData(const ScDPItemData& r);
 ScDPItemData(const rtl::OUString& rStr);
-ScDPItemData(double fVal);
 ScDPItemData(sal_Int32 nGroupType, sal_Int32 nValue);
 ~ScDPItemData();
 
@@ -89,7 +88,6 @@ public:
 void SetRangeStart(double fVal);
 void SetRangeFirst();
 void SetRangeLast();
-void SetGroupValue(sal_Int32 nGroupType, sal_Int32 nValue);
 void SetErrorString(const rtl::OUString& rS);
 bool IsCaseInsEqual(const ScDPItemData& r) const;
 
diff --git a/sc/source/core/data/dpitemdata.cxx 
b/sc/source/core/data/dpitemdata.cxx
index 77c01b9..dd370ca 100644
--- a/sc/source/core/data/dpitemdata.cxx
+++ b/sc/source/core/data/dpitemdata.cxx
@@ -112,9 +112,6 @@ void ScDPItemData::DisposeString()
 ScDPItemData::ScDPItemData(const rtl::OUString& rStr) :
 mpString(new rtl::OUString(rStr)), meType(String) {}
 
-ScDPItemData::ScDPItemData(double fVal) :
-mfValue(fVal), meType(Value) {}
-
 ScDPItemData::ScDPItemData(sal_Int32 nGroupType, sal_Int32 nValue) :
 meType(GroupValue)
 {
@@ -167,14 +164,6 @@ void ScDPItemData::SetRangeLast()
 meType = RangeStart;
 }
 
-void ScDPItemData::SetGroupValue(sal_Int32 nGroupType, sal_Int32 nValue)
-{
-DisposeString();
-maGroupValue.mnGroupType = nGroupType;
-maGroupValue.mnValue = nValue;
-meType = GroupValue;
-}
-
 void ScDPItemData::SetErrorString(const rtl::OUString& rS)
 {
 SetString(rS);
diff --git a/unusedcode.easy b/unusedcode.easy
index e1067ed..77ae5b4 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -72,8 +72,6 @@ ScConditionalFormats_Impl::Remove(unsigned short, unsigned 
short)
 ScCsvControl::ScCsvControl(Window*, ScCsvLayoutData const&, long)
 
ScDBCollection::AnonDBs::erase(boost::void_ptr_iterator<__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator > >, 
std::__debug::vector > >, ScDBData>)
 ScDBCollection::AnonDBs::size() const
-ScDPItemData::ScDPItemData(double)
-ScDPItemData::SetGroupValue(int, int)
 ScDPLabelData::ScDPLabelData(rtl::OUString const&, short, bool)
 ScDocRowHeightUpdater::TabRanges::TabRanges()
 
ScFilterDetect::impl_createFactory(com::sun::star::uno::Reference
 const&)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   3   4   5   >