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

2017-09-04 Thread Tor Lillqvist
 sc/inc/document.hxx|   11 ++---
 sc/source/core/data/documen2.cxx   |   78 ++---
 sc/source/core/data/documen3.cxx   |   12 ++---
 sc/source/core/data/documen4.cxx   |4 -
 sc/source/core/data/documen5.cxx   |8 +--
 sc/source/core/data/documen6.cxx   |4 -
 sc/source/core/data/documen8.cxx   |   28 ++---
 sc/source/core/data/documen9.cxx   |   28 ++---
 sc/source/core/data/document.cxx   |   56 +-
 sc/source/core/data/document10.cxx |2 
 sc/source/core/data/fillinfo.cxx   |4 -
 11 files changed, 117 insertions(+), 118 deletions(-)

New commits:
commit fc61be93c60967bf1d6bcffcada8189016d4530e
Author: Tor Lillqvist 
Date:   Tue Sep 5 01:12:40 2017 +0300

Prefix one more member of ScDocument: pShell

Change-Id: I72f2556f54e1ea4b397f9b21b1d767ae597e6e43

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 498ea76b119f..e08378e2242c 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -319,7 +319,7 @@ private:
 SfxUndoManager* mpUndoManager;
 ScFieldEditEngine*  mpEditEngine;   // uses pEditPool from 
xPoolHelper
 ScNoteEditEngine*   mpNoteEngine;   // uses pEditPool from 
xPoolHelper
-SfxObjectShell* pShell;
+SfxObjectShell* mpShell;
 VclPtrpPrinter;
 VclPtr pVirtualDevice_100th_mm;
 ScDrawLayer*pDrawLayer; // SdrModel
@@ -931,7 +931,7 @@ public:
 boolSetDdeLinkResultMatrix( size_t nDdePos, const ScMatrixRef& 
pResults );
 
 SfxBindings*GetViewBindings();
-SfxObjectShell* GetDocumentShell() const{ return 
pShell; }
+SfxObjectShell* GetDocumentShell() const{ return 
mpShell; }
 SC_DLLPUBLIC ScDrawLayer*   GetDrawLayer() { return pDrawLayer;  }
 SC_DLLPUBLIC const ScDrawLayer* GetDrawLayer() const { return pDrawLayer;  
}
 SfxBroadcaster* GetDrawBroadcaster();   // to avoid 
header
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 78cc2a103d05..c54564ddd918 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -138,7 +138,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, 
SfxObjectShell* pDocShell ) :
 mpUndoManager( nullptr ),
 mpEditEngine( nullptr ),
 mpNoteEngine( nullptr ),
-pShell( pDocShell ),
+mpShell( pDocShell ),
 pPrinter( nullptr ),
 pVirtualDevice_100th_mm( nullptr ),
 pDrawLayer( nullptr ),
@@ -266,7 +266,7 @@ const sfx2::LinkManager* ScDocument::GetLinkManager() const
 sc::DocumentLinkManager& ScDocument::GetDocLinkManager()
 {
 if (!mpDocLinkMgr)
-mpDocLinkMgr.reset(new sc::DocumentLinkManager(pShell));
+mpDocLinkMgr.reset(new sc::DocumentLinkManager(mpShell));
 return *mpDocLinkMgr;
 }
 
@@ -297,7 +297,7 @@ sal_uInt32 ScDocument::GetDocumentID() const
 const ScDocument* pThis = this;
 sal_uInt32 nCrc = rtl_crc32( 0, , sizeof(ScDocument*) );
 // the this pointer only might not be sufficient
-nCrc = rtl_crc32( nCrc, , sizeof(SfxObjectShell*) );
+nCrc = rtl_crc32( nCrc, , sizeof(SfxObjectShell*) );
 return nCrc;
 }
 
@@ -328,16 +328,16 @@ IMPL_LINK_NOARG(ScDocument, TrackTimeHdl, Timer *, void)
 {
 aTrackIdle.Start();// try again later
 }
-else if (pShell)// execute
+else if (mpShell)// execute
 {
 TrackFormulas();
-pShell->Broadcast( SfxHint( SfxHintId::ScDataChanged ) );
+mpShell->Broadcast( SfxHint( SfxHintId::ScDataChanged ) );
 
 //  modified...
 
-if (!pShell->IsModified())
+if (!mpShell->IsModified())
 {
-pShell->SetModified();
+mpShell->SetModified();
 SfxBindings* pBindings = GetViewBindings();
 if (pBindings)
 {
@@ -977,16 +977,16 @@ sal_uLong ScDocument::TransferTab( ScDocument* pSrcDoc, 
SCTAB nSrcPos,
 // 3 => NameBox
 // 4 => both
 
-if (pSrcDoc->pShell->GetMedium())
+if (pSrcDoc->mpShell->GetMedium())
 {
-pSrcDoc->maFileURL = 
pSrcDoc->pShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::ToIUri);
+pSrcDoc->maFileURL = 
pSrcDoc->mpShell->GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::ToIUri);
 // for unsaved files use the title name and adjust during save of file
 if (pSrcDoc->maFileURL.isEmpty())
-pSrcDoc->maFileURL = pSrcDoc->pShell->GetName();
+pSrcDoc->maFileURL = pSrcDoc->mpShell->GetName();
 }
 else
 {
-pSrcDoc->maFileURL = pSrcDoc->pShell->GetName();
+pSrcDoc->maFileURL = 

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

2017-04-11 Thread Eike Rathke
 sc/inc/postit.hxx  |4 ++--
 sc/source/core/data/postit.cxx |   30 ++
 sc/source/ui/undo/undocell.cxx |8 
 sc/source/ui/view/notemark.cxx |3 +++
 4 files changed, 31 insertions(+), 14 deletions(-)

New commits:
commit 8aa8be724dafc266d7daeae325806ca2caae2efe
Author: Eike Rathke 
Date:   Tue Apr 11 19:05:46 2017 +0200

deleting pModel also deletes the SdrCaptionObj

Change-Id: Icf3aed35ede1c211d6238dc66d86cb2866b247cd

diff --git a/sc/source/ui/view/notemark.cxx b/sc/source/ui/view/notemark.cxx
index a55cc917ab80..52dc58ef26d0 100644
--- a/sc/source/ui/view/notemark.cxx
+++ b/sc/source/ui/view/notemark.cxx
@@ -65,6 +65,9 @@ ScNoteMarker::ScNoteMarker( vcl::Window* pWin, vcl::Window* 
pRight, vcl::Window*
 
 ScNoteMarker::~ScNoteMarker()
 {
+if (pModel)
+mxObject.release(); // deleting pModel also deletes the 
SdrCaptionObj
+
 InvalidateWin();
 
 delete pModel;
commit 59aebc3e51490ba9c76a261b2e5090b12f30e0da
Author: Eike Rathke 
Date:   Tue Apr 11 18:53:36 2017 +0200

set mbNotOwner at various places

Change-Id: I1ff14c573d556cad15513dfe3f0fecbf9107fa41

diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index ef15c8556762..e8afbb2479dc 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -481,6 +481,7 @@ ScCaptionPtr::ScCaptionPtr( ScCaptionPtr&& r ) :
 {
 r.replaceInList( this );
 r.mpCaption = nullptr;
+r.mbNotOwner = false;
 }
 
 ScCaptionPtr& ScCaptionPtr::operator=( ScCaptionPtr&& r )
@@ -490,9 +491,11 @@ ScCaptionPtr& ScCaptionPtr::operator=( ScCaptionPtr&& r )
 mpHead = r.mpHead;
 mpNext = r.mpNext;
 mpCaption = r.mpCaption;
+mbNotOwner = r.mbNotOwner;
 
 r.replaceInList( this );
 r.mpCaption = nullptr;
+r.mbNotOwner = false;
 
 return *this;
 }
@@ -525,6 +528,7 @@ ScCaptionPtr& ScCaptionPtr::operator=( const ScCaptionPtr& 
r )
 removeFromList();
 
 mpCaption = r.mpCaption;
+mbNotOwner = r.mbNotOwner;
 // That head is this' master.
 mpHead = r.mpHead;
 // Insert into list.
@@ -656,6 +660,7 @@ void ScCaptionPtr::reset( SdrCaptionObj* p )
 decRefAndDestroy();
 removeFromList();
 mpCaption = p;
+mbNotOwner = false;
 if (p)
 {
 newHead();
@@ -776,6 +781,7 @@ bool ScCaptionPtr::forget()
 bool bRet = decRef();
 removeFromList();
 mpCaption = nullptr;
+mbNotOwner = false;
 return bRet;
 }
 
@@ -800,6 +806,7 @@ void ScCaptionPtr::clear()
 mpHead = nullptr;
 mpNext = nullptr;
 mpCaption = nullptr;
+mbNotOwner = false;
 }
 
 
commit 024ddbc7d2ffe6b4b84c48b213296a0716086b6d
Author: Eike Rathke 
Date:   Tue Apr 11 18:05:09 2017 +0200

reset variables when not owner

Change-Id: Ieab4bf36b89abac2d2ff377fc2b6f31ce0e1d3aa

diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 78cd43a6a5c2..ef15c8556762 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -695,9 +695,16 @@ void ScCaptionPtr::decRefAndDestroy()
 #if 1
 // FIXME: there are still cases where the caption pointer is dangling
 mpCaption = nullptr;
+mbNotOwner = false;
 #else
-// Destroying Draw Undo deletes its SdrObject, don't attempt that 
twice.
-if (!mbNotOwner)
+// Destroying Draw Undo and some other delete the SdrObject, don't
+// attempt that twice.
+if (mbNotOwner)
+{
+mpCaption = nullptr;
+mbNotOwner = false;
+}
+else
 {
 removeFromDrawPageAndFree( true );  // ignoring Undo
 if (mpCaption)
commit e777618a59b6a66207d416b7b4dd3e77c2662260
Author: Eike Rathke 
Date:   Tue Apr 11 17:16:32 2017 +0200

rename ScCaptionPtr (mb|set)InUndo to (mb|set)NotOwner

... which better suits the general purpose we'll need

Change-Id: I32805c91d17180d5f18225a02c8a436826242e19

diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx
index a630aef271db..d9584e1e7005 100644
--- a/sc/inc/postit.hxx
+++ b/sc/inc/postit.hxx
@@ -86,7 +86,7 @@ public:
 bool forget();
 
 /** Flag that this instance is in Undo, so drawing layer owns it. */
-void setInUndo();
+void setNotOwner();
 
 oslInterlockedCount getRefs() const;
 
@@ -104,7 +104,7 @@ private:
 Head* mpHead;   ///< points to the "master" entry
 mutable ScCaptionPtr* mpNext;   ///< next in list
 SdrCaptionObj*mpCaption;///< the caption object, managed by 
head master
-bool  mbInUndo; ///< whether this caption object is 
held in Undo
+bool  mbNotOwner;   ///< whether this caption object is 
owned by something else, e.g. held in Undo
 /* TODO: can that be moved to Head?

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

2017-02-15 Thread Pranav Kant
 sc/inc/docuno.hxx |3 +
 sc/inc/viewdata.hxx   |1 
 sc/source/ui/docshell/docfunc.cxx |5 ++
 sc/source/ui/unoobj/docuno.cxx|   71 +++---
 4 files changed, 74 insertions(+), 6 deletions(-)

New commits:
commit a29b0d68011f9e2be8eee466f3f9ccad283f274c
Author: Pranav Kant 
Date:   Wed Feb 8 20:42:17 2017 +0530

sc lok: Prevent showing comments if tiled annotations are off

Change-Id: I594b61e102c0ecacb169ee6064ba96d70c16ab42

diff --git a/sc/source/ui/docshell/docfunc.cxx 
b/sc/source/ui/docshell/docfunc.cxx
index 671b400..dde0818 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -19,6 +19,7 @@
 
 #include "scitems.hxx"
 
+#include 
 #include 
 #include 
 #include 
@@ -1214,7 +1215,9 @@ bool ScDocFunc::ShowNote( const ScAddress& rPos, bool 
bShow )
 {
 ScDocument& rDoc = rDocShell.GetDocument();
 ScPostIt* pNote = rDoc.GetNote( rPos );
-if( !pNote || (bShow == pNote->IsCaptionShown()) ) return false;
+if( !pNote || (bShow == pNote->IsCaptionShown()) ||
+(comphelper::LibreOfficeKit::isActive() && 
!comphelper::LibreOfficeKit::isTiledAnnotations()) )
+return false;
 
 // move the caption to internal or hidden layer and create undo action
 pNote->ShowCaption( rPos, bShow );
commit c7b84ac9ea14e6c96165e3281c4bea422918c83f
Author: Pranav Kant 
Date:   Wed Feb 8 20:40:57 2017 +0530

sc lok: Set appropriate ScViewOptions when annotations are off

Change-Id: I65b3fea9a33396419dff70b134729594c0dda4db

diff --git a/sc/inc/viewdata.hxx b/sc/inc/viewdata.hxx
index 1d9dcda..6a8eb4c 100644
--- a/sc/inc/viewdata.hxx
+++ b/sc/inc/viewdata.hxx
@@ -431,6 +431,7 @@ public:
 voidSetHScrollMode  ( bool bNewMode )   { pOptions->SetOption( 
VOPT_HSCROLL, bNewMode ); }
 boolIsOutlineMode   () const{ return pOptions->GetOption( 
VOPT_OUTLINER ); }
 voidSetOutlineMode  ( bool bNewMode )   { pOptions->SetOption( 
VOPT_OUTLINER, bNewMode ); }
+voidSetNotesMode( bool bNewMode )   { pOptions->SetOption( 
VOPT_NOTES, bNewMode ); }
 
 /// Force page size for PgUp/PgDown to overwrite the computation based on 
m_aVisArea.
 void ForcePageUpDownOffset(long nTwips) { m_nLOKPageUpDownOffset = nTwips; 
}
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index beb3bd6..f506fa5 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1052,6 +1052,10 @@ void ScModelObj::initializeForTiledRendering(const 
css::uno::SequenceSetNotesMode(false);
+
 // default tile size in pixels
 mnTilePixelWidth = 256;
 mnTilePixelHeight = 256;
commit 31b32d156ab69f347f21de29c8ba6cd07cc4dc95
Author: Pranav Kant 
Date:   Thu Feb 9 19:19:38 2017 +0530

sc lok: implement commandvalues command, ViewAnnotations

... to list all notes in calc.

Change-Id: I6c636ebd47ee238c32e3c0b7d10254d237396a51

diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index d496958..e7195e5 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -356,6 +356,9 @@ public:
 
 /// @see vcl::ITiledRenderable::setClientVisibleArea().
 virtual void setClientVisibleArea(const Rectangle& rRectangle) override;
+
+/// @see vcl::ITiledRenderable::getPostIts().
+OUString getPostIts() override;
 };
 
 class ScDrawPagesObj : public cppu::WeakImplHelper<
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 2c43888..beb3bd6 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -19,6 +19,8 @@
 
 #include 
 
+#include 
+
 #include "scitems.hxx"
 #include 
 #include 
@@ -975,6 +977,63 @@ void ScModelObj::setClientVisibleArea(const Rectangle& 
rRectangle)
 pViewData->ForcePageUpDownOffset(rRectangle.GetHeight());
 }
 
+OUString ScModelObj::getPostIts()
+{
+if (!pDocShell)
+return OUString();
+
+const ScDocument& rDoc = pDocShell->GetDocument();
+std::vector aNotes;
+rDoc.GetAllNoteEntries(aNotes);
+
+boost::property_tree::ptree aAnnotations;
+for (const sc::NoteEntry& aNote : aNotes)
+{
+boost::property_tree::ptree aAnnotation;
+aAnnotation.put("id", aNote.maPos.hash());
+aAnnotation.put("author", aNote.mpNote->GetAuthor());
+aAnnotation.put("dateTime", aNote.mpNote->GetDate());
+aAnnotation.put("text", aNote.mpNote->GetText());
+
+// Calculating the cell cursor position
+ScViewData* pViewData = ScDocShell::GetViewData();
+ScGridWindow* pGridWindow = pViewData->GetActiveWin();
+if (pGridWindow)
+{
+Fraction zoomX = Fraction(long(mnTilePixelWidth * 
TWIPS_PER_PIXEL), mnTileTwipWidth);
+Fraction zoomY = Fraction(long(mnTilePixelHeight * 
TWIPS_PER_PIXEL), mnTileTwipHeight);
+
+Fraction 

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

2016-11-12 Thread Kohei Yoshida
 sc/inc/calcmacros.hxx |9 ++-
 sc/inc/column.hxx |2 -
 sc/inc/document.hxx   |2 -
 sc/inc/table.hxx  |2 -
 sc/source/core/data/column2.cxx   |   40 +-
 sc/source/core/data/document.cxx  |2 -
 sc/source/core/data/table1.cxx|2 -
 sc/source/core/tool/sharedformula.cxx |4 +--
 sc/source/ui/inc/gridwin.hxx  |1 
 sc/source/ui/view/gridwin.cxx |4 +++
 sc/source/ui/view/gridwin_dbgutil.cxx |   11 +
 11 files changed, 66 insertions(+), 13 deletions(-)

New commits:
commit f20df23ad9380d19dfb64b51d943109bd3895efe
Author: Kohei Yoshida 
Date:   Sat Nov 12 17:42:57 2016 -0500

Keep loplugin:staticmethods happy.

Change-Id: I2cdf67490d61b2868910e615bfc44d126d207bcb

diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index ce496f6..22d911f 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1670,7 +1670,10 @@ struct FormulaGroupDumper : 
std::unary_function
Date:   Sat Nov 12 17:20:30 2016 -0500

Dump the other block types as well.

Change-Id: Iff41d4c2065a03865f884b2a8a260ffd83835dc1

diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 9c7eb79..ce496f6 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1577,10 +1577,31 @@ struct FormulaGroupDumper : 
std::unary_function
Date:   Sat Nov 12 17:10:56 2016 -0500

Let's not dump formula results.

It could be too verbose.

Change-Id: I5f2da92e78bb069f3bb0c9c07bb3eae6d990f810

diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 1d63bf6..9c7eb79 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1567,6 +1567,8 @@ void ScColumn::CellStorageModified()
 
 namespace {
 
+#define DUMP_FORMULA_RESULTS 0
+
 struct FormulaGroupDumper : std::unary_function
 {
 const ScDocument* mpDoc;
@@ -1620,9 +1622,10 @@ struct FormulaGroupDumper : 
std::unary_functionGetGrammar());
 OUString aFormula = pCell->GetCode()->CreateString(aCxt, pCell->aPos);
-cout << "* formula: " << aFormula << endl;
+cout << "  * formula: " << aFormula << endl;
 }
 
+#if DUMP_FORMULA_RESULTS
 void printResult(const ScFormulaCell* pCell) const
 {
 sc::FormulaResultValue aRes = pCell->GetResult();
@@ -1645,6 +1648,9 @@ struct FormulaGroupDumper : 
std::unary_function

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

2016-11-05 Thread Kohei Yoshida
 sc/inc/formulalogger.hxx|   46 ++
 sc/source/core/data/formulacell.cxx |2 
 sc/source/core/data/grouptokenconverter.cxx |   22 ---
 sc/source/core/inc/grouptokenconverter.hxx  |3 
 sc/source/core/tool/formulalogger.cxx   |   88 +++-
 5 files changed, 150 insertions(+), 11 deletions(-)

New commits:
commit 60762db52515cba74450bcbe9c474416dbcf9c73
Author: Kohei Yoshida 
Date:   Fri Nov 4 21:17:54 2016 -0400

Log cell range references.

Change-Id: Id6402a35ced37aff7215a46d23b4103a64bf669b

diff --git a/sc/inc/formulalogger.hxx b/sc/inc/formulalogger.hxx
index 83a8e6bb..1df49cc 100644
--- a/sc/inc/formulalogger.hxx
+++ b/sc/inc/formulalogger.hxx
@@ -88,6 +88,13 @@ public:
 void addRefMessage( const ScAddress& rPos, size_t nLen, const 
formula::VectorRefArray& rArray );
 
 /**
+ * Add to the log a vector reference information for a range
+ * reference.
+ */
+void addRefMessage(
+const ScAddress& rPos, size_t nLen, const 
std::vector& rArrays );
+
+/**
  * Add to the log a single cell reference information.
  */
 void addRefMessage( const ScAddress& rPos, const 
formula::FormulaToken& rToken );
@@ -125,10 +132,26 @@ public:
 {
 public:
 void addMessage( const OUString& /*rMsg*/ ) { (void) this; /* 
loplugin:staticmethods */ }
-void addRefMessage( const ScAddress& /*rPos*/, size_t /*nLen*/, const 
formula::VectorRefArray& /*rArray*/ )
-{ (void) this; /* loplugin:staticmethods */ }
+
+void addRefMessage(
+const ScAddress& /*rPos*/, size_t /*nLen*/,
+const formula::VectorRefArray& /*rArray*/ )
+{
+(void) this; /* loplugin:staticmethods */
+}
+
+void addRefMessage(
+const ScAddress& /*rPos*/, size_t /*nLen*/,
+const std::vector& /*rArrays*/ )
+{
+(void) this; /* loplugin:staticmethods */
+}
+
 void addRefMessage( const ScAddress& /*rPos*/, const 
formula::FormulaToken& /*rToken*/ )
-{ (void) this; /* loplugin:staticmethods */ }
+{
+(void) this; /* loplugin:staticmethods */
+}
+
 void setCalcComplete() { (void) this; /* loplugin:staticmethods */ }
 };
 
diff --git a/sc/source/core/data/grouptokenconverter.cxx 
b/sc/source/core/data/grouptokenconverter.cxx
index fd69b4c..e4eecfb 100644
--- a/sc/source/core/data/grouptokenconverter.cxx
+++ b/sc/source/core/data/grouptokenconverter.cxx
@@ -224,6 +224,7 @@ bool ScGroupTokenConverter::convert( ScTokenArray& rCode, 
sc::FormulaLogger::Gro
 
 formula::DoubleVectorRefToken aTok(aArrays, nRequestedLength, 
nArrayLength, nRefRowSize, bAbsFirst, bAbsLast);
 mrGroupTokens.AddToken(aTok);
+rScope.addRefMessage(aRefPos, nRequestedLength, aArrays);
 
 if (nArrayLength && !aArrays.empty() && !mxFormulaGroupContext)
 {
diff --git a/sc/source/core/tool/formulalogger.cxx 
b/sc/source/core/tool/formulalogger.cxx
index e8f720c..a5337bf 100644
--- a/sc/source/core/tool/formulalogger.cxx
+++ b/sc/source/core/tool/formulalogger.cxx
@@ -158,6 +158,17 @@ void FormulaLogger::GroupScope::addRefMessage(
 }
 
 void FormulaLogger::GroupScope::addRefMessage(
+const ScAddress& rPos, size_t nLen, const 
std::vector& rArrays )
+{
+ScAddress aPos(rPos); // copy
+for (const formula::VectorRefArray& rArray : rArrays)
+{
+addRefMessage(aPos, nLen, rArray);
+aPos.IncCol();
+}
+}
+
+void FormulaLogger::GroupScope::addRefMessage(
 const ScAddress& rPos, const formula::FormulaToken& rToken )
 {
 OUStringBuffer aBuf;
commit 34c49d3f87eafcbb2c57f764e8972178b3804344
Author: Kohei Yoshida 
Date:   Fri Nov 4 18:41:59 2016 -0400

Log single cell references.

Change-Id: If711c44a3be7ae02d1354bb36ed7db6b5a86ef6b

diff --git a/sc/inc/formulalogger.hxx b/sc/inc/formulalogger.hxx
index d63cf78..83a8e6bb 100644
--- a/sc/inc/formulalogger.hxx
+++ b/sc/inc/formulalogger.hxx
@@ -18,7 +18,12 @@ class ScFormulaCell;
 class ScDocument;
 class ScAddress;
 
-namespace formula { struct VectorRefArray; }
+namespace formula {
+
+class FormulaToken;
+struct VectorRefArray;
+
+}
 
 namespace sc {
 
@@ -83,6 +88,11 @@ public:
 void addRefMessage( const ScAddress& rPos, size_t nLen, const 
formula::VectorRefArray& rArray );
 
 /**
+ * Add to the log a single cell reference information.
+ */
+void addRefMessage( const ScAddress& rPos, const 
formula::FormulaToken& rToken );
+
+/**
  * Call this when the group calculation has finished successfullly.
  */
 void setCalcComplete();
@@ -117,6 +127,8 @@ public:
 void addMessage( const OUString& /*rMsg*/ ) { (void) this; /* 

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

2015-07-07 Thread Eike Rathke
 sc/inc/refdata.hxx  |9 +++
 sc/inc/tokenarray.hxx   |6 ++
 sc/source/core/data/formulacell.cxx |3 +
 sc/source/core/tool/interpr4.cxx|1 
 sc/source/core/tool/refdata.cxx |   92 
 sc/source/core/tool/token.cxx   |   28 ++
 6 files changed, 139 insertions(+)

New commits:
commit 3ddaeaab37d585971e376de6ad7b0f06f55f2e1a
Author: Eike Rathke er...@redhat.com
Date:   Tue Jul 7 12:30:02 2015 +0200

call ScTokenArray::AdjustReferenceOnCopy() in ScFormulaCell clone, tdf#92468

Change-Id: I0dc0c3528b35bc6ea2525bafb94d72ee65e4791a

diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index fad80e4..ec9b4ff 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -850,6 +850,9 @@ ScFormulaCell::ScFormulaCell( const ScFormulaCell rCell, 
ScDocument rDoc, cons
 pCode-AdjustAbsoluteRefs( rCell.pDocument, rCell.aPos, aPos, false, 
bCopyBetweenDocs );
 }
 
+if (!pDocument-IsClipOrUndo())
+pCode-AdjustReferenceOnCopy( aPos);
+
 if ( nCloneFlags  SC_CLONECELL_ADJUST3DREL )
 pCode-ReadjustRelative3DReferences( rCell.aPos, aPos );
 
commit 369ee0b1faf79f1bd23c75ee04dd0dcc5bf283af
Author: Eike Rathke er...@redhat.com
Date:   Tue Jul 7 11:56:05 2015 +0200

introduce ScTokenArray::AdjustReferenceOnCopy(), tdf#92468

Change-Id: I0a7ac0d9d10e96223cd5f095a771aa6f9d271417

diff --git a/sc/inc/tokenarray.hxx b/sc/inc/tokenarray.hxx
index 0d3fa02..8ed8697 100644
--- a/sc/inc/tokenarray.hxx
+++ b/sc/inc/tokenarray.hxx
@@ -217,6 +217,12 @@ public:
 void AdjustReferenceOnMovedOriginIfOtherSheet( const ScAddress rOldPos, 
const ScAddress rNewPos );
 
 /**
+ * Adjust internal range references on base position change to justify /
+ * put in order the relative references.
+ */
+void AdjustReferenceOnCopy( const ScAddress rNewPos );
+
+/**
  * Clear sheet deleted flag from internal reference tokens if the sheet
  * index falls within specified range.  Note that when a reference is on a
  * sheet that's been deleted, its referenced sheet index retains the
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 4ada501..95e951e 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -3951,6 +3951,34 @@ void 
ScTokenArray::AdjustReferenceOnMovedOriginIfOtherSheet( const ScAddress rO
 }
 }
 
+void ScTokenArray::AdjustReferenceOnCopy( const ScAddress rNewPos )
+{
+TokenPointers aPtrs( pCode, nLen, pRPN, nRPN, false);
+for (size_t j=0; j2; ++j)
+{
+FormulaToken** pp = aPtrs.maPointerRange[j].mpStart;
+FormulaToken** pEnd = aPtrs.maPointerRange[j].mpStop;
+for (; pp != pEnd; ++pp)
+{
+FormulaToken* p = aPtrs.getHandledToken(j,pp);
+if (!p)
+continue;
+
+switch (p-GetType())
+{
+case svDoubleRef:
+{
+ScComplexRefData rRef = *p-GetDoubleRef();
+rRef.PutInOrder( rNewPos);
+}
+break;
+default:
+;
+}
+}
+}
+}
+
 namespace {
 
 void clearTabDeletedFlag( ScSingleRefData rRef, const ScAddress rPos, SCTAB 
nStartTab, SCTAB nEndTab )
commit ad3d2b6c2e88d191d76f90eb5be927f7ca76c670
Author: Eike Rathke er...@redhat.com
Date:   Tue Jul 7 09:48:38 2015 +0200

(re-)introduce ScComplexRefData::PutInOrder(), tdf#92468

Change-Id: If551e02a77a416b95f74266de896391d1d72eb3c

diff --git a/sc/inc/refdata.hxx b/sc/inc/refdata.hxx
index c49682f..b96acb7 100644
--- a/sc/inc/refdata.hxx
+++ b/sc/inc/refdata.hxx
@@ -104,6 +104,9 @@ public:
 SCCOL Col() const;
 SCTAB Tab() const;
 
+/** Adjust ordering (front-top-left/rear-bottom-right) to a new position. 
*/
+static void PutInOrder( ScSingleRefData rRef1, ScSingleRefData rRef2, 
const ScAddress rPos );
+
 bool operator==( const ScSingleRefData ) const;
 bool operator!=( const ScSingleRefData ) const;
 
@@ -161,8 +164,14 @@ struct ScComplexRefData
 }
 
 SC_DLLPUBLIC ScRange toAbs( const ScAddress rPos ) const;
+
+/** Set a new range, assuming that the ordering of the range matches the
+ordering of the reference data flags already set. */
 void SetRange( const ScRange rRange, const ScAddress rPos );
 
+/** Adjust ordering (front-top-left/rear-bottom-right) to a new position. 
*/
+void PutInOrder( const ScAddress rPos );
+
 inline bool operator==( const ScComplexRefData r ) const
 { return Ref1 == r.Ref1  Ref2 == r.Ref2; }
 /** Enlarge range if reference passed is not within existing range.
diff --git a/sc/source/core/tool/refdata.cxx b/sc/source/core/tool/refdata.cxx
index 97d419c..4a814db 100644
--- a/sc/source/core/tool/refdata.cxx
+++ 

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

2015-01-27 Thread Caolán McNamara
 sc/inc/ViewSettingsSequenceDefines.hxx |   17 +
 sc/source/ui/view/viewdata.cxx |4 
 vcl/inc/win/salgdi.h   |4 ++--
 3 files changed, 15 insertions(+), 10 deletions(-)

New commits:
commit e8d3dfd9c4c2674ac759fda2a5546e89a34d728b
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Jan 27 16:51:21 2015 +

Revert merge these two selection changing hunks of code

This reverts commit bef9cc01c7da9fd75393bfa1818e07f484306829.

diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx
index 98f959f..8a1eb1e 100644
--- a/sw/source/ui/fldui/fldedt.cxx
+++ b/sw/source/ui/fldui/fldedt.cxx
@@ -49,28 +49,6 @@
 #include boost/scoped_ptr.hpp
 #include swuiexp.hxx
 
-void SwFldEditDlg::EnsureSelection(SwField *pCurFld)
-{
-if (pSh-CrsrInsideInputFld())
-{
-// move cursor to start of Input Field
-SwInputField* pInputFld = dynamic_castSwInputField*(pCurFld);
-if (pInputFld  pInputFld-GetFmtFld())
-{
-pSh-GotoField( *(pInputFld-GetFmtFld()) );
-}
-}
-
-/* Only create selection if there is none already.
-   Normalize PaM instead of swapping. */
-if (!pSh-HasSelection())
-{
-//Note that after this, it is possible that rMgr.GetCurFld() != pCurFld
-pSh-Right(CRSR_SKIP_CHARS, true, 1, false );
-}
-
-pSh-NormalizePam();
-}
 
 SwFldEditDlg::SwFldEditDlg(SwView rVw)
 : SfxSingleTabDialog(rVw.GetViewFrame()-GetWindow(), 0,
@@ -84,12 +62,28 @@ SwFldEditDlg::SwFldEditDlg(SwView rVw)
 SwFldMgr aMgr(pSh);
 
 SwField *pCurFld = aMgr.GetCurFld();
-if (!pCurFld)
+if(!pCurFld)
 return;
 
 SwViewShell::SetCareWin(this);
 
-EnsureSelection(pCurFld);
+if ( pSh-CrsrInsideInputFld() )
+{
+// move cursor to start of Input Field
+SwInputField* pInputFld = dynamic_castSwInputField*(pCurFld);
+if ( pInputFld != NULL
+  pInputFld-GetFmtFld() != NULL )
+{
+pSh-GotoField( *(pInputFld-GetFmtFld()) );
+}
+}
+
+if ( ! pSh-HasSelection() )
+{
+pSh-Right(CRSR_SKIP_CHARS, true, 1, false);
+}
+
+pSh-NormalizePam();
 
 sal_uInt16 nGroup = aMgr.GetGroup(false, pCurFld-GetTypeId(), 
pCurFld-GetSubType());
 
@@ -260,7 +254,12 @@ IMPL_LINK( SwFldEditDlg, NextPrevHdl, Button *, pButton )
 rMgr.GoNextPrev( bNext, pOldTyp );
 pCurFld = rMgr.GetCurFld();
 
-EnsureSelection(pCurFld);
+/* #108536# Only create selection if there is none
+already. Normalize PaM instead of swapping. */
+if ( ! pSh-HasSelection() )
+pSh-Right(CRSR_SKIP_CHARS, true, 1, false );
+
+pSh-NormalizePam();
 
 sal_uInt16 nGroup = rMgr.GetGroup(false, pCurFld-GetTypeId(), 
pCurFld-GetSubType());
 
diff --git a/sw/source/uibase/inc/fldedt.hxx b/sw/source/uibase/inc/fldedt.hxx
index fc8f27d..0c859e9 100644
--- a/sw/source/uibase/inc/fldedt.hxx
+++ b/sw/source/uibase/inc/fldedt.hxx
@@ -37,10 +37,9 @@ class SwFldEditDlg : public SfxSingleTabDialog
 voidInit();
 SfxTabPage* CreatePage(sal_uInt16 nGroup);
 
-void EnsureSelection(SwField *pCurFld);
 public:
 
-SwFldEditDlg(SwView rVw);
+ SwFldEditDlg(SwView rVw);
 virtual ~SwFldEditDlg();
 
 DECL_LINK(OKHdl, void *);
commit 78a5c5dcf0bd0a4406ea5d7da7573010863299b8
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Jan 27 16:50:18 2015 +

fix windows build

could have sworn it built under windows under jenkins

Change-Id: I97501d09b417ba1f8701f7efe884f26a7714a98a

diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index d78b191..97431fd 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -397,8 +397,8 @@ public:
 // as undefined character
 virtual boolCreateFontSubset( const OUString rToFile,
   const PhysicalFontFace*,
-  sal_GlyphId* pGlyphIDs,
-  sal_uInt8* pEncoding,
+  const sal_GlyphId* pGlyphIDs,
+  const sal_uInt8* pEncoding,
   sal_Int32* pWidths,
   int nGlyphs,
   FontSubsetInfo rInfo // out 
parameter
commit bef9cc01c7da9fd75393bfa1818e07f484306829
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Jan 27 15:39:00 2015 +

merge these two selection changing hunks of code

Change-Id: I4113a38a3a15cd2173f9a2530dc2e7278b8713b2

diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx
index 8a1eb1e..98f959f 100644
--- a/sw/source/ui/fldui/fldedt.cxx
+++ b/sw/source/ui/fldui/fldedt.cxx
@@ -49,6 +49,28 @@
 #include boost/scoped_ptr.hpp
 #include swuiexp.hxx
 
+void 

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

2014-12-15 Thread Kohei Yoshida
 sc/inc/formulagroup.hxx  |   10 
 sc/source/core/data/formulacell.cxx  |4 
 sc/source/core/inc/formulagroupcl.hxx|   15 
 sc/source/core/opencl/formulagroupcl.cxx |  716 +--
 sc/source/core/tool/formulagroup.cxx |6 
 5 files changed, 417 insertions(+), 334 deletions(-)

New commits:
commit 990dbcab759265de1497b15a93e53a5fe81ff48d
Author: Kohei Yoshida kohei.yosh...@collabora.com
Date:   Mon Dec 15 21:07:28 2014 -0500

Pass group length to context / result objects to reduce # of params.

It looks cleaner this way.

Change-Id: Id46cb52863fb9366d83ac17d3f8521e5a13a59c9

diff --git a/sc/source/core/opencl/formulagroupcl.cxx 
b/sc/source/core/opencl/formulagroupcl.cxx
index e455c8e..a2c254c 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -3657,13 +3657,16 @@ class CLInterpreterResult
 {
 DynamicKernel* mpKernel;
 
+SCROW mnGroupLength;
+
 public:
-CLInterpreterResult() : mpKernel(NULL) {}
-CLInterpreterResult( DynamicKernel* pKernel ) : mpKernel(pKernel) {}
+CLInterpreterResult() : mpKernel(NULL), mnGroupLength(0) {}
+CLInterpreterResult( DynamicKernel* pKernel, SCROW nGroupLength ) :
+mpKernel(pKernel), mnGroupLength(nGroupLength) {}
 
 bool isValid() const { return mpKernel != NULL; }
 
-bool pushResultToDocument( ScDocument rDoc, const ScAddress rTopPos, 
SCROW nLength )
+bool pushResultToDocument( ScDocument rDoc, const ScAddress rTopPos )
 {
 if (!isValid())
 return false;
@@ -3679,7 +3682,7 @@ public:
 double* resbuf = (double*)clEnqueueMapBuffer(kEnv.mpkCmdQueue,
 res,
 CL_TRUE, CL_MAP_READ, 0,
-nLength * sizeof(double), 0, NULL, NULL,
+mnGroupLength * sizeof(double), 0, NULL, NULL,
 err);
 
 if (err != CL_SUCCESS)
@@ -3688,7 +3691,7 @@ public:
 return false;
 }
 
-rDoc.SetFormulaResults(rTopPos, resbuf, nLength);
+rDoc.SetFormulaResults(rTopPos, resbuf, mnGroupLength);
 
 err = clEnqueueUnmapMemObject(kEnv.mpkCmdQueue, res, resbuf, 0, NULL, 
NULL);
 if (err != CL_SUCCESS)
@@ -3706,7 +3709,11 @@ class CLInterpreterContext
 std::shared_ptrDynamicKernel mpKernelStore; /// for managed kernel 
instance.
 DynamicKernel* mpKernel;
 
+SCROW mnGroupLength;
+
 public:
+CLInterpreterContext( SCROW nGroupLength ) :
+mpKernel(NULL), mnGroupLength(nGroupLength) {}
 
 bool isValid() const
 {
@@ -3724,7 +3731,7 @@ public:
 mpKernel = pKernel;
 }
 
-CLInterpreterResult launchKernel( SCROW nLength )
+CLInterpreterResult launchKernel()
 {
 CLInterpreterResult aRes; // invalid by default.
 
@@ -3734,7 +3741,7 @@ public:
 try
 {
 // Run the kernel.
-mpKernel-Launch(nLength);
+mpKernel-Launch(mnGroupLength);
 }
 catch (const UnhandledToken ut)
 {
@@ -3757,7 +3764,7 @@ public:
 return CLInterpreterResult();
 }
 
-return CLInterpreterResult(mpKernel);
+return CLInterpreterResult(mpKernel, mnGroupLength);
 }
 };
 
@@ -3765,7 +3772,7 @@ public:
 CLInterpreterContext createCLInterpreterContext(
 ScFormulaCellGroupRef xGroup, ScTokenArray rCode )
 {
-CLInterpreterContext aCxt;
+CLInterpreterContext aCxt(xGroup-mnLength);
 
 #if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION
 if (rGroup.meKernelState == sc::OpenCLKernelCompilationScheduled ||
@@ -3813,11 +3820,11 @@ bool FormulaGroupInterpreterOpenCL::interpret( 
ScDocument rDoc,
 if (!aCxt.isValid())
 return false;
 
-CLInterpreterResult aRes = aCxt.launchKernel(xGroup-mnLength);
+CLInterpreterResult aRes = aCxt.launchKernel();
 if (!aRes.isValid())
 return false;
 
-return aRes.pushResultToDocument(rDoc, rTopPos, xGroup-mnLength);
+return aRes.pushResultToDocument(rDoc, rTopPos);
 }
 
 }} // namespace sc::opencl
commit cf7d8b41a9c0c2a4015217b49266f781c9558d9e
Author: Kohei Yoshida kohei.yosh...@collabora.com
Date:   Mon Dec 15 20:57:35 2014 -0500

Refactor OpenCL interpreter impl code to make it more modular.

Change-Id: I8fe6aeb2ee1cd67df3e0e657b271b255516dbc18

diff --git a/sc/source/core/opencl/formulagroupcl.cxx 
b/sc/source/core/opencl/formulagroupcl.cxx
index dc280b0..e455c8e 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -3651,114 +3651,173 @@ CompiledFormula* 
FormulaGroupInterpreterOpenCL::createCompiledFormula(
 return DynamicKernel::create(rCode, rGroup.mnLength);
 }
 
-bool FormulaGroupInterpreterOpenCL::interpret( ScDocument rDoc,
-const ScAddress rTopPos, ScFormulaCellGroupRef xGroup,
-ScTokenArray rCode )
+namespace {
+
+class CLInterpreterResult
 {
-ScCompiler aComp(rDoc, rTopPos, rCode);
-

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

2014-12-08 Thread Eike Rathke
 sc/inc/column.hxx   |   12 +
 sc/inc/table.hxx|2 
 sc/source/core/data/column.cxx  |   73 
 sc/source/core/data/documen7.cxx|   44 -
 sc/source/core/data/document.cxx|3 -
 sc/source/core/data/formulacell.cxx |1 
 sc/source/core/data/table2.cxx  |4 -
 sc/source/core/data/table4.cxx  |2 
 8 files changed, 109 insertions(+), 32 deletions(-)

New commits:
commit 887cb59ac4bfca94f310baee3e9da58ccf9cb3e3
Author: Eike Rathke er...@redhat.com
Date:   Tue Dec 9 03:49:10 2014 +0100

assert the impossible

Change-Id: I5fd2c7635f204bda982f1df58b4c19fe9b12464a

diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx
index 45c9416..5b6c3a4 100644
--- a/sc/source/core/data/documen7.cxx
+++ b/sc/source/core/data/documen7.cxx
@@ -365,18 +365,30 @@ void ScDocument::RemoveFromFormulaTree( ScFormulaCell* 
pCell )
 {
 OSL_ENSURE( pCell, RemoveFromFormulaTree: pCell Null );
 ScFormulaCell* pPrev = pCell-GetPrevious();
-// wenn die Zelle die erste oder sonstwo ist
+assert(pPrev != pCell); // pointing to itself?!?
+// if the cell is first or somwhere in chain
 if ( pPrev || pFormulaTree == pCell )
 {
 ScFormulaCell* pNext = pCell-GetNext();
+assert(pNext != pCell); // pointing to itself?!?
 if ( pPrev )
-pPrev-SetNext( pNext );// gibt Vorlaeufer
+{
+assert(pFormulaTree != pCell);  // if this cell is also head 
something's wrong
+pPrev-SetNext( pNext );// predecessor exists, set 
successor
+}
 else
-pFormulaTree = pNext;   // ist erste Zelle
+{
+pFormulaTree = pNext;   // this cell was first cell
+}
 if ( pNext )
-pNext-SetPrevious( pPrev );// gibt Nachfolger
+{
+assert(pEOFormulaTree != pCell); // if this cell is also tail 
something's wrong
+pNext-SetPrevious( pPrev );// sucessor exists, set predecessor
+}
 else
-pEOFormulaTree = pPrev; // ist letzte Zelle
+{
+pEOFormulaTree = pPrev; // this cell was last cell
+}
 pCell-SetPrevious( 0 );
 pCell-SetNext( 0 );
 sal_uInt16 nRPN = pCell-GetCode()-GetCodeLen();
@@ -543,18 +555,30 @@ void ScDocument::RemoveFromFormulaTrack( ScFormulaCell* 
pCell )
 {
 OSL_ENSURE( pCell, RemoveFromFormulaTrack: pCell Null );
 ScFormulaCell* pPrev = pCell-GetPreviousTrack();
-// wenn die Zelle die erste oder sonstwo ist
+assert(pPrev != pCell); // pointing to itself?!?
+// if the cell is first or somwhere in chain
 if ( pPrev || pFormulaTrack == pCell )
 {
 ScFormulaCell* pNext = pCell-GetNextTrack();
+assert(pNext != pCell); // pointing to itself?!?
 if ( pPrev )
-pPrev-SetNextTrack( pNext );   // gibt Vorlaeufer
+{
+assert(pFormulaTrack != pCell); // if this cell is also head 
something's wrong
+pPrev-SetNextTrack( pNext );   // predecessor exists, set 
successor
+}
 else
-pFormulaTrack = pNext;  // ist erste Zelle
+{
+pFormulaTrack = pNext;  // this cell was first cell
+}
 if ( pNext )
-pNext-SetPreviousTrack( pPrev );   // gibt Nachfolger
+{
+assert(pEOFormulaTrack != pCell);   // if this cell is also tail 
something's wrong
+pNext-SetPreviousTrack( pPrev );   // sucessor exists, set 
predecessor
+}
 else
-pEOFormulaTrack = pPrev;// ist letzte Zelle
+{
+pEOFormulaTrack = pPrev;// this cell was last cell
+}
 pCell-SetPreviousTrack( 0 );
 pCell-SetNextTrack( 0 );
 --nFormulaTrackCount;
commit 1e9aa174865cc65b132a8b3e728b8a5adbcd8b90
Author: Eike Rathke er...@redhat.com
Date:   Tue Dec 9 03:00:47 2014 +0100

in ScFormulaCell dtor remove cell also from FormulaTrack

It could happen that during a SetDirty/Notify cycle a formula cell is
appended to the formula track but not tracked yet so doesn't end up in
the formula tree. If it was deleted then without removing it from the
track the cell pointer shortly after was moved into the tree, possibly
setting pFormulaTree (and/or pEOFormulaTree) to that cell if it was the
last cell, and if immediately after that a new ScFormulaCell was
allocated at exactly the same memory location it virtually ended up as a
successor of itself in the formula tree ... leading to a crash if pCode
was accessed in a subsequent RemoveFromFormulaTree because the cell was
assumed to be already in the tree.

Change-Id: 

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

2014-11-18 Thread Caolán McNamara
 sc/inc/address.hxx  |8 
 sc/source/filter/excel/excform.cxx  |   10 ++
 sc/source/filter/excel/xihelper.cxx |   10 ++
 sc/source/filter/excel/xilink.cxx   |   11 +++
 4 files changed, 35 insertions(+), 4 deletions(-)

New commits:
commit 8921054fe8b819ef52d0e0b6aee84314677e90f2
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Nov 17 20:40:12 2014 +

Related: coverity#1242793 Untrusted value as argument

why doesn't coverity consider that Valid[Tab|Row|Col] check the lower bound 
of
nPos.

Could it need to be as simple as naively looking for a =

Change-Id: Id80f9d30b9166caef20b74569f7b50a569189d71

diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index 7fcdee1..07ebe02 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -110,22 +110,22 @@ const SCROW W16MAXROW = W16MAXROWCOUNT - 1;
 //  old stuff defines end
 inline bool ValidCol( SCCOL nCol )
 {
-return static_castSCCOL(0) = nCol  nCol = MAXCOL;
+return nCol = static_castSCCOL(0)  nCol = MAXCOL;
 }
 
 inline bool ValidRow( SCROW nRow )
 {
-return static_castSCROW(0) = nRow  nRow = MAXROW;
+return nRow = static_castSCROW(0)  nRow = MAXROW;
 }
 
 inline bool ValidTab( SCTAB nTab )
 {
-return static_castSCTAB(0) = nTab  nTab = MAXTAB;
+return nTab = static_castSCTAB(0)  nTab = MAXTAB;
 }
 
 inline bool ValidTab( SCTAB nTab, SCTAB nMaxTab )
 {
-return static_castSCTAB(0) = nTab  nTab = nMaxTab;
+return nTab = static_castSCTAB(0)  nTab = nMaxTab;
 }
 
 inline bool ValidColRow( SCCOL nCol, SCROW nRow )
commit 206d68d587ee106c1a51db8507268fdf21fa1ddc
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Nov 17 20:34:55 2014 +

coverity#1242538 Untrusted loop bound

Change-Id: I663f70d6324c6dd42208aa3804edfe3680881ea1

diff --git a/sc/source/filter/excel/excform.cxx 
b/sc/source/filter/excel/excform.cxx
index eda4134..630997a 100644
--- a/sc/source/filter/excel/excform.cxx
+++ b/sc/source/filter/excel/excform.cxx
@@ -1791,6 +1791,16 @@ void ExcelToSc::ReadExtensionArray( unsigned int n, 
XclImpStream aIn )
 OSL_FAIL( ExcelToSc::ReadExtensionArray - missing matrix );
 }
 
+//assuming worse case scenario of unknown types
+const size_t nMinRecordSize = 1;
+const size_t nMaxRows = aIn.GetRecLeft() / (nMinRecordSize * nCols);
+if (nRows  nMaxRows)
+{
+SAL_WARN(sc, Parsing error:   nMaxRows 
+  max possible rows, but   nRows   claimed, 
truncating);
+nRows = nMaxRows;
+}
+
 svl::SharedStringPool rPool = GetDoc().GetSharedStringPool();
 for( nR = 0 ; nR  nRows; nR++ )
 {
commit 07ec99d307925b33d13b40d9a0a44ef029025ecc
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Nov 17 20:32:31 2014 +

coverity#1242628 Untrusted loop bound

Change-Id: Ifabdfab76279e4417642ce10cb86a43184b94629

diff --git a/sc/source/filter/excel/xihelper.cxx 
b/sc/source/filter/excel/xihelper.cxx
index 6a98771..37e8d0e 100644
--- a/sc/source/filter/excel/xihelper.cxx
+++ b/sc/source/filter/excel/xihelper.cxx
@@ -838,6 +838,16 @@ XclImpCachedMatrix::XclImpCachedMatrix( XclImpStream 
rStrm ) :
 ++mnScRows;
 }
 
+//assuming worse case scenario of unknown types
+const size_t nMinRecordSize = 1;
+const size_t nMaxRows = rStrm.GetRecLeft() / (nMinRecordSize * mnScCols);
+if (mnScRows  nMaxRows)
+{
+SAL_WARN(sc, Parsing error:   nMaxRows 
+  max possible rows, but   mnScRows   claimed, 
truncating);
+mnScRows = nMaxRows;
+}
+
 for( SCSIZE nScRow = 0; nScRow  mnScRows; ++nScRow )
 for( SCSIZE nScCol = 0; nScCol  mnScCols; ++nScCol )
 maValueList.push_back( new XclImpCachedValue( rStrm ) );
commit 5aa174b08489f1f217546966d2396bdf56842dca
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Nov 17 20:28:55 2014 +

coverity#1242631 Untrusted loop bound

Change-Id: Ib034582fa4fa6e8149db2e45491230b4900c4d08

diff --git a/sc/source/filter/excel/xilink.cxx 
b/sc/source/filter/excel/xilink.cxx
index 75bf324..52e8a5a 100644
--- a/sc/source/filter/excel/xilink.cxx
+++ b/sc/source/filter/excel/xilink.cxx
@@ -634,6 +634,17 @@ XclImpSupbook::XclImpSupbook( XclImpStream rStrm ) :
 else if( nSBTabCnt )
 {
 meType = EXC_SBTYPE_EXTERN;
+
+//assuming all empty strings with just len header of 0
+const size_t nMinRecordSize = sizeof(sal_Int16);
+const size_t nMaxRecords = rStrm.GetRecLeft() / nMinRecordSize;
+if (nSBTabCnt  nMaxRecords)
+{
+SAL_WARN(sc, Parsing error:   nMaxRecords 
+  max possible entries, but   nSBTabCnt   claimed, 
truncating);
+nSBTabCnt = nMaxRecords;
+}
+
 for( sal_uInt16 nSBTab = 0; nSBTab  nSBTabCnt; ++nSBTab )
 {
 OUString aTabName( rStrm.ReadUniString() );

[Libreoffice-commits] core.git: 4 commits - sc/inc sc/source sfx2/uiconfig

2014-02-24 Thread Caolán McNamara
 sc/inc/dapiuno.hxx  |   13 -
 sc/source/ui/unoobj/dapiuno.cxx |8 +---
 sfx2/uiconfig/ui/templatedlg.ui |8 
 3 files changed, 17 insertions(+), 12 deletions(-)

New commits:
commit c88d2f6d57ee2ed45fb9a9f36b3a196180e2ccda
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Feb 24 14:10:43 2014 +

fix 'delete' not working in the Template Manager

regression from b29c078c7f193dd7dae74baf89fe1abb9264239c because if the 
search
view widget is visible then its assumed that we are in search view mode

Change-Id: I8e81ffa06d5d3ac50e110105c9444707fd4c41c6

diff --git a/sfx2/uiconfig/ui/templatedlg.ui b/sfx2/uiconfig/ui/templatedlg.ui
index 5104b66..b6ecee8 100644
--- a/sfx2/uiconfig/ui/templatedlg.ui
+++ b/sfx2/uiconfig/ui/templatedlg.ui
@@ -1,6 +1,7 @@
 ?xml version=1.0 encoding=UTF-8?
+!-- Generated with glade 3.16.1 --
 interface
-  !-- interface-requires gtk+ 3.0 --
+  requires lib=gtk+ version=3.0/
   !-- interface-requires LibreOffice 1.0 --
   object class=GtkWindow id=TemplateDialog
 property name=width_request800/property
@@ -301,7 +302,6 @@
 property name=can_focusTrue/property
 property name=hexpandTrue/property
 property name=invisible_char●/property
-property name=invisible_char_setTrue/property
   /object
   packing
 property name=expandFalse/property
@@ -324,8 +324,8 @@
 /child
 child
   object class=sfxlo-TemplateSearchView id=search_view
-property name=visibleTrue/property
 property name=can_focusTrue/property
+property name=no_show_allTrue/property
 property name=hexpandTrue/property
 property name=vexpandTrue/property
   /object
@@ -337,8 +337,8 @@
 /child
 child
   object class=sfxlo-TemplateRemoteView id=remote_view
-property name=visibleTrue/property
 property name=can_focusTrue/property
+property name=no_show_allTrue/property
 property name=hexpandTrue/property
 property name=vexpandTrue/property
   /object
commit 5eb08bb35395786b39ff1d7def13ce8f10ec9c9b
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Feb 24 14:13:45 2014 +

ETOMANY getPropertyValue

Change-Id: I787257603e919b12fda07d3302ceba2a7787a9b9

diff --git a/sc/inc/dapiuno.hxx b/sc/inc/dapiuno.hxx
index 11d6245..971e2b2 100644
--- a/sc/inc/dapiuno.hxx
+++ b/sc/inc/dapiuno.hxx
@@ -918,9 +918,10 @@ public:
std::exception);
 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
 const OUString PropertyName )
-
throw(::com::sun::star::beans::UnknownPropertyException,
-
::com::sun::star::lang::WrappedTargetException,
-::com::sun::star::uno::RuntimeException);
+throw 
(::com::sun::star::beans::UnknownPropertyException,
+   
::com::sun::star::lang::WrappedTargetException,
+   ::com::sun::star::uno::RuntimeException,
+   std::exception);
 virtual void SAL_CALL   addPropertyChangeListener( const OUString 
aPropertyName,
 const ::com::sun::star::uno::Reference
 
::com::sun::star::beans::XPropertyChangeListener  xListener )
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index f5dea82..82ab826 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -916,7 +916,8 @@ void SAL_CALL ScDataPilotDescriptorBase::setPropertyValue( 
const OUString aProp
 }
 
 Any SAL_CALL ScDataPilotDescriptorBase::getPropertyValue( const OUString 
aPropertyName )
-throw(UnknownPropertyException, WrappedTargetException, 
RuntimeException)
+throw (UnknownPropertyException, WrappedTargetException,
+   RuntimeException, std::exception)
 {
 SolarMutexGuard aGuard;
 Any aRet;
commit 1067084f15524e918231e039d44ae7157ac7e095
Author: Caolán McNamara caol...@redhat.com
Date:   Mon Feb 24 13:42:28 2014 +

coverity#737536 Uncaught exception

Change-Id: Ia59a64934b65dd926c4f95953bc1ddaf00d6f8cf

diff --git a/sc/inc/dapiuno.hxx b/sc/inc/dapiuno.hxx
index a52497b..11d6245 100644
--- a/sc/inc/dapiuno.hxx
+++ b/sc/inc/dapiuno.hxx
@@ -249,7 +249,8 @@ public:
 // XDataPilotDataLayoutFieldSupplier
 virtual ::com::sun::star::uno::Reference 
::com::sun::star::sheet::XDataPilotField 
 

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

2014-01-23 Thread Caolán McNamara
 sc/inc/viewuno.hxx|2 +-
 sc/source/ui/Accessibility/AccessibleCell.cxx |4 ++--
 sc/source/ui/Accessibility/AccessibleContextBase.cxx  |4 ++--
 sc/source/ui/Accessibility/AccessiblePreviewTable.cxx |3 ++-
 sc/source/ui/inc/AccessibleCell.hxx   |4 ++--
 sc/source/ui/inc/AccessibleContextBase.hxx|4 ++--
 sc/source/ui/inc/AccessiblePreviewTable.hxx   |2 +-
 sc/source/ui/unoobj/viewuno.cxx   |4 ++--
 xmlreader/source/xmlreader.cxx|2 ++
 9 files changed, 16 insertions(+), 13 deletions(-)

New commits:
commit 194cfbfa2a5fb7b8a4598729aede48d5a221f61c
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Jan 23 17:22:05 2014 +

coverity#1158407 Uncaught exception

Change-Id: Ib8830798250b9c4f143743de4389260fceb44aa3

diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx 
b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
index 42b14f4..09a852e 100644
--- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
+++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx
@@ -647,7 +647,8 @@ Rectangle 
ScAccessiblePreviewTable::GetBoundingBoxOnScreen() const throw (uno::R
 return aCellRect;
 }
 
-Rectangle ScAccessiblePreviewTable::GetBoundingBox() const throw 
(uno::RuntimeException)
+Rectangle ScAccessiblePreviewTable::GetBoundingBox() const
+throw (uno::RuntimeException, std::exception)
 {
 FillTableInfo();
 
diff --git a/sc/source/ui/inc/AccessiblePreviewTable.hxx 
b/sc/source/ui/inc/AccessiblePreviewTable.hxx
index 795badc..5840702 100644
--- a/sc/source/ui/inc/AccessiblePreviewTable.hxx
+++ b/sc/source/ui/inc/AccessiblePreviewTable.hxx
@@ -156,7 +156,7 @@ protected:
 virtual OUString SAL_CALL createAccessibleName(void) throw 
(::com::sun::star::uno::RuntimeException);
 
 virtual Rectangle GetBoundingBoxOnScreen(void) const 
throw(::com::sun::star::uno::RuntimeException);
-virtual Rectangle GetBoundingBox(void) const throw 
(::com::sun::star::uno::RuntimeException);
+virtual Rectangle GetBoundingBox() const throw 
(::com::sun::star::uno::RuntimeException, std::exception);
 
 private:
 ScPreviewShell* mpViewShell;
commit a5c401df84df2be26a6a2351a7d5c9d65524d8a9
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Jan 23 17:20:06 2014 +

coverity#1158408 Uncaught exception

Change-Id: Ie0a3cfeedeb386e72749997e6a4bdf8b6c515be2

diff --git a/sc/inc/viewuno.hxx b/sc/inc/viewuno.hxx
index eddaed3..fc97d4b 100644
--- a/sc/inc/viewuno.hxx
+++ b/sc/inc/viewuno.hxx
@@ -80,7 +80,7 @@ public:
 // XViewPane
 virtual sal_Int32 SAL_CALL getFirstVisibleColumn() 
throw(::com::sun::star::uno::RuntimeException);
 virtual void SAL_CALL   setFirstVisibleColumn( sal_Int32 
nFirstVisibleColumn )
-throw(::com::sun::star::uno::RuntimeException);
+throw(::com::sun::star::uno::RuntimeException, 
std::exception);
 virtual sal_Int32 SAL_CALL getFirstVisibleRow() 
throw(::com::sun::star::uno::RuntimeException);
 virtual void SAL_CALL   setFirstVisibleRow( sal_Int32 nFirstVisibleRow )
 throw(::com::sun::star::uno::RuntimeException);
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index 3095a78..369cb4e 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -206,8 +206,8 @@ sal_Int32 SAL_CALL ScViewPaneBase::getFirstVisibleColumn() 
throw(uno::RuntimeExc
 return 0;
 }
 
-void SAL_CALL ScViewPaneBase::setFirstVisibleColumn( sal_Int32 
nFirstVisibleColumn )
-throw(uno::RuntimeException)
+void SAL_CALL ScViewPaneBase::setFirstVisibleColumn(sal_Int32 
nFirstVisibleColumn)
+throw(uno::RuntimeException, std::exception)
 {
 SolarMutexGuard aGuard;
 if (pViewShell)
commit 98a3def98cd6e43dcce51de9694dcc895ad7a36a
Author: Caolán McNamara caol...@redhat.com
Date:   Thu Jan 23 17:16:19 2014 +

coverity#1158410 Uncaught exception

mdds::general_error is thrown but is luckily inherited from std::exception 
so
use the new ability of 0bc89aac4c64bb833e387657f680e194c26aef97 cppumaker:
Allow UNO interface functions to throw std::exception.

Change-Id: I2c1d30e0806281d43c7bec103d4c85e1799c5b4f

diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx 
b/sc/source/ui/Accessibility/AccessibleCell.cxx
index 742496c..cb319a4 100644
--- a/sc/source/ui/Accessibility/AccessibleCell.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCell.cxx
@@ -166,8 +166,8 @@ Rectangle ScAccessibleCell::GetBoundingBoxOnScreen(void) 
const
 return aCellRect;
 }
 
-Rectangle ScAccessibleCell::GetBoundingBox(void) const
-throw (uno::RuntimeException)
+Rectangle ScAccessibleCell::GetBoundingBox() const
+throw 

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

2013-12-30 Thread Kohei Yoshida
 sc/inc/stringutil.hxx|3 
 sc/source/core/tool/stringutil.cxx   |  150 +++
 sc/source/ui/docshell/datastream.cxx |  334 +--
 sc/source/ui/inc/datastream.hxx  |   37 +++
 4 files changed, 387 insertions(+), 137 deletions(-)

New commits:
commit 9a623cdca281a682d39b423aefac392c2cc22cf7
Author: Kohei Yoshida kohei.yosh...@collabora.com
Date:   Mon Dec 30 12:16:35 2013 -0500

Parse CSV lines in the reader thread.

Change-Id: I6329a0e6e6fa6576df2ed473482d558bfd6cce08

diff --git a/sc/inc/stringutil.hxx b/sc/inc/stringutil.hxx
index 08e5c1e..d275007 100644
--- a/sc/inc/stringutil.hxx
+++ b/sc/inc/stringutil.hxx
@@ -126,6 +126,9 @@ public:
 static bool parseSimpleNumber(
 const OUString rStr, sal_Unicode dsep, sal_Unicode gsep, double 
rVal);
 
+static bool parseSimpleNumber(
+const char* p, size_t n, char dsep, char gsep, double rVal);
+
 static sal_Int32 SC_DLLPUBLIC GetQuotedTokenCount(const OUString rIn, 
const OUString rQuotedPairs, sal_Unicode cTok = ';' );
 static OUString  SC_DLLPUBLIC GetQuotedToken(const OUString rIn, 
sal_Int32 nToken, const OUString rQuotedPairs,
 sal_Unicode cTok,  sal_Int32 rIndex );
diff --git a/sc/source/core/tool/stringutil.cxx 
b/sc/source/core/tool/stringutil.cxx
index e711bcb..5bdc2c2 100644
--- a/sc/source/core/tool/stringutil.cxx
+++ b/sc/source/core/tool/stringutil.cxx
@@ -18,11 +18,13 @@
  */
 
 #include stringutil.hxx
-#include rtl/ustrbuf.hxx
-#include rtl/math.hxx
 #include global.hxx
 #include svl/zforlist.hxx
 
+#include rtl/ustrbuf.hxx
+#include rtl/strbuf.hxx
+#include rtl/math.hxx
+
 ScSetStringParam::ScSetStringParam() :
 mpNumFormatter(NULL),
 mbDetectNumberFormat(true),
@@ -194,6 +196,150 @@ bool ScStringUtil::parseSimpleNumber(
 return true;
 }
 
+bool ScStringUtil::parseSimpleNumber(
+const char* p, size_t n, char dsep, char gsep, double rVal)
+{
+// Actually almost the entire pre-check is unnecessary and we could call
+// rtl::math::stringToDouble() just after having exchanged ascii space with
+// non-breaking space, if it wasn't for check of grouped digits. The NaN
+// and Inf cases that are accepted by stringToDouble() could be detected
+// using rtl::math::isFinite() on the result.
+
+/* TODO: The grouped digits check isn't even valid for locales that do not
+ * group in thousands ... e.g. Indian locales. But that's something also
+ * the number scanner doesn't implement yet, only the formatter. */
+
+OStringBuffer aBuf;
+
+size_t i = 0;
+const char* pLast = p + (n-1);
+sal_Int32 nPosDSep = -1, nPosGSep = -1;
+sal_uInt32 nDigitCount = 0;
+sal_Int32 nPosExponent = -1;
+
+// Skip preceding spaces.
+for (i = 0; i  n; ++i, ++p)
+{
+char c = *p;
+if (c != ' ')
+// first non-space character.  Exit.
+break;
+}
+
+if (i == n)
+// the whole string is space.  Fail.
+return false;
+
+n -= i; // Subtract the length of the preceding spaces.
+
+// Determine the last non-space character.
+for (; p != pLast; --pLast, --n)
+{
+char c = *pLast;
+if (c != ' ')
+// Non space character. Exit.
+break;
+}
+
+for (i = 0; i  n; ++i, ++p)
+{
+char c = *p;
+
+if ('0' = c  c = '9')
+{
+// this is a digit.
+aBuf.append(c);
+++nDigitCount;
+}
+else if (c == dsep)
+{
+// this is a decimal separator.
+
+if (nPosDSep = 0)
+// a second decimal separator - not a valid number.
+return false;
+
+if (nPosGSep = 0  i - nPosGSep != 4)
+// the number has a group separator and the decimal sep is not
+// positioned correctly.
+return false;
+
+nPosDSep = i;
+nPosGSep = -1;
+aBuf.append(c);
+nDigitCount = 0;
+}
+else if (c == gsep)
+{
+// this is a group (thousand) separator.
+
+if (i == 0)
+// not allowed as the first character.
+return false;
+
+if (nPosDSep = 0)
+// not allowed after the decimal separator.
+return false;
+
+if (nPosGSep = 0  nDigitCount != 3)
+// must be exactly 3 digits since the last group separator.
+return false;
+
+if (nPosExponent = 0)
+// not allowed in exponent.
+return false;
+
+nPosGSep = i;
+nDigitCount = 0;
+}
+else if (c == '-' || c == '+')
+{
+// A sign must be the first character if it's given, or immediately
+// follow the exponent character if present.
+if (i == 0 || 

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

2013-12-10 Thread Kohei Yoshida
 sc/inc/dpobject.hxx   |   14 --
 sc/inc/dpsave.hxx |   13 +
 sc/source/core/data/dpcache.cxx   |   68 +++---
 sc/source/core/data/dpobject.cxx  |   85 +-
 sc/source/core/data/dpsave.cxx|   83 +
 sc/source/filter/xml/xmldpimp.cxx |   33 ++
 sc/source/filter/xml/xmldpimp.hxx |7 +++
 7 files changed, 262 insertions(+), 41 deletions(-)

New commits:
commit b3977983e9f662392426f581516d86d7034ad0fd
Author: Kohei Yoshida kohei.yosh...@collabora.com
Date:   Tue Dec 10 15:56:06 2013 -0500

fdo#66969: Reset group dimension data from all referencing pivot objects.

The previous code was doing it only with the first referencing pivot table,
which would break the rest of them sharing the same cache if
the first one doesn't contain all group dimensions used in all of the
referencing pivot tables.

Change-Id: I35d6907ef8db7ed69db42583cac92b2b74406e2c

diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index 309fab6..803a05e 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -290,7 +290,7 @@ public:
 private:
 ScDPCache* getExistingCache(const ScRange rRange);
 
-void updateCache(const ScRange rRange, const ScDPDimensionSaveData* 
pDimData, std::setScDPObject* rRefs);
+void updateCache(const ScRange rRange, std::setScDPObject* rRefs);
 bool remove(const ScDPCache* p);
 };
 
@@ -313,8 +313,7 @@ public:
 ScDPCache* getExistingCache(const OUString rName);
 
 void updateCache(
-const OUString rName, const ScRange rRange,
-const ScDPDimensionSaveData* pDimData, std::setScDPObject* 
rRefs);
+const OUString rName, const ScRange rRange, 
std::setScDPObject* rRefs);
 bool remove(const ScDPCache* p);
 };
 
@@ -358,8 +357,9 @@ public:
 com::sun::star::uno::Referencecom::sun::star::sdbc::XRowSet 
createRowSet(
 sal_Int32 nSdbType, const OUString rDBName, const OUString 
rCommand);
 
-void updateCache(sal_Int32 nSdbType, const OUString rDBName, const 
OUString rCommand,
- const ScDPDimensionSaveData* pDimData, 
std::setScDPObject* rRefs);
+void updateCache(
+sal_Int32 nSdbType, const OUString rDBName, const OUString 
rCommand,
+std::setScDPObject* rRefs);
 bool remove(const ScDPCache* p);
 };
 
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 4aec8a8..677bd5e 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -2809,6 +2809,25 @@ struct FindInvalidRange : public 
std::unary_functionScRange, bool
 }
 };
 
+void setGroupItemsToCache( ScDPCache rCache, const std::setScDPObject* 
rRefs )
+{
+// Go through all referencing pivot tables, and re-fill the group 
dimension info.
+std::setScDPObject*::const_iterator itRef = rRefs.begin(), itRefEnd = 
rRefs.end();
+for (; itRef != itRefEnd; ++itRef)
+{
+const ScDPObject* pObj = *itRef;
+const ScDPSaveData* pSave = pObj-GetSaveData();
+if (!pSave)
+continue;
+
+const ScDPDimensionSaveData* pGroupDims = 
pSave-GetExistingDimensionData();
+if (!pGroupDims)
+continue;
+
+pGroupDims-WriteToCache(rCache);
+}
+}
+
 }
 
 bool ScDPCollection::SheetCaches::hasCache(const ScRange rRange) const
@@ -2926,8 +2945,7 @@ void ScDPCollection::SheetCaches::updateReference(
 }
 }
 
-void ScDPCollection::SheetCaches::updateCache(
-const ScRange rRange, const ScDPDimensionSaveData* pDimData, 
std::setScDPObject* rRefs)
+void ScDPCollection::SheetCaches::updateCache(const ScRange rRange, 
std::setScDPObject* rRefs)
 {
 RangeIndexType::iterator it = std::find(maRanges.begin(), maRanges.end(), 
rRange);
 if (it == maRanges.end())
@@ -2947,12 +2965,15 @@ void ScDPCollection::SheetCaches::updateCache(
 }
 
 ScDPCache rCache = *itCache-second;
+
+// Update the cache with new cell values. This will clear all group 
dimension info.
 rCache.InitFromDoc(mpDoc, rRange);
-if (pDimData)
-pDimData-WriteToCache(rCache);
 
 std::setScDPObject* aRefs(rCache.GetAllReferences());
 rRefs.swap(aRefs);
+
+// Make sure to re-populate the group dimension info.
+setGroupItemsToCache(rCache, rRefs);
 }
 
 bool ScDPCollection::SheetCaches::remove(const ScDPCache* p)
@@ -3010,8 +3031,7 @@ size_t ScDPCollection::NameCaches::size() const
 }
 
 void ScDPCollection::NameCaches::updateCache(
-const OUString rName, const ScRange rRange, const ScDPDimensionSaveData* 
pDimData,
-std::setScDPObject* rRefs)
+const OUString rName, const ScRange rRange, std::setScDPObject* rRefs)
 {
 CachesType::iterator itr = maCaches.find(rName);
 if (itr == maCaches.end())
@@ -3021,12 +3041,14 @@ void 

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

2013-10-30 Thread Markus Mohrhard
 sc/inc/documentimport.hxx  |4 +-
 sc/source/core/data/column3.cxx|   12 ++-
 sc/source/core/data/documentimport.cxx |5 +--
 sc/source/ui/docshell/impex.cxx|   52 -
 test/source/sheet/xspreadsheets2.cxx   |6 +--
 5 files changed, 46 insertions(+), 33 deletions(-)

New commits:
commit 4954e2a2f6d99e9c1cfb15435c66bdbbf62f1cd3
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon Oct 28 23:20:20 2013 +0100

simplify code and fix out of bounds read

Change-Id: I5be3a28d3d1ae43974f844d143a30bfd989cbe5b

diff --git a/test/source/sheet/xspreadsheets2.cxx 
b/test/source/sheet/xspreadsheets2.cxx
index d9d78b6..aa010d3 100644
--- a/test/source/sheet/xspreadsheets2.cxx
+++ b/test/source/sheet/xspreadsheets2.cxx
@@ -326,10 +326,10 @@ void XSpreadsheets2::importSheetToCopy()
 bool XSpreadsheets2::isExternalReference(const OUString aDestContent, const 
OUString aSrcContent )
 {
 OUString aStart('file://);
-const sal_Char* sSrcContent = OUStringToOString( aSrcContent, 
RTL_TEXTENCODING_UTF8 ).getStr();
 
-return  (aDestContent.endsWithIgnoreAsciiCaseAsciiL(sSrcContent, 
aSrcContent.getLength()) // same cell address
- aDestContent.indexOf(aStart)==0 // starts with 'file://
+CPPUNIT_ASSERT(aDestContent.startsWith(aStart));
+
+return  (aDestContent.endsWithIgnoreAsciiCase(aSrcContent, NULL) // same 
cell address
  aDestContent.indexOf(aSrcFileName)0); // contains source file 
name
 }
 
commit 34012133266714259e5b009851924d176199a60d
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Oct 29 02:34:08 2013 +0100

use sal_Int32 instead of xub_StrLen

Change-Id: Id868448b5c981d744a066c738b344752bcd0faab

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 1399da2..df74149 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -625,7 +625,7 @@ static bool lcl_appendLineData( OUString rField, const 
sal_Unicode* p1, const s
 OSL_ENSURE( rField.getLength() + (p2 - p1) = STRING_MAXLEN, 
lcl_appendLineData: data overflow);
 if (rField.getLength() + (p2 - p1) = STRING_MAXLEN)
 {
-rField += OUString( p1, sal::static_int_castxub_StrLen( p2 - p1 ) );
+rField += OUString( p1, sal::static_int_castsal_Int32( p2 - p1 ) );
 return true;
 }
 else
@@ -763,7 +763,7 @@ static const sal_Unicode* lcl_ScanSylkString( const 
sal_Unicode* p,
 }
 if (!pEndQuote)
 pEndQuote = p;  // Take all data as string.
-rString += OUString(pStartQuote + 1, sal::static_int_castxub_StrLen( 
pEndQuote - pStartQuote - 1 ) );
+rString += OUString(pStartQuote + 1, sal::static_int_castsal_Int32( 
pEndQuote - pStartQuote - 1 ) );
 lcl_UnescapeSylk( rString, eVersion);
 return p;
 }
@@ -785,7 +785,7 @@ static const sal_Unicode* lcl_ScanSylkFormula( const 
sal_Unicode* p,
 }
 ++p;
 }
-rString += OUString( pStart, sal::static_int_castxub_StrLen( p - 
pStart));
+rString += OUString( pStart, sal::static_int_castsal_Int32( p - 
pStart));
 lcl_UnescapeSylk( rString, eVersion);
 }
 else
@@ -826,7 +826,7 @@ static const sal_Unicode* lcl_ScanSylkFormula( const 
sal_Unicode* p,
 {
 while (*p  *p != ';')
 ++p;
-rString += OUString( pStart, sal::static_int_castxub_StrLen( p - 
pStart));
+rString += OUString( pStart, sal::static_int_castsal_Int32( p - 
pStart));
 }
 }
 return p;
@@ -1011,9 +1011,9 @@ static bool lcl_PutString(
 else if ( nColFormat != SC_COL_STANDARD )   // 
Datumsformate
 {
 const sal_uInt16 nMaxNumberParts = 7;   // Y-M-D h:m:s.t
-xub_StrLen nLen = rStr.getLength();
-xub_StrLen nStart[nMaxNumberParts];
-xub_StrLen nEnd[nMaxNumberParts];
+sal_Int32 nLen = rStr.getLength();
+sal_Int32 nStart[nMaxNumberParts];
+sal_Int32 nEnd[nMaxNumberParts];
 
 sal_uInt16 nDP, nMP, nYP;
 switch ( nColFormat )
@@ -1026,7 +1026,7 @@ static bool lcl_PutString(
 
 sal_uInt16 nFound = 0;
 bool bInNum = false;
-for ( xub_StrLen nPos=0; nPosnLen  (bInNum ||
+for ( sal_Int32 nPos=0; nPosnLen  (bInNum ||
 nFoundnMaxNumberParts); nPos++ )
 {
 if (bInNum  nFound == 3  nColFormat == SC_COL_YMD 
@@ -1052,8 +1052,8 @@ static bool lcl_PutString(
 {
 //  try to break one number (without separators) into date fields
 
-xub_StrLen nDateStart = nStart[0];
-xub_StrLen nDateLen = nEnd[0] + 1 - nDateStart;
+sal_Int32 nDateStart = nStart[0];
+sal_Int32 nDateLen = nEnd[0] + 1 - nDateStart;
 
 if ( nDateLen = 5  nDateLen = 8 
 ScGlobal::pCharClass-isNumeric( rStr.copy( nDateStart, 
nDateLen ) ) )

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

2013-10-26 Thread Matúš Kukan
 sc/inc/document.hxx|5 
 sc/source/core/data/document.cxx   |5 
 sc/source/filter/xml/XMLStylesExportHelper.cxx |  219 +
 sc/source/filter/xml/XMLStylesExportHelper.hxx |   14 -
 sc/source/filter/xml/xmlexprt.cxx  |   22 --
 sc/source/filter/xml/xmlexprt.hxx  |2 
 sw/inc/unomap.hxx  |8 
 sw/source/core/unocore/unomap.cxx  |6 
 8 files changed, 55 insertions(+), 226 deletions(-)

New commits:
commit 7dd4555fef48665351b94f5956b3932ea19cbe54
Author: Matúš Kukan matus.ku...@gmail.com
Date:   Thu Oct 24 16:55:31 2013 +0200

remove unused class SwItemPropertySet

Change-Id: I6913d5ac9ce5082a8050da26c77a4b3bcb40a699

diff --git a/sw/inc/unomap.hxx b/sw/inc/unomap.hxx
index 1b938bc..dce014f 100644
--- a/sw/inc/unomap.hxx
+++ b/sw/inc/unomap.hxx
@@ -306,14 +306,6 @@
 #define WID_TXTCOL_AUTO_DISTANCE6
 #define WID_TXTCOL_LINE_STYLE   7
 
-class SwItemPropertySet : public SfxItemPropertySet
-{
-protected:
-virtual sal_BoolFillItem(SfxItemSet rSet, sal_uInt16 nWhich, 
sal_Bool bGetProperty) const;
-public:
-SwItemPropertySet( const SfxItemPropertyMapEntry *pMap ) :
-SfxItemPropertySet( pMap ){}
-};
 class SwUnoPropertyMapProvider
 {
 SfxItemPropertyMapEntry*aMapEntriesArr[PROPERTY_MAP_END];
diff --git a/sw/source/core/unocore/unomap.cxx 
b/sw/source/core/unocore/unomap.cxx
index 7df9865..f63b85a 100644
--- a/sw/source/core/unocore/unomap.cxx
+++ b/sw/source/core/unocore/unomap.cxx
@@ -3120,10 +3120,4 @@ const SfxItemPropertySet*  
SwUnoPropertyMapProvider::GetPropertySet( sal_uInt16
 return aPropertySetArr[nPropertyId];
 }
 
-sal_Bool SwItemPropertySet::FillItem(SfxItemSet /*rSet*/, sal_uInt16 
/*nWhich*/, sal_Bool /*bGetProperty*/) const
-{
-sal_Bool bRet = sal_False;
-return bRet;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 793ec02cc3cd53916e20e5e981662a989eff8a48
Author: Matúš Kukan matus.ku...@gmail.com
Date:   Thu Oct 24 12:14:10 2013 +0200

remove now unused ScDocument::GetRowDefault

Change-Id: I35b0a1cd86d1da9f11a9b8d3990eaa1509983243

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 752984d..840ecf0 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1550,10 +1550,9 @@ public:
 // the row heights are always compared.
 SCROW   GetNextDifferentChangedRow( SCTAB nTab, SCROW nStart, bool 
bCareManualSize = true) const;
 
-// returns whether to export a Default style for this col/row or not
-// nDefault is setted to one possition in the current row/col where the 
Default style is
+// returns whether to export a Default style for this col or not
+// nDefault is setted to one possition in the current row where the 
Default style is
 boolGetColDefault( SCTAB nTab, SCCOL nCol, SCROW nLastRow, 
SCROW nDefault);
-boolGetRowDefault( SCTAB nTab, SCROW nRow, SCCOL nLastCol, 
SCCOL nDefault);
 
 boolUpdateOutlineCol( SCCOL nStartCol, SCCOL nEndCol, SCTAB 
nTab, bool bShow );
 boolUpdateOutlineRow( SCROW nStartRow, SCROW nEndRow, SCTAB 
nTab, bool bShow );
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index ccf7d32..15e7ee5 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -4386,11 +4386,6 @@ bool ScDocument::GetColDefault( SCTAB nTab, SCCOL nCol, 
SCROW nLastRow, SCROW n
 return bRet;
 }
 
-bool ScDocument::GetRowDefault( SCTAB /* nTab */, SCROW /* nRow */, SCCOL /* 
nLastCol */, SCCOL /* nDefault */ )
-{
-return false;
-}
-
 void ScDocument::StripHidden( SCCOL rX1, SCROW rY1, SCCOL rX2, SCROW rY2, 
SCTAB nTab )
 {
 if ( ValidTab(nTab)  nTab  static_castSCTAB(maTabs.size())  
maTabs[nTab] )
commit 38d13e7066e288b727587756f45ab6a599ca6f91
Author: Matúš Kukan matus.ku...@gmail.com
Date:   Thu Oct 24 09:16:38 2013 +0200

remove now unused ScMyDefaultStyles.maRowDefaults

Also adapt to GetColDefault() being always true.

Change-Id: I4701f02c540591b3d9f5095b22de82623c22c0db

diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx 
b/sc/source/filter/xml/XMLStylesExportHelper.cxx
index 4a50779..7917e82 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx
@@ -454,121 +454,59 @@ const OUString 
ScMyValidationsContainer::GetValidationName(const sal_Int32 nInd
 
 sal_Int32 ScMyDefaultStyles::GetStyleNameIndex(const ScFormatRangeStyles* 
pCellStyles,
 const sal_Int32 nTable, const sal_Int32 nPos,
-const sal_Int32 i, const bool bRow, bool bIsAutoStyle)
+const sal_Int32 i, bool bIsAutoStyle)
 {
-if (bRow)
-return pCellStyles-GetStyleNameIndex(nTable, nPos, i,
-bIsAutoStyle);
-else
-return 

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

2013-02-12 Thread Kohei Yoshida
 sc/inc/cell.hxx   |   68 ---
 sc/source/core/data/cell2.cxx |   97 --
 sc/source/core/data/column2.cxx   |8 -
 sc/source/core/data/documen8.cxx  |   18 +---
 sc/source/core/data/table4.cxx|7 +
 sc/source/filter/excel/xicontent.cxx  |6 -
 sc/source/filter/excel/xihelper.cxx   |4 
 sc/source/filter/oox/richstring.cxx   |4 
 sc/source/filter/oox/worksheethelper.cxx  |4 
 sc/source/filter/rtf/eeimpars.cxx |   11 +-
 sc/source/filter/xml/XMLTrackedChangesContext.cxx |3 
 sc/source/filter/xml/xmlcelli.cxx |6 -
 sc/source/ui/docshell/docfunc.cxx |6 -
 sc/source/ui/inc/viewfunc.hxx |7 +
 sc/source/ui/undo/undoblk3.cxx|   14 ++-
 sc/source/ui/undo/undocell.cxx|   13 +-
 sc/source/ui/unoobj/cellsuno.cxx  |7 +
 sc/source/ui/view/cellsh3.cxx |2 
 sc/source/ui/view/spelleng.cxx|6 -
 sc/source/ui/view/viewfun2.cxx|5 -
 sc/source/ui/view/viewfun4.cxx|   20 ++--
 sc/source/ui/view/viewfunc.cxx|   11 +-
 22 files changed, 206 insertions(+), 121 deletions(-)

New commits:
commit f1eba4c718934e50af478fc3018d404de8d2e780
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Tue Feb 12 12:25:01 2013 -0500

Add prefix 'm' for ScEditCell's data members.

Since I'm modifying the header

Change-Id: I7cb44335a46dbc185e1a717304c221e5bb6fcb3c

diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx
index 7d0b798..c84e985 100644
--- a/sc/inc/cell.hxx
+++ b/sc/inc/cell.hxx
@@ -215,10 +215,9 @@ private:
 
 class SC_DLLPUBLIC ScEditCell : public ScBaseCell
 {
-private:
-EditTextObject* pData;
-mutable rtl::OUString* pString;// for faster access to formulas
-ScDocument* pDoc;   // for EditEngine access with Pool
+EditTextObject* mpData;
+mutable OUString* mpString;// for faster access to formulas
+ScDocument* mpDoc;   // for EditEngine access with Pool
 
 voidSetTextObject( const EditTextObject* pObject,
 const SfxItemPool* pFromPool );
@@ -242,7 +241,7 @@ public:
  * instance returned from ScDocument::GetEditPool()/i.  This is
  * important./p
  */
-ScEditCell(EditTextObject* pObject, ScDocument* pDocP);
+ScEditCell(EditTextObject* pObject, ScDocument* pDoc);
 
 /**
  * Constructor.  The caller is responsible for deleting the text object
@@ -250,17 +249,18 @@ public:
  * stores it instead of the original.
  *
  * @param rObject text object to clone from.
- * @param pDocP pointer to the document instance.
+ * @param pDoc pointer to the document instance.
  * @param pFromPool pointer to SfxItemPool instance that the new text
  *  object that is to be stored in the cell instance
  *  should use.  If it's NULL, it uses the default pool
  *  for edit cells from the document instance (one
  *  returned from GetEditPool()).
  */
-ScEditCell(const EditTextObject rObject, ScDocument* pDocP, const 
SfxItemPool* pFromPool);
+ScEditCell(const EditTextObject rObject, ScDocument* pDoc, const 
SfxItemPool* pFromPool);
 ScEditCell(const ScEditCell rCell, ScDocument rDoc, const ScAddress 
rDestPos);
-// for line breaks
-ScEditCell( const rtl::OUString rString, ScDocument* );
+
+// for line breaks
+ScEditCell(const OUString rString, ScDocument* pDoc);
 
 /**
  * Remove the text data as well as string cache.
@@ -288,7 +288,7 @@ public:
  */
 void SetData(EditTextObject* pObject);
 
-rtl::OUString   GetString() const;
+OUString GetString() const;
 
 const EditTextObject* GetData() const;
 
diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx
index 58a7595..ac0f73d 100644
--- a/sc/source/core/data/cell2.cxx
+++ b/sc/source/core/data/cell2.cxx
@@ -52,44 +52,45 @@ IMPL_FIXEDMEMPOOL_NEWDEL( ScEditCell )
 
 // 
 
-ScEditCell::ScEditCell(EditTextObject* pObject, ScDocument* pDocP) :
+ScEditCell::ScEditCell(EditTextObject* pObject, ScDocument* pDoc) :
 ScBaseCell(CELLTYPE_EDIT),
-pData(pObject), pString(NULL), pDoc(pDocP) {}
+mpData(pObject), mpString(NULL), mpDoc(pDoc) {}
 
 ScEditCell::ScEditCell(
-const EditTextObject rObject, ScDocument* pDocP, const SfxItemPool* 
pFromPool) :
+const EditTextObject rObject, ScDocument* pDoc, const SfxItemPool* 
pFromPool) :
 ScBaseCell(CELLTYPE_EDIT),
-pString(NULL),
-pDoc(pDocP)
+

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

2013-02-06 Thread Kohei Yoshida
 sc/inc/column.hxx   |   15 +--
 sc/source/core/data/column.cxx  |   28 
 sc/source/core/data/column3.cxx |5 ++---
 sc/source/core/data/table1.cxx  |2 +-
 sc/source/core/data/table4.cxx  |4 ++--
 5 files changed, 26 insertions(+), 28 deletions(-)

New commits:
commit e7b1c7954e159197ad414e8aff7e7a04c30da29c
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Tue Nov 6 19:17:19 2012 -0500

Re-order the header includes. Make sure column.hxx comes first.

Change-Id: I9f93724c4e0b565a9148d0893feda9e82109bff7

diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 4ee7923..fc22a5b 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -17,15 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include map
-
-#include svl/poolcach.hxx
-#include svl/zforlist.hxx
-#include editeng/scripttypeitem.hxx
-#include string.h
-
-#include scitems.hxx
 #include column.hxx
+#include scitems.hxx
 #include cell.hxx
 #include document.hxx
 #include docpool.hxx
@@ -37,6 +30,13 @@
 #include detfunc.hxx  // for Notes in Sort/Swap
 #include postit.hxx
 
+#include svl/poolcach.hxx
+#include svl/zforlist.hxx
+#include editeng/scripttypeitem.hxx
+
+#include cstring
+#include map
+
 using ::editeng::SvxBorderLine;
 using namespace formula;
 
commit 9c8d87e46bba0eb9a3b8d923c6c630a359bf0f6c
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Tue Nov 6 19:07:08 2012 -0500

Use initializer to initialize data members.

Change-Id: I912cede3a240ccd4e1cc94be46c7dfee36a85af6

diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index cfe4bbe..35316cd 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -67,14 +67,7 @@ struct ScNeededSizeOptions
 boolbGetFont;
 boolbTotalSize;
 
-ScNeededSizeOptions()
-{
-pPattern = NULL;
-bFormula = false;
-bSkipMerged = true;
-bGetFont = true;
-bTotalSize = false;
-}
+ScNeededSizeOptions();
 };
 
 struct ColEntry
@@ -83,7 +76,6 @@ struct ColEntry
 ScBaseCell* pCell;
 };
 
-
 class ScColumn
 {
 private:
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index d803755..4ee7923 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -49,6 +49,11 @@ inline bool IsAmbiguousScriptNonZero( sal_uInt8 nScript )
  nScript != 0 );
 }
 
+ScNeededSizeOptions::ScNeededSizeOptions() :
+pPattern(NULL), bFormula(false), bSkipMerged(true), bGetFont(true), 
bTotalSize(false)
+{
+}
+
 ScColumn::ScColumn() :
 nCol( 0 ),
 pAttrArray( NULL ),
commit ba42d88d95cdc7fe6130b3bd3a41e8c731110238
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Tue Nov 6 17:17:22 2012 -0500

Make ScColumn explicitly non-copyable.

Change-Id: I0e3f552f8ed8a57f399ba9e01c06a23d9a9da854

diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 9ed577ec..cfe4bbe 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -107,6 +107,9 @@ friend class ScCellIterator;
 friend class ScHorizontalCellIterator;
 friend class ScHorizontalAttrIterator;
 
+ScColumn(const ScColumn); // disabled
+ScColumn operator= (const ScColumn); // disabled
+
 public:
 ScColumn();
 ~ScColumn();
commit 2b70c47a37f33819cff0e42d00c37cfaea0461ec
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Tue Nov 6 14:00:54 2012 -0500

Rename ScColumn::Resize() to ReserveSize().

The new name is more aligned with what it actually does.

Change-Id: I703e20253fe5957c775026d8d08f2906f2d7889c

diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index f6dff3b..9ed577ec 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -121,7 +121,7 @@ public:
 voidDelete( SCROW nRow );
 voidDeleteAtIndex( SCSIZE nIndex );
 voidFreeAll();
-voidResize( SCSIZE nSize );
+void ReserveSize( SCSIZE nSize );
 voidSwapRow( SCROW nRow1, SCROW nRow2 );
 voidSwapCell( SCROW nRow, ScColumn rCol);
 
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index f29dc2d..d803755 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -760,8 +760,7 @@ ScBaseCell* ScColumn::GetCell( SCROW nRow ) const
 return NULL;
 }
 
-
-void ScColumn::Resize( SCSIZE nSize )
+void ScColumn::ReserveSize( SCSIZE nSize )
 {
 if (nSize  sal::static_int_castSCSIZE(MAXROWCOUNT))
 nSize = MAXROWCOUNT;
@@ -1178,7 +1177,7 @@ void ScColumn::CopyToClip(SCROW nRow1, SCROW nRow2, 
ScColumn rColumn, bool bKee
 
 if (nBlockCount)
 {
-rColumn.Resize( rColumn.GetCellCount() + nBlockCount );
+rColumn.ReserveSize(rColumn.GetCellCount() + nBlockCount);
 ScAddress aOwnPos( nCol, 0, nTab );
 ScAddress aDestPos( rColumn.nCol, 0, rColumn.nTab );