[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/formulacell.cxx |2 +- sc/source/filter/inc/unitconverter.hxx |3 +++ sc/source/filter/oox/sheetdatabuffer.cxx | 12 sc/source/filter/oox/unitconverter.cxx | 16 +++- 4 files changed, 23 insertions(+), 10 deletions(-) New commits: commit 1fc1d0d7d38bb16832d0d78d78682ed2d5f8716f Author: Eike Rathke er...@redhat.com Date: Tue Dec 16 01:37:31 2014 +0100 fdo#79249 call formula compiler with error string ... instead of attempting to stringize a NaN coded error value. Regression introduced with 30a20743ae17e6e02183a65603d38968253b3ffb (cherry picked from commit 994607b55104b9ae4554554c13b001b8d5d513b6) construct grouped ScFormulaCell with bDirty=true, fdo#79249 related Noticed when loading https://bugs.freedesktop.org/attachment.cgi?id=99844 with fdo#79249 fix where oox::xls::applyCellFormulas() groups the consecutive =#N/A formulas. Only A1 result was displayed, other cells were displayed empty. (cherry picked from commit a1dc5e97da273bf35d58d54e625149022569a993) correct error string, #N/A instead of #NA (cherry picked from commit 758755e31b3d9e1ed2eab522d4794282178346ac) implement an actually working setErrorCell() from BIFF error codes (cherry picked from commit ca9a81b2ca858b82e863e1e6f917928916fea79e) Change-Id: Ia7a8ca39938820ac75db169404446fa696c6ee1b 3a541f74d3d25e1515a1c6d47f02ec6a8e817c93 15019072b6e812b9ffe29d3ee6afacd9ab526948 67b8fc324779875ba14e2d69204c40fe27cc180e Reviewed-on: https://gerrit.libreoffice.org/13492 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index c0fead2..26ae959 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -683,7 +683,7 @@ ScFormulaCell::ScFormulaCell( nSeenInIteration(0), cMatrixFlag ( cInd ), nFormatType(xGroup-mnFormatType), -bDirty(false), +bDirty(true), bChanged( false ), bRunning( false ), bCompile( false ), diff --git a/sc/source/filter/inc/unitconverter.hxx b/sc/source/filter/inc/unitconverter.hxx index 88921d1..dbd6424 100644 --- a/sc/source/filter/inc/unitconverter.hxx +++ b/sc/source/filter/inc/unitconverter.hxx @@ -88,6 +88,9 @@ public: /** Returns a BIFF error code from the passed error string. */ sal_uInt8 calcBiffErrorCode( const OUString rErrorCode ) const; +/** Returns an error string from the passed BIFF error code. */ +const OUString calcErrorString( sal_uInt8 nErrorCode ) const; + private: /** Adds an error code to the internal maps. */ voidaddErrorCode( sal_uInt8 nErrorCode, const OUString rErrorCode ); diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx index b3963df..eaab100 100644 --- a/sc/source/filter/oox/sheetdatabuffer.cxx +++ b/sc/source/filter/oox/sheetdatabuffer.cxx @@ -209,18 +209,14 @@ void SheetDataBuffer::setBooleanCell( const CellModel rModel, bool bValue ) void SheetDataBuffer::setErrorCell( const CellModel rModel, const OUString rErrorCode ) { -setErrorCell( rModel, getUnitConverter().calcBiffErrorCode( rErrorCode ) ); +// Using the formula compiler now we can simply pass on the error string. +getFormulaBuffer().setCellFormula( rModel.maCellAddr, rErrorCode); +setCellFormat( rModel ); } void SheetDataBuffer::setErrorCell( const CellModel rModel, sal_uInt8 nErrorCode ) { -OUStringBuffer aBuf; -aBuf.append('{'); -aBuf.append(BiffHelper::calcDoubleFromError(nErrorCode)); -aBuf.append('}'); - -getFormulaBuffer().setCellFormula(rModel.maCellAddr, aBuf.makeStringAndClear()); -setCellFormat( rModel ); +setErrorCell( rModel, getUnitConverter().calcErrorString( nErrorCode)); } void SheetDataBuffer::setDateCell( const CellModel rModel, const OUString rDateString ) diff --git a/sc/source/filter/oox/unitconverter.cxx b/sc/source/filter/oox/unitconverter.cxx index 55ba77f..2eff676 100644 --- a/sc/source/filter/oox/unitconverter.cxx +++ b/sc/source/filter/oox/unitconverter.cxx @@ -120,7 +120,7 @@ UnitConverter::UnitConverter( const WorkbookHelper rHelper ) : addErrorCode( BIFF_ERR_REF, #REF! ); addErrorCode( BIFF_ERR_NAME, #NAME? ); addErrorCode( BIFF_ERR_NUM, #NUM! ); -addErrorCode( BIFF_ERR_NA,#NA ); +addErrorCode( BIFF_ERR_NA,#N/A ); } void UnitConverter::finalizeImport() @@ -226,6 +226,20 @@ sal_uInt8 UnitConverter::calcBiffErrorCode( const OUString rErrorCode ) const return (aIt == maOoxErrCodes.end()) ? BIFF_ERR_NA : aIt-second; } +const OUString UnitConverter::calcErrorString( sal_uInt8 nErrorCode ) const +{ +OoxErrorCodeMap::const_iterator iFail( maOoxErrCodes.end()); +for
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/document.cxx | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) New commits: commit f303896706144cd25aa907805db6ca8bf338bb13 Author: Eike Rathke er...@redhat.com Date: Thu Dec 18 20:07:55 2014 +0100 fdo#68385 update references only if cut originates from the same document Change-Id: Ia7b27309251cf9e47505c58d8ed0172d134280f4 (cherry picked from commit f2ac9fab2677a6a718f251baef75d3cae96d1f01) Reviewed-on: https://gerrit.libreoffice.org/13530 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index c6c3196..b423f05 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2552,11 +2552,16 @@ void ScDocument::CopyBlockFromClip( aRefCxt.mnTabDelta = nDz; if (rCxt.getClipDoc()-GetClipParam().mbCutMode) { -bool bOldInserting = IsInsertingFromOtherDoc(); -SetInsertingFromOtherDoc( true); -aRefCxt.meMode = URM_MOVE; -UpdateReference(aRefCxt, rCxt.getUndoDoc(), false); -SetInsertingFromOtherDoc( bOldInserting); +// Update references only if cut originates from the same +// document we are pasting into. +if (rCxt.getClipDoc()-GetPool() == GetPool()) +{ +bool bOldInserting = IsInsertingFromOtherDoc(); +SetInsertingFromOtherDoc( true); +aRefCxt.meMode = URM_MOVE; +UpdateReference(aRefCxt, rCxt.getUndoDoc(), false); +SetInsertingFromOtherDoc( bOldInserting); +} } else { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/xml/xmlfilti.cxx | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) New commits: commit 08f89a78e899b1f463d78fe31696418f7ba07ea7 Author: Eike Rathke er...@redhat.com Date: Fri Dec 12 14:49:09 2014 +0100 resolved fdo#86809 connect filter conditions correctly Maybe since 0960ec3e1b7b0d872d1f84d2d56f480a4df08b21 all conditions of a single filter stack were OR connected, regardless whether filter-and was given in the file. Change-Id: Ifb423ccc7deb42bb6bba0bfc810607633f2c342c (cherry picked from commit b500e60b32b5cf8fd61beb7476c2c29e65aee3e4) Reviewed-on: https://gerrit.libreoffice.org/13450 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/filter/xml/xmlfilti.cxx b/sc/source/filter/xml/xmlfilti.cxx index 34327eb..03cfdfd 100644 --- a/sc/source/filter/xml/xmlfilti.cxx +++ b/sc/source/filter/xml/xmlfilti.cxx @@ -178,12 +178,19 @@ bool ScXMLFilterContext::GetConnection() // secondary item gets the current connection. return rItem.mbOr; +// The next condition of this stack will get the current connection. +++rItem.mnCondCount; + if (maConnStack.size() 2) // There is no last stack. Likely the first condition in the first -// stack whose connection is not used. -return true; +// stack whose connection is not used. Default in +// ScQueryEntry::eConnect is SC_AND, so return false (AND instead of +// OR) here. Otherwise, when saving the document again, we'd write a +// uselessly stacked +// table:filter-ortable:filter-and.../table:filter-and/table:filter-or +// for two conditions connected with AND. +return false; -++rItem.mnCondCount; std::vectorConnStackItem::reverse_iterator itr = maConnStack.rbegin(); ++itr; return itr-mbOr; // connection of the last stack. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/column3.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit dd4534b17f32668100d80819de1a3f31a432feb0 Author: Caolán McNamara caol...@redhat.com Date: Fri Nov 28 10:09:23 2014 + test rows for validity Change-Id: I501c1c18df96b5b2ad628e86cfb724a541d5c4b6 (cherry picked from commit 1e514c8da8e37fc3cb26af6ddaf95a3ed8093a41) Reviewed-on: https://gerrit.libreoffice.org/13171 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index c311e37..146e026 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -101,6 +101,9 @@ struct DirtyCellInterpreter void ScColumn::InterpretDirtyCells( SCROW nRow1, SCROW nRow2 ) { +if (!ValidRow(nRow1) || !ValidRow(nRow2) || nRow1 nRow2) +return; + DirtyCellInterpreter aFunc; sc::ProcessFormula(maCells.begin(), maCells, nRow1, nRow2, aFunc); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/view/viewdata.cxx | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) New commits: commit d29fee4c0d18f8665c342707a2e54f4427bffec6 Author: Eike Rathke er...@redhat.com Date: Fri Nov 28 23:47:02 2014 +0100 set only valid positions from ScExtTabSettings at ScViewDataTable Some address fields of ScExtTabSettings are initialized invalid and maybe kept invalid, on purpose, so take care of that and use only the valid fields. Change-Id: I37cbf8ff49c6ccf38bfac3e1c8c6492ac7bad61b (cherry picked from commit 8bc56801af0540c0496c1f8ddd335578a8791017) Reviewed-on: https://gerrit.libreoffice.org/13184 Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 414f07f..dee7139 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -2486,10 +2486,19 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions rDocOpt ) bool bVSplit = bFrozen ? (rTabSett.maFreezePos.Row() 0) : (rTabSett.maSplitPos.Y() 0); // first visible cell of top-left pane and additional panes -rViewTab.nPosX[ SC_SPLIT_LEFT ] = rTabSett.maFirstVis.Col(); -rViewTab.nPosY[ bVSplit ? SC_SPLIT_TOP : SC_SPLIT_BOTTOM ] = rTabSett.maFirstVis.Row(); -if( bHSplit ) rViewTab.nPosX[ SC_SPLIT_RIGHT ] = rTabSett.maSecondVis.Col(); -if( bVSplit ) rViewTab.nPosY[ SC_SPLIT_BOTTOM ] = rTabSett.maSecondVis.Row(); +if (rTabSett.maFirstVis.IsValid()) +{ +rViewTab.nPosX[ SC_SPLIT_LEFT ] = rTabSett.maFirstVis.Col(); +rViewTab.nPosY[ bVSplit ? SC_SPLIT_TOP : SC_SPLIT_BOTTOM ] = rTabSett.maFirstVis.Row(); +} + +if (rTabSett.maSecondVis.IsValid()) +{ +if (bHSplit) +rViewTab.nPosX[ SC_SPLIT_RIGHT ] = rTabSett.maSecondVis.Col(); +if (bVSplit) +rViewTab.nPosY[ SC_SPLIT_BOTTOM ] = rTabSett.maSecondVis.Row(); +} // split mode, split and freeze position rViewTab.eHSplitMode = rViewTab.eVSplitMode = SC_SPLIT_NONE; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/undo/undosort.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 57d68a12a7f8c8ac1e60eda33a9f96ce3bca75c2 Author: Eike Rathke er...@redhat.com Date: Tue Nov 25 19:02:08 2014 +0100 fdo#86708 paint after Undo of Sort Regression of 10fc138307afb4b39baddb0d56eb8e986e5d29ea that exchanged the PostPaint with SetDirty, but the paint is also needed. Change-Id: Ic3e81fa106f405568effaed71ab33b575b4c5c5c (cherry picked from commit 5cec4ea827570a5bb0a368025f3733b841107d07) Reviewed-on: https://gerrit.libreoffice.org/13123 Reviewed-by: Andras Timar andras.ti...@collabora.com Tested-by: Andras Timar andras.ti...@collabora.com diff --git a/sc/source/ui/undo/undosort.cxx b/sc/source/ui/undo/undosort.cxx index 4a00707..f86bdc2 100644 --- a/sc/source/ui/undo/undosort.cxx +++ b/sc/source/ui/undo/undosort.cxx @@ -49,6 +49,9 @@ void UndoSort::Execute( bool bUndo ) rDoc.SetDirty(maParam.maSortRange); if (!aParam.mbUpdateRefs) rDoc.BroadcastCells(aParam.maSortRange, SC_HINT_DATACHANGED); + +pDocShell-PostPaint(maParam.maSortRange, PAINT_GRID); +pDocShell-PostDataChanged(); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/table3.cxx |7 +-- sc/source/ui/undo/undosort.cxx |3 +-- 2 files changed, 6 insertions(+), 4 deletions(-) New commits: commit 1f0bca308e677a3e7a75837f93f14b679f698846 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Sun Oct 26 14:43:14 2014 -0700 fdo#85215: Don't adjust references wrt cell position when disabled. Change-Id: Ie1a12cc189bcb66fad59ea9901ac0dc95bb68788 (cherry picked from commit 10fc138307afb4b39baddb0d56eb8e986e5d29ea) Signed-off-by: Eike Rathke er...@redhat.com diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index c36b4cd..d646678 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -864,8 +864,11 @@ void ScTable::SortReorderByRow( ScAddress aOldPos = rCell.maCell.mpFormula-aPos; ScFormulaCell* pNew = rCell.maCell.mpFormula-Clone( aCellPos, SC_CLONECELL_DEFAULT); -pNew-CopyAllBroadcasters(*rCell.maCell.mpFormula); -pNew-GetCode()-AdjustReferenceOnMovedOrigin(aOldPos, aCellPos); +if (pArray-IsUpdateRefs()) +{ +pNew-CopyAllBroadcasters(*rCell.maCell.mpFormula); +pNew-GetCode()-AdjustReferenceOnMovedOrigin(aOldPos, aCellPos); +} sc::CellStoreType::iterator itBlk = rCellStore.push_back(pNew); } diff --git a/sc/source/ui/undo/undosort.cxx b/sc/source/ui/undo/undosort.cxx index 36156fe..4a00707 100644 --- a/sc/source/ui/undo/undosort.cxx +++ b/sc/source/ui/undo/undosort.cxx @@ -46,8 +46,7 @@ void UndoSort::Execute( bool bUndo ) ScUndoUtil::MarkSimpleBlock(pDocShell, maParam.maSortRange); -pDocShell-PostPaint(maParam.maSortRange, PAINT_GRID); -pDocShell-PostDataChanged(); +rDoc.SetDirty(maParam.maSortRange); if (!aParam.mbUpdateRefs) rDoc.BroadcastCells(aParam.maSortRange, SC_HINT_DATACHANGED); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/tool/token.cxx | 67 ++ 1 file changed, 61 insertions(+), 6 deletions(-) New commits: commit b7b3934b052365e5fb19b4c62a7d78aa6ed8a536 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Mon Oct 27 07:32:32 2014 -0700 fdo#85282: Correct adjustment of range reference on delete shift. Change-Id: I6e01c160f77599dfa4a2e55b60e23d256184c822 (cherry picked from commit c3c16d5b74fb5707691283538a969a03c2f918b0) Reviewed-on: https://gerrit.libreoffice.org/12111 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com (cherry picked from commit bc38612d349b9efd877dec23f3e68a3f7b945cec) Reviewed-on: https://gerrit.libreoffice.org/12305 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index fd362e3..03ecc49 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -2536,6 +2536,9 @@ void setRefDeleted( ScComplexRefData rRef, const sc::RefUpdateContext rCxt ) bool shrinkRange( const sc::RefUpdateContext rCxt, ScRange rRefRange, const ScRange rDeletedRange ) { +if (!rDeletedRange.Intersects(rRefRange)) +return false; + if (rCxt.mnColDelta 0) { // Shifting left. @@ -2543,9 +2546,35 @@ bool shrinkRange( const sc::RefUpdateContext rCxt, ScRange rRefRange, const Sc // Deleted range is only partially overlapping in vertical direction. Bail out. return false; -// Move the last column position to the left. -SCCOL nDelta = rDeletedRange.aStart.Col() - rDeletedRange.aEnd.Col() - 1; -rRefRange.aEnd.IncCol(nDelta); +if (rDeletedRange.aStart.Col() = rRefRange.aStart.Col()) +{ +if (rRefRange.aEnd.Col() = rDeletedRange.aEnd.Col()) +{ +// Reference is entirely deleted. +rRefRange.SetInvalid(); +} +else +{ +// The reference range is truncated on the left. +SCCOL nOffset = rDeletedRange.aStart.Col() - rRefRange.aStart.Col(); +SCCOL nDelta = rRefRange.aStart.Col() - rDeletedRange.aEnd.Col() - 1; +rRefRange.aStart.IncCol(nOffset); +rRefRange.aEnd.IncCol(nDelta+nOffset); +} +} +else if (rDeletedRange.aEnd.Col() rRefRange.aEnd.Col()) +{ +// Reference is deleted in the middle. Move the last column +// position to the left. +SCCOL nDelta = rDeletedRange.aStart.Col() - rDeletedRange.aEnd.Col() - 1; +rRefRange.aEnd.IncCol(nDelta); +} +else +{ +// The reference range is truncated on the right. +SCCOL nDelta = rDeletedRange.aStart.Col() - rRefRange.aEnd.Col() - 1; +rRefRange.aEnd.IncCol(nDelta); +} return true; } else if (rCxt.mnRowDelta 0) @@ -2556,9 +2585,35 @@ bool shrinkRange( const sc::RefUpdateContext rCxt, ScRange rRefRange, const Sc // Deleted range is only partially overlapping in horizontal direction. Bail out. return false; -// Move the last row position up. -SCROW nDelta = rDeletedRange.aStart.Row() - rDeletedRange.aEnd.Row() - 1; -rRefRange.aEnd.IncRow(nDelta); +if (rDeletedRange.aStart.Row() = rRefRange.aStart.Row()) +{ +if (rRefRange.aEnd.Row() = rDeletedRange.aEnd.Row()) +{ +// Reference is entirely deleted. +rRefRange.SetInvalid(); +} +else +{ +// The reference range is truncated on the top. +SCCOL nOffset = rDeletedRange.aStart.Row() - rRefRange.aStart.Row(); +SCCOL nDelta = rRefRange.aStart.Row() - rDeletedRange.aEnd.Row() - 1; +rRefRange.aStart.IncRow(nOffset); +rRefRange.aEnd.IncRow(nDelta+nOffset); +} +} +else if (rDeletedRange.aEnd.Row() rRefRange.aEnd.Row()) +{ +// Reference is deleted in the middle. Move the last row +// position upward. +SCCOL nDelta = rDeletedRange.aStart.Row() - rDeletedRange.aEnd.Row() - 1; +rRefRange.aEnd.IncRow(nDelta); +} +else +{ +// The reference range is truncated on the bottom. +SCCOL nDelta = rDeletedRange.aStart.Row() - rRefRange.aEnd.Row() - 1; +rRefRange.aEnd.IncRow(nDelta); +} return true; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/tool/token.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 1b0b80195802dd1e707f07e4825d6847ff810c73 Author: Eike Rathke er...@redhat.com Date: Fri Aug 22 12:59:47 2014 +0200 resolved fdo#82936 do not clear the 3D flag on refupdate Change-Id: I2ae1368a2ffc20e988ff3ab66590a9f98902b862 (cherry picked from commit 75aad687cb5e63a41303aea568bf68b2b5f15d31) Reviewed-on: https://gerrit.libreoffice.org/12304 Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 77d7d1d..fd362e3 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -2847,7 +2847,8 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove( } rRef.SetAddress(aAbs, rNewPos); -rRef.SetFlag3D(b3DFlag); +if (b3DFlag) +rRef.SetFlag3D(b3DFlag); } break; case svDoubleRef: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/table3.cxx | 15 +++ 1 file changed, 15 insertions(+) New commits: commit f4c179ea7f69e87e55a416c1588ee0aad7c146c0 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Mon Oct 27 08:52:38 2014 -0700 fdo#85215: Ensure that formula broadcasting works after sort. When the reference update on sort is turned off. Change-Id: I547dd1525a638dd447fe331e22583af4a7947308 (cherry picked from commit 1eb82c78a223d9a0b2bb5c3f5c129c1ee8bdf303) Reviewed-on: https://gerrit.libreoffice.org/12113 Reviewed-by: Michael Meeks michael.me...@collabora.com Tested-by: Michael Meeks michael.me...@collabora.com diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 589a9b1..c36b4cd 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -802,6 +802,15 @@ void ScTable::SortReorderByRow( ScSortInfoArray::RowsType* pRows = pArray-GetDataRows(); assert(pRows); // In sort-by-row mode we must have data rows already populated. +if (!pArray-IsUpdateRefs()) +{ +// When the update ref mode is disabled, we need to detach all formula +// cells in the sorted range before reordering, and re-start them +// afterward. +sc::EndListeningContext aCxt(*pDocument); +DetachFormulaCells(aCxt, nCol1, nRow1, nCol2, nRow2); +} + // Split formula groups at the sort range boundaries (if applicable). std::vectorSCROW aRowBounds; aRowBounds.reserve(2); @@ -1077,6 +1086,12 @@ void ScTable::SortReorderByRow( // Re-group columns in the sorted range too. for (SCCOL i = nCol1; i = nCol2; ++i) aCol[i].RegroupFormulaCells(); + +if (!pArray-IsUpdateRefs()) +{ +sc::StartListeningContext aCxt(*pDocument); +AttachFormulaCells(aCxt, nCol1, nRow1, nCol2, nRow2); +} } short ScTable::CompareCell( ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/tool/token.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 53fd61faef7100e4609076a517e349e3b2ff2109 Author: David Tardon dtar...@redhat.com Date: Mon Oct 6 20:24:52 2014 +0200 avoid use of ref. to possibly deleted object Change-Id: If5977b280fed8d8b053f59852d3984a59ce61a69 (cherry picked from commit ce5cc7afb0f1c99237d04e0c754527c725d8491c) Reviewed-on: https://gerrit.libreoffice.org/11832 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 24f0343..77d7d1d 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -2386,9 +2386,9 @@ void ScTokenArray::ReadjustAbsolute3DReferences( const ScDocument* pOldDoc, cons sal_uInt16 nFileId; GetExternalTableData(pOldDoc, pNewDoc, rRef.Tab(), aTabName, nFileId); //replace with ScExternalSingleRefToken and adjust references -pCode[j]-DecRef(); ScExternalSingleRefToken* pToken = new ScExternalSingleRefToken(nFileId, aTabName, rRef); pToken-IncRef(); +pCode[j]-DecRef(); // ATTENTION: rRef can't be used after this point pCode[j] = pToken; } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/dbgui/validate.cxx | 12 +++- sc/source/ui/view/cellsh2.cxx |2 -- 2 files changed, 11 insertions(+), 3 deletions(-) New commits: commit 8cdb25a38530319e0b08d97d2706ff019797fe08 Author: Laurent Balland-Poirier laurent.balland-poir...@laposte.net Date: Sat Sep 27 07:59:04 2014 +0200 fdo#53920 Switch back tab at RefButton closure time Bug occurs because visible tab is not the initial tab. So, instead of switching back to initial tab at dialog closure time (removed from cellsh2.cxx), this commit proposes that switching back to initial tab is operate when expanding the RefButton shrink dialog. Reviewed-on: https://gerrit.libreoffice.org/11660 Reviewed-by: Kohei Yoshida libreoff...@kohei.us Tested-by: Kohei Yoshida libreoff...@kohei.us (cherry picked from commit 31432c4469e7e0d05516143533d6b5e0b411dda3) Change-Id: I3cf7ed14054fa69881d4ecbc55c48dfbfc4356aa diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index 84a62f88..055e81c 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -145,11 +145,21 @@ voidScTPValidationValue::RefInputDonePostHdl() } if ( ScValidationDlg *pValidationDlg = GetValidationDlg() ) +{ pValidationDlg-get_refinput_shrink_parent()-Hide(); +ScViewData* pViewData = pValidationDlg-GetTabViewShell()-GetViewData(); +SCTAB nCurTab = pViewData-GetTabNo(); +SCTAB nRefTab = pViewData-GetRefTabNo(); +// If RefInput switched to a different sheet from the data sheet, +// switch back: fdo#53920 +if ( nCurTab != nRefTab ) +{ + pViewData-GetViewShell()-SetTabNo( nRefTab ); +} +} if( m_pRefEdit !m_pRefEdit-HasFocus() ) m_pRefEdit-GrabFocus(); - } sal_Bool ScValidationDlg::Close() diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index a93761c..2e95cf1 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -852,8 +852,6 @@ void ScCellShell::ExecuteDB( SfxRequest rReq ) OSL_ENSURE(pDlg, Dialog create fail!); short nResult = pDlg-Execute(); -//When picking Cell Range, other Tab may be switched. Need restore the correct tab -pTabViewShell-SetTabNo( nTab ); if ( nResult == RET_OK ) { const SfxItemSet* pOutSet = pDlg-GetOutputItemSet(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/column4.cxx |7 ++- sc/source/core/data/table3.cxx |7 +-- 2 files changed, 11 insertions(+), 3 deletions(-) New commits: commit 086ed7e59f5ec74dfdf046c3d5b4f28ede8dd8be Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Thu Sep 18 12:13:13 2014 -0400 fdo#83764: Ensure that the row position is below MAXROW. When attempting to split formula groups, else multi_type_vector would try to locate a block outside its logical range. Change-Id: I424ede112138de459b5ba3bff5e021c4407ccf3d (cherry picked from commit 0ef6263ed2b31b8f9e431971e6c5e8928996c1c8) Reviewed-on: https://gerrit.libreoffice.org/11519 Reviewed-by: Andras Timar andras.ti...@collabora.com Tested-by: Andras Timar andras.ti...@collabora.com diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx index d1aacdd..8b46e74 100644 --- a/sc/source/core/data/column4.cxx +++ b/sc/source/core/data/column4.cxx @@ -499,11 +499,16 @@ public: void ScColumn::SplitFormulaGroupByRelativeRef( const ScRange rBoundRange ) { +if (rBoundRange.aStart.Row() = MAXROW) +// Nothing to split. +return; + std::vectorSCROW aBounds; // Cut at row boundaries first. aBounds.push_back(rBoundRange.aStart.Row()); -aBounds.push_back(rBoundRange.aEnd.Row()+1); +if (rBoundRange.aEnd.Row() MAXROW) +aBounds.push_back(rBoundRange.aEnd.Row()+1); sc::SharedFormulaUtil::splitFormulaCellGroups(maCells, aBounds); RelativeRefBoundChecker aFunc(rBoundRange); diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index c1a81e6..946416d 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -771,8 +771,11 @@ void ScTable::SortReorderByColumn( sc::CellStoreType rCells = aCol[nCol].maCells; sc::CellStoreType::position_type aPos = rCells.position(nRow1); sc::SharedFormulaUtil::joinFormulaCellAbove(aPos); -aPos = rCells.position(aPos.first, nRow2+1); -sc::SharedFormulaUtil::joinFormulaCellAbove(aPos); +if (nRow2 MAXROW) +{ +aPos = rCells.position(aPos.first, nRow2+1); +sc::SharedFormulaUtil::joinFormulaCellAbove(aPos); +} } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/docshell/dbdocfun.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 8066367bbe0adebae515862ebd260560657ace02 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Fri Sep 19 09:11:09 2014 -0400 fdo#84009: Be sure to update the sheet index when moving the sort range. Change-Id: Ic9ad51b33f6dfb6f90e76439c27eeff25ec4c7da (cherry picked from commit 5fd4679e7b92f344ea867e0dca1fc4c9363ae2cd) Reviewed-on: https://gerrit.libreoffice.org/11550 Reviewed-by: Andras Timar andras.ti...@collabora.com Tested-by: Andras Timar andras.ti...@collabora.com diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 29d2da1..aa1e322 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -462,6 +462,7 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam rSortParam, return false; aLocalParam.MoveToDest(); +nTab = aLocalParam.nDestTab; } ScEditableTester aTester( pDoc, nTab, aLocalParam.nCol1,aLocalParam.nRow1, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/dbgui/filtdlg.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit f1ea6f2d1ef5e40a832c3fbe2475a4ee8cc475ec Author: David Ostrovsky da...@ostrovsky.org Date: Wed Sep 24 02:11:28 2014 +0200 fdo#65281 Empty/Not empty doesn't work in columns with date format Empty and Not empty predicates were unconditionally overriden in filter dialog for date format columns. Rectify it by preventing the overriding for these functions. Test Plan: * open calc document * define column with date format * put some data and let some columns empty * apply standard filter on date column with Not empty function * verify that rows with non empty columns still visible Change-Id: I2111c5a6b6350cab63173d42419069813d1137b6 Reviewed-on: https://gerrit.libreoffice.org/11613 Reviewed-by: Kohei Yoshida libreoff...@kohei.us Tested-by: Kohei Yoshida libreoff...@kohei.us (cherry picked from commit 551ee32dfaaddd2aa48efebaefab0730474b656d) diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx index c713e2a..bfa3adf 100644 --- a/sc/source/ui/dbgui/filtdlg.cxx +++ b/sc/source/ui/dbgui/filtdlg.cxx @@ -1112,15 +1112,18 @@ IMPL_LINK( ScFilterDlg, ValModifyHdl, ComboBox*, pEd ) ScQueryEntry::Item rItem = rEntry.GetQueryItem(); bool bDoThis = (pLbField-GetSelectEntryPos() != 0); rEntry.bDoQuery = bDoThis; +bool bByEmptyOrNotByEmpty = false; if ( rEntry.bDoQuery || maRefreshExceptQuery[nQE] ) { if ( aStrEmpty.equals(aStrVal) ) { +bByEmptyOrNotByEmpty = true; rEntry.SetQueryByEmpty(); } else if ( aStrNotEmpty.equals(aStrVal) ) { +bByEmptyOrNotByEmpty = true; rEntry.SetQueryByNonEmpty(); } else @@ -1140,7 +1143,7 @@ IMPL_LINK( ScFilterDlg, ValModifyHdl, ComboBox*, pEd ) ScQueryOp eOp = (ScQueryOp)pLbCond-GetSelectEntryPos(); rEntry.eOp = eOp; -if (maHasDates[nQE]) +if (maHasDates[nQE] !bByEmptyOrNotByEmpty) rItem.meType = ScQueryEntry::ByDate; } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/dbgui/validate.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 801bd49a4c394bd0f7bc9cc05ffa95b38ce17a60 Author: Laurent Balland-Poirier laurent.balland-poir...@laposte.net Date: Mon Sep 22 08:07:01 2014 +0200 fdo#83848 Add GetAddressConvention to RefButton Reviewed-on: https://gerrit.libreoffice.org/11578 Reviewed-by: Kohei Yoshida libreoff...@kohei.us Tested-by: Kohei Yoshida libreoff...@kohei.us (cherry picked from commit 2c7595a911c3b0102162c2ad9cef4a84538b66f8) Change-Id: I20d633909d3c13bf49998a6cca054ab125b6c991 diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index 49e0bce..84a62f88 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -48,6 +48,7 @@ #include sfx2/viewfrm.hxx #include sfx2/childwin.hxx #include reffact.hxx +#include document.hxx // @@ -88,7 +89,7 @@ void ScTPValidationValue::SetReferenceHdl( const ScRangerRange , ScDocument* pD if ( m_pRefEdit ) { -OUString aStr(rRange.Format(SCR_ABS_3D, pDoc)); +OUString aStr(rRange.Format(SCR_ABS_3D, pDoc, pDoc-GetAddressConvention())); m_pRefEdit-SetRefString( aStr ); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/oox/workbookhelper.cxx |2 + sc/source/ui/app/scmod.cxx |6 ++- sc/source/ui/docshell/docsh.cxx |2 + sc/source/ui/docshell/docsh3.cxx|2 - sc/source/ui/docshell/docsh6.cxx| 60 +--- sc/source/ui/inc/docsh.hxx |2 - 6 files changed, 51 insertions(+), 23 deletions(-) New commits: commit fef72d750ea29dd3368f2e5f3099bb81e22ab07c Author: Eike Rathke er...@redhat.com Date: Thu Aug 21 23:14:52 2014 +0200 fdo#82183 do not reset globals while loading a document Destroying the function list while an instance of the Formula Wizard is still open is a bad idea. Workaround not doing this when loading a document due to a DDE function or external reference being entered in the wizard. (cherry picked from commit c0aba5007b6e468336b41138f099914c32f4b0cf) Conflicts: sc/source/ui/app/scmod.cxx sc/source/ui/docshell/docsh6.cxx sc/source/ui/inc/docsh.hxx init formula options once, fdo#82183 (cherry picked from commit 10b6bda51c9da5429ca562c70ce75ee03e5f4e56) Change-Id: I6fa00fb4f442bf7c9410679e446ff460289e4b16 Reviewed-on: https://gerrit.libreoffice.org/11064 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index ca61154..219f270 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -688,6 +688,8 @@ void WorkbookGlobals::recalcFormulaCells() officecfg::Office::Calc::Formula::Load::OOXMLRecalcMode::set(sal_Int32(0), batch); ScFormulaOptions aOpt = SC_MOD()-GetFormulaOptions(); aOpt.SetOOXMLRecalcOptions(bHardRecalc ? RECALC_ALWAYS : RECALC_NEVER); +/* XXX is this really supposed to set the ScModule options? + * Not the ScDocShell options? */ SC_MOD()-SetFormulaOptions(aOpt); batch-commit(); diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 309da2c..61b53c4 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -1073,13 +1073,15 @@ void ScModule::ModifyOptions( const SfxItemSet rOptSet ) bCompileErrorCells = true; } -SetFormulaOptions( rOpt ); - if ( pDocSh ) { pDocSh-SetFormulaOptions( rOpt ); pDocSh-SetDocumentModified(); } + +// ScDocShell::SetFormulaOptions() may check for changed settings, so +// set the new options here after that has been called. +SetFormulaOptions( rOpt ); } // diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 71dfa0a..6c03ec1 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -497,6 +497,8 @@ sal_Bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::un officecfg::Office::Calc::Formula::Load::ODFRecalcMode::set(sal_Int32(0), batch); ScFormulaOptions aOpt = SC_MOD()-GetFormulaOptions(); aOpt.SetODFRecalcOptions(bHardRecalc ? RECALC_ALWAYS : RECALC_NEVER); +/* XXX is this really supposed to set the ScModule options? + * Not the ScDocShell options? */ SC_MOD()-SetFormulaOptions(aOpt); batch-commit(); diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 42817ee..4478daa 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -438,7 +438,7 @@ void ScDocShell::InitOptions(bool bForLoading) // called from InitNew and L aDocument.SetDocOptions( aDocOpt ); aDocument.SetViewOptions( aViewOpt ); -SetFormulaOptions( aFormulaOpt ); +SetFormulaOptions( aFormulaOpt, bForLoading ); // Druck-Optionen werden jetzt direkt vor dem Drucken gesetzt diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index ca6aeb3..04b2c54 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -454,32 +454,54 @@ sal_Bool ScDocShell::ReloadTabLinks() return sal_True;//! Fehler erkennen } -void ScDocShell::SetFormulaOptions(const ScFormulaOptions rOpt ) +void ScDocShell::SetFormulaOptions( const ScFormulaOptions rOpt, bool bForLoading ) { aDocument.SetGrammar( rOpt.GetFormulaSyntax() ); -// This needs to be called first since it may re-initialize the entire -// opcode map. -if (rOpt.GetUseEnglishFuncName()) +// This is nasty because it resets module globals from within a docshell! +// For actual damage caused see fdo#82183 where an unconditional +//
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/bcaslot.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit a7f7b93299a9a7af8b243099f78f236172c4cb51 Author: Eike Rathke er...@redhat.com Date: Tue Sep 2 18:20:52 2014 +0200 check for empty slots' valid NULL pointer, fdo#79441 Change-Id: Ie81b8b00c1ab8776086bddeb7464bb7809914bf8 (cherry picked from commit 2be9ae72189e8b86d7e609727bab223645975ddb) Reviewed-on: https://gerrit.libreoffice.org/11259 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx index 1eff597..232c227 100644 --- a/sc/source/core/data/bcaslot.cxx +++ b/sc/source/core/data/bcaslot.cxx @@ -1043,7 +1043,8 @@ std::vectorsc::AreaListener ScBroadcastAreaSlotMachine::GetAllListeners( while ( nOff = nEnd ) { ScBroadcastAreaSlot* p = *pp; -p-GetAllListeners(rRange, aRet, eType); +if (p) +p-GetAllListeners(rRange, aRet, eType); ComputeNextSlot( nOff, nBreak, pp, nStart, ppSlots, nRowBreak); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/docshell/docsh.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 100a21046a95a868f32b90dab48de1cd5781fcd9 Author: Eike Rathke er...@redhat.com Date: Wed Aug 27 00:30:01 2014 +0200 out-of-bounds string access, this comparison never matched aName == aLinkTabName.copy(nIndex, nLinkTabNameLength) is not a replacement for String(aName).Equals(String(aLinkTabName), nIndex, nLinkTabNameLength) instead use aName.match( aLinkTabName, nIndex) because here nLinkTabNameLength actually is aLinkTabName.getLength() Change-Id: I884f56541f819db5672e9d096a26a3673e82d83b (cherry picked from commit aebcabd54cc5587f3856c48db0a4c4fc0f3f8ce8) Reviewed-on: https://gerrit.libreoffice.org/11134 Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index bfc94db..71dfa0a 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -326,7 +326,7 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet) { xub_StrLen nIndex = nNameLength - nLinkTabNameLength; INetURLObject aINetURLObject(aDocURLBuffer.makeStringAndClear()); -if(aName == aLinkTabName.copy(nIndex, nLinkTabNameLength) +if(aName.match( aLinkTabName, nIndex) (aName[nIndex - 1] == '#') // before the table name should be the # char !aINetURLObject.HasError()) // the docname should be a valid URL { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/table3.cxx |4 1 file changed, 4 insertions(+) New commits: commit 3a04813fbf9824ae6cf651bab0c3f55cf36ea8fa Author: Deena Francis deena.fran...@gmail.com Date: Mon Aug 25 01:38:47 2014 +0530 Resolves fdo#81084 fdo#81696 fdo#80874 fdo#81010 : sort causes crash Change-Id: I8fb9ec26bc549c264bfbf30177d720b20677b319 Reviewed-on: https://gerrit.libreoffice.org/11102 Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com (cherry picked from commit c25ac84688b596b9990d382d550f0514161b78c2) Reviewed-on: https://gerrit.libreoffice.org/11138 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index a719f85..c1a81e6 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -935,9 +935,13 @@ void ScTable::SortReorderByRow( std::vectorPatternSpan::iterator it = aSpans.begin(), itEnd = aSpans.end(); for (; it != itEnd; ++it) +pDocument-GetPool()-Put(*it-mpPattern); + +for (it = aSpans.begin(); it != itEnd; ++it) { assert(it-mpPattern); // should never be NULL. aCol[nThisCol].SetPatternArea(it-mnRow1, it-mnRow2, *it-mpPattern, true); +pDocument-GetPool()-Remove(*it-mpPattern); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/excel/excrecds.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 9cc0baaea4ec20dda6996b74a64a12f4094eee5c Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Mon Aug 18 15:16:19 2014 -0400 Let's not export sheet tab color when it's not set. COL_AUTO is the default value which is treated as color not being set. The old code would export it as a white color which is not correct. Change-Id: Ib68fccfb228333f2059edc4cfffeed90880ebc60 (cherry picked from commit 3104f95254530c76c3fc0c3b840254912c067ad8) Reviewed-on: https://gerrit.libreoffice.org/11005 Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index 847e61d..7d8ac31 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -471,8 +471,9 @@ void XclExpXmlSheetPr::SaveXml( XclExpXmlStream rStrm ) // OOXTODO: XML_outlinePr -rWorksheet-singleElement( -XML_tabColor, XML_rgb, XclXmlUtils::ToOString(maTabColor).getStr(), FSEND); +if (maTabColor != Color(COL_AUTO)) +rWorksheet-singleElement( +XML_tabColor, XML_rgb, XclXmlUtils::ToOString(maTabColor).getStr(), FSEND); rWorksheet-singleElement(XML_pageSetUpPr, // OOXTODO: XML_autoPageBreaks, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/excel/xeescher.cxx |5 ++ sc/source/filter/inc/xeescher.hxx |2 + sc/source/filter/xcl97/xcl97rec.cxx | 68 +++- 3 files changed, 65 insertions(+), 10 deletions(-) New commits: commit f1d36a5eaaff6404fee0865947040e92026c7996 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Tue Aug 12 21:24:17 2014 -0400 bnc#822170: Let's not even try to export invalid chart objects. If we do, at best, Excel will complain about the document needing repair. At worst Excel will skip some of the other valid drawing objects from being loaded. (cherry picked from commit 692878e3bb83c0fc104c5cca946c25ccf2d84ab2) Conflicts: sc/source/filter/xcl97/xcl97rec.cxx sc/source/filter/excel/xeescher.cxx Change-Id: If3794d0ae9d8b44b124020bb12b5369dfebc95ae Reviewed-on: https://gerrit.libreoffice.org/10900 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index 241182c..bb3a2a5 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -1207,7 +1207,10 @@ void XclExpChartObj::WriteShapeTransformation( sax_fastparser::FSHelperPtr pFS, pFS-endElementNS( XML_xdr, XML_xfrm ); } -// +const css::uno::Referencecss::chart::XChartDocument XclExpChartObj::GetChartDoc() const +{ +return mxChartDoc; +} XclExpNote::XclExpNote( const XclExpRoot rRoot, const ScAddress rScPos, const ScPostIt* pScNote, const OUString rAddText ) : diff --git a/sc/source/filter/inc/xeescher.hxx b/sc/source/filter/inc/xeescher.hxx index 4d7be77..cce4c66 100644 --- a/sc/source/filter/inc/xeescher.hxx +++ b/sc/source/filter/inc/xeescher.hxx @@ -324,6 +324,8 @@ public: virtual voidWriteChartObj( sax_fastparser::FSHelperPtr pDrawing, XclExpXmlStream rStrm ); void WriteShapeTransformation( sax_fastparser::FSHelperPtr pFS, const XShapeRef rXShape, sal_Bool bFlipH = false, sal_Bool bFlipV = false, sal_Int32 nRotation = 0 ); +const css::uno::Referencecss::chart::XChartDocument GetChartDoc() const; + private: typedef boost::shared_ptr XclExpChart XclExpChartRef; XclExpChartRef mxChart;/// The chart itself (BOF/EOF substream data). diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index d61383a..24624cb 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -71,6 +71,8 @@ #include com/sun/star/sheet/XCellAddressable.hpp #include com/sun/star/sheet/XCellRangeAddressable.hpp #include com/sun/star/embed/Aspects.hpp +#include com/sun/star/chart2/XCoordinateSystemContainer.hpp +#include com/sun/star/chart2/XChartTypeContainer.hpp #include oox/token/tokens.hxx #include oox/export/shapes.hxx #include oox/export/utils.hxx @@ -162,6 +164,8 @@ void XclExpObjList::Save( XclExpStream rStrm ) pSolverContainer-Save( rStrm ); } +namespace { + static bool IsVmlObject( const XclObj *rObj ) { switch( rObj-GetObjType() ) @@ -186,11 +190,61 @@ static sal_Int32 GetVmlObjectCount( XclExpObjList rList ) return nNumVml; } +bool IsValidObject( const XclObj rObj ) +{ +if (rObj.GetObjType() == EXC_OBJTYPE_CHART) +{ +// Chart object. Make sure it's a valid chart object. We skip +// invalid chart objects from exporting to prevent Excel from +// complaining on load. + +const XclExpChartObj rChartObj = static_castconst XclExpChartObj(rObj); +uno::Referencechart2::XChartDocument xChartDoc(rChartObj.GetChartDoc(), uno::UNO_QUERY); +if (!xChartDoc.is()) +return false; + +uno::Referencechart2::XDiagram xDiagram = xChartDoc-getFirstDiagram(); +if (!xDiagram.is()) +return false; + +uno::Referencechart2::XCoordinateSystemContainer xCooSysContainer(xDiagram, uno::UNO_QUERY); +if (!xCooSysContainer.is()) +return false; + +uno::Sequenceuno::Referencechart2::XCoordinateSystem xCooSysSeq = xCooSysContainer-getCoordinateSystems(); +if (!xCooSysSeq.getLength()) +return false; + +for (sal_Int32 nCooSys = 0; nCooSys xCooSysSeq.getLength(); ++nCooSys) +{ +Referencechart2::XChartTypeContainer xChartTypeCont(xCooSysSeq[nCooSys], uno::UNO_QUERY); +if (!xChartTypeCont.is()) +return false; + +uno::Sequenceuno::Referencechart2::XChartType xChartTypeSeq = xChartTypeCont-getChartTypes(); +if (!xChartTypeSeq.getLength()) +// No chart type. Not good. +return false; +} +} + +return true; +} static void SaveDrawingMLObjects( XclExpObjList rList, XclExpXmlStream rStrm, sal_Int32
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/oox/revisionfragment.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 79b9cd12ca9e465d5782c007c80c4aab854d13d1 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Fri Aug 8 10:01:49 2014 -0400 bnc#885548: Set the date time mode to non-fixed after the import is done. So that the new revisions will correctly record time stamps. Change-Id: I7d9b26bed04a95ce2652224faa0f214562818970 (cherry picked from commit 2a6843cb6c44305ac62c9cd1098a3eec4abaeb7e) Reviewed-on: https://gerrit.libreoffice.org/10830 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/filter/oox/revisionfragment.cxx b/sc/source/filter/oox/revisionfragment.cxx index 463b663..c8c1f14 100644 --- a/sc/source/filter/oox/revisionfragment.cxx +++ b/sc/source/filter/oox/revisionfragment.cxx @@ -270,6 +270,7 @@ void RevisionHeadersFragment::finalizeImport() } pCT-SetUser(aSelfUser); // set the default user to the document owner. +pCT-SetUseFixDateTime(false); rDoc.SetChangeTrack(pCT.release()); // Turn on visibility of tracked changes. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/oox/revisionfragment.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 1f2d0f87e85375a86289b79dad7ed7d1b9014dc8 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Tue Jul 29 10:33:04 2014 -0400 bnc#885548: Reset the default user to the document owner at the end. Otherwise the user name is set to the name of the user in the last revision record, which will be used when recording new revisions. Change-Id: I9b5e39c3b3a85614af67f86db9ed2bb3509a9e2b (cherry picked from commit 227d3e72b0b29b73440157b64d6fb56fa151e05e) Reviewed-on: https://gerrit.libreoffice.org/10610 Reviewed-by: Matúš Kukan matus.ku...@collabora.com Tested-by: Matúš Kukan matus.ku...@collabora.com diff --git a/sc/source/filter/oox/revisionfragment.cxx b/sc/source/filter/oox/revisionfragment.cxx index dd8cc4b..463b663 100644 --- a/sc/source/filter/oox/revisionfragment.cxx +++ b/sc/source/filter/oox/revisionfragment.cxx @@ -249,6 +249,7 @@ void RevisionHeadersFragment::finalizeImport() { ScDocument rDoc = getScDocument(); o3tl::heap_ptrScChangeTrack pCT(new ScChangeTrack(rDoc)); +OUString aSelfUser = pCT-GetUser(); // owner of this document. pCT-SetUseFixDateTime(true); const oox::core::Relations rRels = getRelations(); @@ -268,6 +269,7 @@ void RevisionHeadersFragment::finalizeImport() importOoxFragment(xFragment, *xParser); } +pCT-SetUser(aSelfUser); // set the default user to the document owner. rDoc.SetChangeTrack(pCT.release()); // Turn on visibility of tracked changes. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/tool/token.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit ca8a6d4ff366f0ad7c2da6b76f76f624c593592f Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Tue Jul 29 22:33:56 2014 -0400 fdo#81330: When moving to a different sheet, set 3D flag on. Change-Id: I16c6e687259635c4d0ac0e5dab0140941b409bc8 (cherry picked from commit 5e55d5ffb70437e917e4092f4030d5a454fd20d6) Reviewed-on: https://gerrit.libreoffice.org/10637 Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index c289960..d392550 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -2827,6 +2827,8 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove( ScRange aOldRange = rCxt.maRange; aOldRange.Move(-rCxt.mnColDelta, -rCxt.mnRowDelta, -rCxt.mnTabDelta); +bool b3DFlag = rOldPos.Tab() != rNewPos.Tab(); + FormulaToken** p = pCode; FormulaToken** pEnd = p + static_castsize_t(nLen); for (; p != pEnd; ++p) @@ -2845,6 +2847,7 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove( } rRef.SetAddress(aAbs, rNewPos); +rRef.SetFlag3D(b3DFlag); } break; case svDoubleRef: @@ -2859,6 +2862,8 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove( } rRef.SetRange(aAbs, rNewPos); +if (b3DFlag) +rRef.Ref1.SetFlag3D(true); } break; case svIndex: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/undo/undobase.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit b50f1343fb51baf244761c424f3bb64be8125e42 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Tue Jul 29 17:19:28 2014 -0400 fdo#80846: Get the parameter order right. It's column, row, tab in this order, not tab, column row. Change-Id: I32e69a403feaf18532c7ac241fa2a98fc65a4ba7 (cherry picked from commit 1fcc30503549b47046c84333af542ed739f685ba) Reviewed-on: https://gerrit.libreoffice.org/10633 Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx index 6342910..bc7a5e3 100644 --- a/sc/source/ui/undo/undobase.cxx +++ b/sc/source/ui/undo/undobase.cxx @@ -170,7 +170,7 @@ public: if (!bVal) return; -ScRange aRange(mnCurTab, mnCurCol, nRow1, mnCurTab, mnCurCol, nRow2); +ScRange aRange(mnCurCol, nRow1, mnCurTab, mnCurCol, nRow2, mnCurTab); mrDoc.BroadcastCells(aRange, SC_HINT_DATACHANGED); }; }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/xml/xmlexprt.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 23e54b541892c0343e012b51c5722f8e3edc02ef Author: Eike Rathke er...@redhat.com Date: Mon Jul 21 19:10:12 2014 +0200 use SvXMLExport::GetRelativeReference(), fdo#79305 Change-Id: I1e92a87034cf31470a9d8809f3b543b154c65126 Reviewed-on: https://gerrit.libreoffice.org/10445 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 058e719..2e73236 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -3080,7 +3080,7 @@ void writeContent( // text:a xlink:href=url xlink:type=simplevalue/text:a OUString aURL = static_castconst SvxURLField*(pField)-GetURL(); -rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, aURL); +rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, rExport.GetRelativeReference(aURL)); rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, simple); OUString aElemName = rExport.GetNamespaceMap().GetQNameByKey( ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/dbgui/validate.cxx | 27 ++- sc/source/ui/inc/validate.hxx |2 ++ 2 files changed, 24 insertions(+), 5 deletions(-) New commits: commit c5b71635e523e3675a72acc4960a1cac6e16e3fd Author: Caolán McNamara caol...@redhat.com Date: Mon Jul 21 13:14:19 2014 +0100 Resolves: rhbz#1121341 crash on closing shrunk validity window Change-Id: I5fc1d6b909b3281ec3799b60bc3fd7b5f1163a75 Reviewed-on: https://gerrit.libreoffice.org/10439 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index f40981c..49e0bce 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -151,12 +151,14 @@ voidScTPValidationValue::RefInputDonePostHdl() } - sal_Bool ScValidationDlg::Close() { -if( m_bOwnRefHdlr ) -if( SfxTabPage* pPage = GetTabPage( TP_VALIDATION_VALUES ) ) -static_castScTPValidationValue*(pPage)-RemoveRefDlg(); +SfxTabPage* pPage = GetTabPage(TP_VALIDATION_VALUES); +if (pPage) +static_castScTPValidationValue*(pPage)-ParkRefs(); + +if (m_bOwnRefHdlr pPage) +static_castScTPValidationValue*(pPage)-RemoveRefDlg(); return ScValidationDlgBase::Close(); } @@ -168,7 +170,6 @@ ScValidationDlg::~ScValidationDlg() delete mpHBox; } - // namespace { @@ -338,6 +339,22 @@ ScTPValidationValue::ScTPValidationValue( Window* pParent, const SfxItemSet rAr m_btnRef.Hide(); // cell range picker } +void ScTPValidationValue::ParkRefs() +{ +//if there are children of the mpHBox, i.e. +//in shrunk mode, this will crash +//after the mpHBox is deleted +if( m_pRefEdit m_pRefEdit-GetParent()!= this ) +{ +m_pRefEdit-SetParent( this ); +} + +if( m_btnRef.GetParent()!=this ) +{ +m_btnRef.SetParent( this ); +} +} + ScTPValidationValue::~ScTPValidationValue() { } diff --git a/sc/source/ui/inc/validate.hxx b/sc/source/ui/inc/validate.hxx index 5cac401..12d1cec 100644 --- a/sc/source/ui/inc/validate.hxx +++ b/sc/source/ui/inc/validate.hxx @@ -182,6 +182,8 @@ public: virtual sal_BoolFillItemSet( SfxItemSet rArgSet ); virtual voidReset( const SfxItemSet rArgSet ); +voidParkRefs(); + private: voidInit(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/tool/chgtrack.cxx |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) New commits: commit 61aabb7d814b634e29003d8b555938f40b6f6fb4 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Wed Jul 16 19:00:51 2014 -0400 fdo#81445: Display correct label for empty cell. Change-Id: I4f3e99b2231f7cd87daa27ef2dc47d3bf37cea57 (cherry picked from commit 2202bda95c76127dffcc9c7460e462a877344b9c) Reviewed-on: https://gerrit.libreoffice.org/10361 Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index 87d0cdb..1ebb30d 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -1806,10 +1806,9 @@ void ScChangeActionContent::GetValueString( case CELLTYPE_FORMULA : GetFormulaString(rStr, rCell.mpFormula); break; +case CELLTYPE_NONE: default: -{ -// added to avoid warnings -} +rStr = OUString(); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/xcl97/XclExpChangeTrack.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit c7727b1c1682a1373668c898a2de1b1627a09d8c Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Thu Jul 17 15:52:52 2014 -0400 fdo#81470: Fix a crasher during xlsx export with revisions. Calling Undo() here removes revision entries which also removes formula cell instances stored in the entries. The problem is that the XclExpChTrCellContent instances store pointers to these formula instances for later use, and removing the entries at this location causes deleted formula instances to get accessed which in turn causes segfault. Since all revision entries get deleted when the temp change track instance gets deleted at the end of the revision export, not deleting the entries here will not cause memory leaks. Change-Id: I85f8064945a841b684e4fc4a97c3f9bb6a2de353 (cherry picked from commit 3bce16799c34d0b28704c43eae77501c0f6aec1e) Reviewed-on: https://gerrit.libreoffice.org/10371 Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx index 7033b3e..4589aea 100644 --- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx @@ -1443,7 +1443,6 @@ XclExpChangeTrack::XclExpChangeTrack( const XclExpRoot rRoot ) : { PushActionRecord( *pScAction ); const ScChangeAction* pPrevAction = pScAction-GetPrev(); -pTempChangeTrack-Undo( pScAction-GetActionNumber(), pScAction-GetActionNumber() ); pScAction = pPrevAction; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/table1.cxx | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) New commits: commit 0e4ec4059371826c1742206e2ff6509df19e2cd1 Author: Eike Rathke er...@redhat.com Date: Fri Jul 18 00:45:44 2014 +0200 resolved fdo#81294 store correct sheet number during range names update Change-Id: Ic4c858efa6e7c1a65357ac79f01e6c08f464ae3f (cherry picked from commit 4011b74eb7650a0eeb99d3acebb9ef60b0fcaab9) Reviewed-on: https://gerrit.libreoffice.org/10376 Reviewed-by: Kohei Yoshida libreoff...@kohei.us Tested-by: Kohei Yoshida libreoff...@kohei.us diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index e0eb3eb..834dfe1 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1603,6 +1603,12 @@ void ScTable::UpdateGrow( const ScRange rArea, SCCOL nGrowX, SCROW nGrowY ) void ScTable::UpdateInsertTab( sc::RefUpdateInsertTabContext rCxt ) { +// Store the old tab number in sc::UpdatedRangeNames for +// ScTokenArray::AdjustReferenceOnInsertedTab() to check with +// isNameModified() +if (mpRangeName) +mpRangeName-UpdateInsertTab(rCxt, nTab); + if (nTab = rCxt.mnInsertPos) { nTab += rCxt.mnSheets; @@ -1610,9 +1616,6 @@ void ScTable::UpdateInsertTab( sc::RefUpdateInsertTabContext rCxt ) pDBDataNoName-UpdateMoveTab(nTab - 1 ,nTab); } -if (mpRangeName) -mpRangeName-UpdateInsertTab(rCxt, nTab); - if (mpCondFormatList) mpCondFormatList-UpdateInsertTab(rCxt); @@ -1624,6 +1627,12 @@ void ScTable::UpdateInsertTab( sc::RefUpdateInsertTabContext rCxt ) void ScTable::UpdateDeleteTab( sc::RefUpdateDeleteTabContext rCxt ) { +// Store the old tab number in sc::UpdatedRangeNames for +// ScTokenArray::AdjustReferenceOnDeletedTab() to check with +// isNameModified() +if (mpRangeName) +mpRangeName-UpdateDeleteTab(rCxt, nTab); + if (nTab rCxt.mnDeletePos) { nTab -= rCxt.mnSheets; @@ -1631,9 +1640,6 @@ void ScTable::UpdateDeleteTab( sc::RefUpdateDeleteTabContext rCxt ) pDBDataNoName-UpdateMoveTab(nTab + 1,nTab); } -if (mpRangeName) -mpRangeName-UpdateDeleteTab(rCxt, nTab); - if (mpCondFormatList) mpCondFormatList-UpdateDeleteTab(rCxt); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/docshell/dbdocfun.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit f97d25b66e88742e4cb4011cc4cc0bc682c1ee1c Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Sat Jul 12 21:46:13 2014 -0400 fdo#80462: Don't always increment the start row position. Sometimes someone might attempt to sort only a single row. Change-Id: Ie29d4cf7ec0bd3a5c945997083368b6ef6074268 (cherry picked from commit 5902dcf0995cdd0a6c1dbd1f9c21b0b2b3f5609f) Reviewed-on: https://gerrit.libreoffice.org/10260 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 1e7cbdb..d9d5550 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -493,7 +493,9 @@ sal_Bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam rSortParam, WaitObject aWait( rDocShell.GetActiveDialogParent() ); -SCROW nStartRow = aLocalParam.nRow1 + (aLocalParam.bHasHeader ? 1 : 0); +SCROW nStartRow = aLocalParam.nRow1; +if (aLocalParam.bByRow aLocalParam.bHasHeader nStartRow aLocalParam.nRow2) +++nStartRow; // Calculate the script types for all cells in the sort range beforehand. // This will speed up the row height adjustment that takes place after the ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/tool/token.cxx | 17 + 1 file changed, 17 insertions(+) New commits: commit 92216be6ce13990b8ea6b6264c656d2bc1746401 Author: Eike Rathke er...@redhat.com Date: Fri Jul 11 23:15:50 2014 +0200 resolved fdo#77018 keep external references intact during sort Needs e463de2a56453a0d2cb0b5b58e96f7639f37cdd1 fix for fdo#79441 to work. Change-Id: Ide1cbeb4b25b17b5102977ccbdf8e6dbfcadfc60 (cherry picked from commit db0a4c2575ffba1c170d74882b0f5a6229ec072f) Reviewed-on: https://gerrit.libreoffice.org/10245 Reviewed-by: Kohei Yoshida libreoff...@kohei.us Tested-by: Kohei Yoshida libreoff...@kohei.us diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 8f51a72..ab47bee 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -531,6 +531,9 @@ bool ScToken::Is3DRef() const if ( GetSingleRef().IsFlag3D() ) return true; break; +case svExternalSingleRef: +case svExternalDoubleRef: +return true; default: { // added to avoid warnings @@ -2251,6 +2254,20 @@ void ScTokenArray::ReadjustRelative3DReferences( const ScAddress rOldPos, } } break; +case svExternalDoubleRef : +{ +ScSingleRefData rRef2 = static_castScToken*(pCode[j])-GetSingleRef2(); +ScAddress aAbs = rRef2.toAbs(rOldPos); +rRef2.SetAddress(aAbs, rNewPos); +} +//! fallthru +case svExternalSingleRef : +{ +ScSingleRefData rRef1 = static_castScToken*(pCode[j])-GetSingleRef(); +ScAddress aAbs = rRef1.toAbs(rOldPos); +rRef1.SetAddress(aAbs, rNewPos); +} +break; default: { // added to avoid warnings ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/tool/interpr1.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 50b9fe07f9851160e12922feb7d96d6f7ae5b52e Author: Eike Rathke er...@redhat.com Date: Thu Jul 10 16:13:40 2014 +0200 resolved fdo#80195 act on implicitly propagated error, if any Change-Id: I1d5a55a14fc3e25edc2cddec5b53ed2afa96bd3e (cherry picked from commit 1093b900b43d819c9a730ef6435fed0f3687a085) Reviewed-on: https://gerrit.libreoffice.org/10198 Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index a834488..a42dbad 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -255,6 +255,11 @@ void ScInterpreter::ScIfError( bool bNAonly ) { default: Pop(); +// Act on implicitly propagated error, if any. +if (nOldGlobalError) +nGlobalError = nOldGlobalError; +if (nGlobalError) +bError = true; break; case svError: PopError(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/xml/xmlcelli.cxx |6 ++ 1 file changed, 6 insertions(+) New commits: commit 4e69127246028f72eee6279e9a810bb865ce654c Author: Eike Rathke er...@redhat.com Date: Wed Jul 9 19:16:19 2014 +0200 resolved fdo#62250 absent value cell values are not NaN, set to 0.0 Change-Id: I41459d72adbaa8f6c0c7c22447f6eba5eb8be3e1 (cherry picked from commit fea6f83df8d2183b108695217bc4ff7a93e942c9) Reviewed-on: https://gerrit.libreoffice.org/10176 Reviewed-by: Kohei Yoshida libreoff...@kohei.us Tested-by: Kohei Yoshida libreoff...@kohei.us diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 41e6111..a3321c2 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -1151,6 +1151,12 @@ void ScXMLTableRowCellContext::PutValueCell( const ScAddress rCurrentPos ) } else //regular value cell { +// fdo#62250 absent values are not NaN, set to 0.0 +// PutValueCell() is called only for a known cell value type, +// bIsEmpty==false in all these cases, no sense to check it here. +if (::rtl::math::isNan( fValue)) +fValue = 0.0; + // #i62435# Initialize the value cell's script type if the default // style's number format is latin-only. If the cell uses a different // format, the script type will be reset when the style is applied. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/column2.cxx |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) New commits: commit 284c6681688f7075900d2351976c3611702411ce Author: Michael Meeks michael.me...@collabora.com Date: Sat Jul 5 22:13:44 2014 +0100 fdo#80813 - avoid FMR by re-fetch pattern after a potential re-calculation. Change-Id: Ib197f4cd74cd2c444a5f7c207fe2e5be14eea65d Reviewed-on: https://gerrit.libreoffice.org/10095 Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 18aee24..63c5e0f 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -131,11 +131,15 @@ long ScColumn::GetNeededSize( return 0; } -// conditional formatting +// conditional formatting const SfxItemSet* pCondSet = pDocument-GetCondResult( nCol, nRow, nTab ); -// line break? +// fdo#80813 - fetching conditional result (GetCondResult) above can cause +// a re-calculate which can delete and re-set the pattern we fetched. +if (!rOptions.pPattern) +pPattern = pAttrArray-GetPattern( nRow ); +// line break? const SfxPoolItem* pCondItem; SvxCellHorJustify eHorJust; if (pCondSet ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/view/drawview.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 2153e1febbb2ae2254df42d85d33590928b14f5a Author: Damien Chambe damien.cha...@gmail.com Date: Sun Jun 15 21:17:41 2014 +0200 Resolves fdo#76160 Calc invalid image position on zooming Change-Id: Idd268a3378a902c173dc4d75d879714c2e919b2d Reviewed-on: https://gerrit.libreoffice.org/9792 Reviewed-by: Kohei Yoshida libreoff...@kohei.us Tested-by: Kohei Yoshida libreoff...@kohei.us (cherry picked from commit b8d84a3bf59212a9652f76d7852c81191b8c8a3b) diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 18cd6fe..93f756e 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -321,7 +321,7 @@ void ScDrawView::RecalcScale() if (nEndCol20) nEndCol = 20; if (nEndRow20) -nEndRow = 1000; +nEndRow = 20; ScDrawUtil::CalcScale( pDoc, nTab, 0,0, nEndCol,nEndRow, pDev,aZoomX,aZoomY,nPPTX,nPPTY, aScaleX,aScaleY ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/oox/workbookhelper.cxx | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) New commits: commit de7e9c576d35d70392228126fa2970bdcaf07c01 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Wed Jun 25 16:38:52 2014 -0400 bnc#882595: Process VBA blobs before formula cells. So that formula cells with user-defined functions will be interpreted correctly. Change-Id: I49c10109575f9f82d7f85dea63590bf02b70e041 (cherry picked from commit 5e83804da815a982aed567a8cae4cc078491dcbd) Reviewed-on: https://gerrit.libreoffice.org/9912 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index fba445f..ca61154 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -760,6 +760,13 @@ void WorkbookHelper::finalizeWorkbookImport() mrBookGlob.getWorkbookSettings().finalizeImport(); mrBookGlob.getViewSettings().finalizeImport(); +// Import the VBA project (after finalizing workbook settings which +// contains the workbook code name). Do it before processing formulas in +// order to correctly resolve VBA custom function names. +StorageRef xVbaPrjStrg = mrBookGlob.getVbaProjectStorage(); +if( xVbaPrjStrg.get() xVbaPrjStrg-isStorage() ) +getBaseFilter().getVbaProject().importModulesAndForms( *xVbaPrjStrg, getBaseFilter().getGraphicHelper() ); + // need to import formulas before scenarios mrBookGlob.getFormulaBuffer().finalizeImport(); @@ -779,12 +786,6 @@ void WorkbookHelper::finalizeWorkbookImport() sheets. Automatic numbering is set by passing the value 0. */ PropertySet aDefPageStyle( getStyleObject( Default, true ) ); aDefPageStyle.setProperty sal_Int16 ( PROP_FirstPageNumber, 0 ); - -/* Import the VBA project (after finalizing workbook settings which -contains the workbook code name). */ -StorageRef xVbaPrjStrg = mrBookGlob.getVbaProjectStorage(); -if( xVbaPrjStrg.get() xVbaPrjStrg-isStorage() ) -getBaseFilter().getVbaProject().importModulesAndForms( *xVbaPrjStrg, getBaseFilter().getGraphicHelper() ); } // document model - ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/namedlg/namedefdlg.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 5767cac0c1647908e091724df2de246d9caca3b4 Author: Markus Mohrhard markus.mohrh...@collabora.co.uk Date: Tue Jun 10 18:13:46 2014 +0200 document must be set modified when range name is defined, fdo#79451 Change-Id: I382bef9b95d40a1abac993795e8da540b5aa5d18 (cherry picked from commit 1c8babfdb0808318bbaa94e911c819456a65337e) Reviewed-on: https://gerrit.libreoffice.org/9804 Reviewed-by: Muthu Subramanian K muthus...@gmail.com Reviewed-by: Andras Timar andras.ti...@collabora.com Tested-by: Andras Timar andras.ti...@collabora.com diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx index 62e13fd..c97605d 100644 --- a/sc/source/ui/namedlg/namedefdlg.cxx +++ b/sc/source/ui/namedlg/namedefdlg.cxx @@ -243,6 +243,7 @@ void ScNameDefDlg::AddPushed() if (nTab != -1) mpDoc-SetStreamValid(nTab, false); SFX_APP()-Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) ); +mpDocShell-SetDocumentModified(); Close(); } else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/column2.cxx | 12 1 file changed, 12 insertions(+) New commits: commit 90132a32f8bc2e27c097d79c0cc1ddd7cae35da6 Author: Matúš Kukan matus.ku...@collabora.com Date: Mon Jun 9 22:43:01 2014 +0200 fdo#76324: Make pasting a lot of cell notes faster by disabling broadcasting. Change-Id: If76e80af8dcecf70e4ea624a7f538023c48a5108 (cherry picked from commit e7a3aacff7d28577dee371ed5b27317522db7b3b) Reviewed-on: https://gerrit.libreoffice.org/9710 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 3fdbc52..18aee24 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -22,6 +22,7 @@ #include formulacell.hxx #include document.hxx #include docpool.hxx +#include drwlayer.hxx #include attarray.hxx #include patattr.hxx #include cellform.hxx @@ -1834,8 +1835,19 @@ public: void ScColumn::CopyCellNotesToDocument( SCROW nRow1, SCROW nRow2, ScColumn rDestCol, bool bCloneCaption, SCROW nRowOffsetDest ) const { +ScDrawLayer *pDrawLayer = rDestCol.GetDoc().GetDrawLayer(); +bool bWasLocked; +if (pDrawLayer) +{ +// Avoid O(n^2) by temporary locking SdrModel which disables broadcasting. +// Each cell note adds undo listener, and all of them would be woken up in ScPostIt::CreateCaption. +bWasLocked = pDrawLayer-isLocked(); +pDrawLayer-setLock(true); +} CopyCellNotesHandler aFunc(*this, rDestCol, nRowOffsetDest, bCloneCaption); sc::ParseNote(maCellNotes.begin(), maCellNotes, nRow1, nRow2, aFunc); +if (pDrawLayer) +pDrawLayer-setLock(bWasLocked); } void ScColumn::DuplicateNotes(SCROW nStartRow, size_t nDataSize, ScColumn rDestCol, sc::ColumnBlockPosition maDestBlockPos, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/excel/xecontent.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 27f4335d431f8274a625424114d33d3134ad213e Author: Markus Mohrhard markus.mohrh...@collabora.co.uk Date: Sun Jun 8 06:13:40 2014 +0200 check for empty string before accessing first element E.g. fdo#64530-1.xlsx Change-Id: Iff2d026f6e876ab76c9b89b8200413d6c3a7a0e3 Reviewed-on: https://gerrit.libreoffice.org/9717 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 7ebf959..bb31056 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -410,7 +410,7 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot rRoot, const SvxURLField rU msTarget = XclXmlUtils::ToOUString( aUrl ); } -else if( rUrl[0] == '#' ) // hack for #89066# +else if( !rUrl.isEmpty() rUrl[0] == '#' ) // hack for #89066# { OUString aTextMark( rUrl.copy( 1 ) ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/excel/excrecds.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 1e6e5d3c1df1291500852c340855b9c386418f3f Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Tue Jun 10 06:30:09 2014 +0200 fix invalid memory access related to temporary object e.g. export of ooo116460-2.xlsx Change-Id: Id1ca2249e7b1f197a2df0d122c57dd97c4c4d785 Reviewed-on: https://gerrit.libreoffice.org/9719 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index 614a70a..847e61d 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -894,7 +894,8 @@ void XclExpAutofilter::SaveXml( XclExpXmlStream rStrm ) std::vectorOUString::const_iterator itr = maMultiValues.begin(), itrEnd = maMultiValues.end(); for (; itr != itrEnd; ++itr) { -const char* pz = OUStringToOString(*itr, RTL_TEXTENCODING_UTF8).getStr(); +OString aStr = OUStringToOString(*itr, RTL_TEXTENCODING_UTF8); +const char* pz = aStr.getStr(); rWorksheet-singleElement(XML_filter, XML_val, pz, FSEND); } rWorksheet-endElement(XML_filters); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/xml/xmldpimp.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 070f85e97c3f288791f92534ee40011cbe6b7c7e Author: Markus Mohrhard markus.mohrh...@collabora.co.uk Date: Wed Jun 4 04:09:34 2014 +0200 fix new[]/delete mismatch As seen by ooo90105-1.ods with memcheck Conflicts: sc/source/filter/xml/xmldpimp.cxx Change-Id: Ib976632aa52556132b3d05ebb33e8fb64d8d9890 Reviewed-on: https://gerrit.libreoffice.org/9716 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx index 6ec52ef..d9d0ebb 100644 --- a/sc/source/filter/xml/xmldpimp.cxx +++ b/sc/source/filter/xml/xmldpimp.cxx @@ -1470,6 +1470,7 @@ ScXMLDataPilotSubTotalsContext::ScXMLDataPilotSubTotalsContext( ScXMLImport rIm ScXMLDataPilotSubTotalsContext::~ScXMLDataPilotSubTotalsContext() { +delete[] pFunctions; } SvXMLImportContext *ScXMLDataPilotSubTotalsContext::CreateChildContext( sal_uInt16 nPrefix, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/inc/pivotcachebuffer.hxx |2 +- sc/source/filter/oox/pivotcachebuffer.cxx |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit 00265e96b3c1c5f865bb7cde2f4e260aa0668026 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Tue Jun 10 06:12:32 2014 +0200 don't use temporary object This avoids invalid memory access with fdo45268-1.xlsx Change-Id: If141df14d7d747023c944c83c2d8957abe8b95ad Reviewed-on: https://gerrit.libreoffice.org/9718 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/filter/inc/pivotcachebuffer.hxx b/sc/source/filter/inc/pivotcachebuffer.hxx index 484e25f..d1ab42e 100644 --- a/sc/source/filter/inc/pivotcachebuffer.hxx +++ b/sc/source/filter/inc/pivotcachebuffer.hxx @@ -289,7 +289,7 @@ public: /** Returns the names of all shared or group items. */ voidgetCacheItemNames( ::std::vector OUString orItemNames ) const; /** Returns shared or group items. */ -PivotCacheItemList getCacheItems() const; +const PivotCacheItemList getCacheItems() const; /** Creates inplace numeric grouping settings. */ voidconvertNumericGrouping( diff --git a/sc/source/filter/oox/pivotcachebuffer.cxx b/sc/source/filter/oox/pivotcachebuffer.cxx index 8b3c155..d2cfdb6 100644 --- a/sc/source/filter/oox/pivotcachebuffer.cxx +++ b/sc/source/filter/oox/pivotcachebuffer.cxx @@ -769,7 +769,7 @@ void PivotCacheField::getCacheItemNames( ::std::vector OUString orItemNames maSharedItems.getCacheItemNames( orItemNames ); } -PivotCacheItemList PivotCacheField::getCacheItems() const +const PivotCacheItemList PivotCacheField::getCacheItems() const { if( hasGroupItems() ) return maGroupItems; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/inc/interpre.hxx | 48 ++ sc/source/core/tool/interpr1.cxx | 54 +-- 2 files changed, 78 insertions(+), 24 deletions(-) New commits: commit 9e49e49709935d594fa49cbccc4ffbcb4e90400f Author: Eike Rathke er...@redhat.com Date: Thu Jun 5 16:34:08 2014 +0200 unify the handling of string position arguments, fdo#75971 related Only two text functions had the full set of checks as introduced by the fix for fdo#75971. Let all text functions check their arguments in the same way. Additionally this will ease a transition to accept string lengths 64k in spreadsheet functions as now we have only one place that checks for SAL_MAX_UINT16 instead of having that scattered all over the place. (cherry picked from commit 14ce27cc045bd9bcbbfa3eac56cd99f2be08de1f) Conflicts: sc/source/core/tool/interpr1.cxx Change-Id: I454e617a59d0b3c2ca725047e7f8c7370bc0bb1f Reviewed-on: https://gerrit.libreoffice.org/9657 Tested-by: David Tardon dtar...@redhat.com Reviewed-by: David Tardon dtar...@redhat.com diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx index cc67580..aa2dd73 100644 --- a/sc/source/core/inc/interpre.hxx +++ b/sc/source/core/inc/interpre.hxx @@ -365,6 +365,24 @@ void ScErrCell(); // special handling for void SetMaxIterationCount(sal_uInt16 n); inline void CurFmtToFuncFmt() { nFuncFmtType = nCurFmtType; nFuncFmtIndex = nCurFmtIndex; } + +/** Check if a double is suitable as string position or length argument. + +If fVal is Inf or NaN it is changed to -1, if it is less than 0 it is +sanitized to 0, if it is greater than some implementation defined max +string length it is sanitized to that max. + +@return TRUE if double value fVal is suitable as string argument and was +not sanitized. +FALSE if not and fVal was adapted. + */ +inline bool CheckStringPositionArgument( double fVal ); + +/** Obtain a double suitable as string position or length argument. +Returns -1 if the number is Inf or NaN or less than 0 or greater than some +implementation defined max string length. */ +inline double GetStringPositionArgument(); + // Check for String overflow of rResult+rAdd and set error and erase rResult // if so. Return true if ok, false if overflow inline bool CheckStringResultLen( OUString rResult, const OUString rAdd ); @@ -900,6 +918,36 @@ inline bool ScInterpreter::MustHaveParamCountMin( short nAct, short nMin ) return false; } +inline bool ScInterpreter::CheckStringPositionArgument( double fVal ) +{ +if (!rtl::math::isFinite( fVal)) +{ +fVal = -1.0; +return false; +} +else if (fVal 0.0) +{ +fVal = 0.0; +return false; +} +else if (fVal SAL_MAX_UINT16) +{ +fVal = static_castdouble(SAL_MAX_UINT16); +return false; +} +return true; +} + +inline double ScInterpreter::GetStringPositionArgument() +{ +double fVal = rtl::math::approxFloor( GetDouble()); +if (!CheckStringPositionArgument( fVal)) +{ +fVal = -1.0; +} +return fVal; +} + inline bool ScInterpreter::CheckStringResultLen( OUString rResult, const OUString rAdd ) { if ( (sal_uLong) rResult.getLength() + rAdd.getLength() STRING_MAXLEN ) diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index c4e6c56..758ce15 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -7673,11 +7673,10 @@ void ScInterpreter::ScReplace() if ( MustHaveParamCount( GetByte(), 4 ) ) { OUString aNewStr = GetString().getString(); -double fCount = ::rtl::math::approxFloor( GetDouble()); -double fPos = ::rtl::math::approxFloor( GetDouble()); +double fCount = GetStringPositionArgument(); +double fPos = GetStringPositionArgument(); OUString aOldStr = GetString().getString(); -if (fPos 1.0 || fPos static_castdouble(STRING_MAXLEN) -|| fCount 0.0 || fCount static_castdouble(STRING_MAXLEN)) +if (fPos 1.0 || fCount 0.0) PushIllegalArgument(); else { @@ -7800,8 +7799,8 @@ void ScInterpreter::ScLeft() sal_Int32 n; if (nParamCount == 2) { -double nVal = ::rtl::math::approxFloor(GetDouble()); -if ( rtl::math::isNan(nVal) || nVal 0.0 || nVal STRING_MAXLEN ) +double nVal = GetStringPositionArgument(); +if (nVal 0.0) { PushIllegalArgument(); return ; @@ -7908,8 +7907,8 @@ void ScInterpreter::ScRightB() sal_Int32 n; if (nParamCount == 2) { -double nVal = ::rtl::math::approxFloor(GetDouble()); -if ( rtl::math::isNan(nVal) || nVal 0.0 ||
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/condformat/condformatdlg.cxx | 10 ++ sc/source/ui/inc/condformatdlg.hxx|1 + 2 files changed, 11 insertions(+) New commits: commit 460d2ffa8dd461f41f1fc77596ee0578e8ea6731 Author: Caolán McNamara caol...@redhat.com Date: Thu Jun 5 16:41:02 2014 +0100 Resolves: fdo#79021 cannot delete ListBox from inside its own Select handler Change-Id: I884e617b112397697a702216b62d0c1e17aae536 (cherry picked from commit b0a9f33a9b3018dcfb471641bde7c29a6e62f394) (cherry picked from commit 268c4907a04959ca546c5e2ecf469d4d297293b9) Reviewed-on: https://gerrit.libreoffice.org/9656 Tested-by: David Tardon dtar...@redhat.com Reviewed-by: David Tardon dtar...@redhat.com diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 907c1b6..2f5e6f8 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -235,6 +235,16 @@ IMPL_LINK(ScCondFormatList, ColFormatTypeHdl, ListBox*, pBox) IMPL_LINK(ScCondFormatList, TypeListHdl, ListBox*, pBox) { +//Resolves: fdo#79021 At this point we are still inside the ListBox Select. +//If we call maEntries.replace here then the pBox will be deleted before it +//has finished Select and will crash on accessing its deleted this. So Post +//to do the real work after the Select has completed +Application::PostUserEvent(LINK(this, ScCondFormatList, AfterTypeListHdl), pBox); +return 0; +} + +IMPL_LINK(ScCondFormatList, AfterTypeListHdl, ListBox*, pBox) +{ EntryContainer::iterator itr = maEntries.begin(); for(; itr != maEntries.end(); ++itr) { diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx index 6baf33d..721397a 100644 --- a/sc/source/ui/inc/condformatdlg.hxx +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -79,6 +79,7 @@ public: DECL_LINK( EntrySelectHdl, ScCondFrmtEntry* ); DECL_LINK( TypeListHdl, ListBox*); +DECL_LINK( AfterTypeListHdl, ListBox*); DECL_LINK( ColFormatTypeHdl, ListBox*); }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx |2 sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx|7 ++- sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx |2 sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx |2 sc/source/ui/StatisticsDialogs/MovingAverageDialog.cxx|2 sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx | 22 +- sc/source/ui/inc/TableFillingAndNavigationTools.hxx | 14 +++--- 7 files changed, 27 insertions(+), 24 deletions(-) New commits: commit bdf33526442f4a601e6d2a80a4ec3c690b12c3fa Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Fri May 30 14:47:49 2014 -0400 fdo#79174: Use 3D address when the input and output are on different sheets. Also some cleanup, mostly to avoid storing separate address convention object, which is not really necessary. (cherry picked from commit 0ab538885d818a7b3706df48a625e2523a8ebbdf) Conflicts: sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx sc/source/ui/StatisticsDialogs/FTestDialog.cxx sc/source/ui/StatisticsDialogs/TTestDialog.cxx sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx sc/source/ui/inc/TableFillingAndNavigationTools.hxx Change-Id: Id3e104043f08b6786de2e91d69361557b83890f9 Reviewed-on: https://gerrit.libreoffice.org/9578 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx index 0dc9971..920ca3c 100644 --- a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx @@ -106,7 +106,7 @@ ScRange ScAnalysisOfVarianceDialog::ApplyOutput(ScDocShell* pDocShell) { AddressWalkerWriter output(mOutputAddress, pDocShell, mDocument, formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); -FormulaTemplate aTemplate(mDocument, mAddressDetails); +FormulaTemplate aTemplate(mDocument); output.writeBoldString(SC_STRLOAD(RID_STATISTICS_DLGS, STR_ANOVA_SINGLE_FACTOR_LABEL)); output.nextRow(); diff --git a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx index 1687773..e81d06b 100644 --- a/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/DescriptiveStatisticsDialog.cxx @@ -85,7 +85,7 @@ ScRange ScDescriptiveStatisticsDialog::ApplyOutput(ScDocShell* pDocShell) { AddressWalkerWriter aOutput(mOutputAddress, pDocShell, mDocument, formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); -FormulaTemplate aTemplate(mDocument, mAddressDetails); +FormulaTemplate aTemplate(mDocument); boost::scoped_ptrDataRangeIterator pIterator; if (mGroupedBy == BY_COLUMN) @@ -95,6 +95,9 @@ ScRange ScDescriptiveStatisticsDialog::ApplyOutput(ScDocShell* pDocShell) aOutput.nextColumn(); +// Use explicit sheet name in case the input and output are on different sheets. +bool b3DAddress = mInputRange.aStart.Tab() != mOutputAddress.Tab(); + // Write column/row labels for( ; pIterator-hasNext(); pIterator-next() ) { @@ -129,7 +132,7 @@ ScRange ScDescriptiveStatisticsDialog::ApplyOutput(ScDocShell* pDocShell) for(sal_Int32 i = 0; lclCalcDefinitions[i].aFormula != NULL; i++) { aTemplate.setTemplate(lclCalcDefinitions[i].aFormula); -aTemplate.applyRange(strWildcardRange, pIterator-get()); +aTemplate.applyRange(strWildcardRange, pIterator-get(), b3DAddress); aOutput.writeFormula(aTemplate.getTemplate()); aOutput.nextRow(); } diff --git a/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx b/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx index 6b20afd..37eadfb 100644 --- a/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/ExponentialSmoothingDialog.cxx @@ -54,7 +54,7 @@ ScRange ScExponentialSmoothingDialog::ApplyOutput(ScDocShell* pDocShell) { AddressWalkerWriter output(mOutputAddress, pDocShell, mDocument, formula::FormulaGrammar::mergeToGrammar( formula::FormulaGrammar::GRAM_ENGLISH, mAddressDetails.eConv)); -FormulaTemplate aTemplate(mDocument, mAddressDetails); +FormulaTemplate aTemplate(mDocument); // Smoothing factor double aSmoothingFactor = mpSmoothingFactor-GetValue() / 100.0; diff --git a/sc/source/ui/StatisticsDialogs/MatrixComparisonGenerator.cxx
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/xml/xmlexprt.cxx | 40 -- 1 file changed, 26 insertions(+), 14 deletions(-) New commits: commit 282227a81df90dfe11f0b57a4d7558d7faa56836 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Fri May 30 22:02:01 2014 -0400 fdo#78927: Use different XML attribute names for asian and complex fonts. Change-Id: I96a26bd495d6a78fffd0854b5084f69b5db84ee6 (cherry picked from commit 1b35c7ea4f7fe1473dbe08ab93b7259403b290ff) Reviewed-on: https://gerrit.libreoffice.org/9588 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 885b5bc..058e719 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -1075,6 +1075,27 @@ void ScXMLExport::ExportExternalRefCacheStyles() namespace { +void handleFont( +std::vectorXMLPropertyState rPropStates, +const SfxPoolItem* p, const UniReferenceXMLPropertySetMapper xMapper, const OUString rXMLName ) +{ +sal_Int32 nEntryCount = xMapper-GetEntryCount(); + +// Apparently font info needs special handling. +const SvxFontItem* pItem = static_castconst SvxFontItem*(p); + +sal_Int32 nIndexFontName = xMapper-GetEntryIndex(XML_NAMESPACE_STYLE, rXMLName, 0); + +if (nIndexFontName == -1 || nIndexFontName = nEntryCount) +return; + +uno::Any aAny; +if (!pItem-QueryValue(aAny, MID_FONT_FAMILY_NAME)) +return; + +rPropStates.push_back(XMLPropertyState(nIndexFontName, aAny)); +} + const SvxFieldData* toXMLPropertyStates( std::vectorXMLPropertyState rPropStates, const std::vectorconst SfxPoolItem* rSecAttrs, const UniReferenceXMLPropertySetMapper xMapper, const ScXMLEditAttributeMap rAttrMap ) @@ -1106,22 +1127,13 @@ const SvxFieldData* toXMLPropertyStates( switch (p-Which()) { case EE_CHAR_FONTINFO: +handleFont(rPropStates, p, xMapper, font-name); +break; case EE_CHAR_FONTINFO_CJK: +handleFont(rPropStates, p, xMapper, font-name-asian); +break; case EE_CHAR_FONTINFO_CTL: -{ -// Apparently font info needs special handling. -const SvxFontItem* pItem = static_castconst SvxFontItem*(p); - -sal_Int32 nIndexFontName = xMapper-GetEntryIndex(XML_NAMESPACE_STYLE, font-name, 0); - -if (nIndexFontName == -1 || nIndexFontName = nEntryCount) -break; - -if (!pItem-QueryValue(aAny, MID_FONT_FAMILY_NAME)) -break; - -rPropStates.push_back(XMLPropertyState(nIndexFontName, aAny)); -} +handleFont(rPropStates, p, xMapper, font-name-complex); break; case EE_CHAR_WEIGHT: case EE_CHAR_WEIGHT_CJK: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/tool/address.cxx | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) New commits: commit 37d985d098cc44798ccaeba78bf6795409a5b5c1 Author: Eike Rathke er...@redhat.com Date: Tue May 27 23:19:36 2014 +0200 resolved fdo#70455 B1:SOMENAME is not a valid singleton reference (cherry picked from commit ac8532ce26e79453b3a969b956ebb7823c455131) Conflicts: sc/source/core/tool/address.cxx Change-Id: Iac80d74a9ec6382a232fdc2f4b798e57dc643ad3 Reviewed-on: https://gerrit.libreoffice.org/9515 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 3ed6213..23bca38 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -876,6 +876,14 @@ lcl_a1_get_row( const sal_Unicode* p, ScAddress* pAddr, sal_uInt16* nFlags ) return pEnd; } +/// B:B or 2:2, but not B:2 or 2:B or B2:B or B:B2 or ... +static bool isValidSingleton( sal_uInt16 nFlags, sal_uInt16 nFlags2 ) +{ +bool bCols = (nFlags SCA_VALID_COL) ((nFlags SCA_VALID_COL2) || (nFlags2 SCA_VALID_COL)); +bool bRows = (nFlags SCA_VALID_ROW) ((nFlags SCA_VALID_ROW2) || (nFlags2 SCA_VALID_ROW)); +return (bCols !bRows) || (!bCols bRows); +} + static sal_uInt16 lcl_ScRange_Parse_XL_A1( ScRange r, const sal_Unicode* p, @@ -982,7 +990,7 @@ lcl_ScRange_Parse_XL_A1( ScRange r, } p = tmp2; -p = lcl_eatWhiteSpace( p+1 ); +p = lcl_eatWhiteSpace( p+1 ); // after ':' tmp1 = lcl_a1_get_col( p, r.aEnd, nFlags2 ); if( !tmp1 aEndTabName.isEmpty() ) // Probably the aEndTabName was specified after the first range { @@ -995,16 +1003,17 @@ lcl_ScRange_Parse_XL_A1( ScRange r, r.aEnd.SetTab( nTab ); nFlags |= SCA_VALID_TAB2 | SCA_TAB2_3D | SCA_TAB2_ABSOLUTE; } -p = lcl_eatWhiteSpace( p+1 ); +if (*p == '!' || *p == ':') +p = lcl_eatWhiteSpace( p+1 ); tmp1 = lcl_a1_get_col( p, r.aEnd, nFlags2 ); } } -if( !tmp1 ) // strange, but valid singleton -return nFlags; +if( !tmp1 ) // strange, but maybe valid singleton +return isValidSingleton( nFlags, nFlags2) ? nFlags : (nFlags ~SCA_VALID); tmp2 = lcl_a1_get_row( tmp1, r.aEnd, nFlags2 ); -if( !tmp2 ) // strange, but valid singleton -return nFlags; +if( !tmp2 ) // strange, but maybe valid singleton +return isValidSingleton( nFlags, nFlags2) ? nFlags : (nFlags ~SCA_VALID); if ( *tmp2 != 0 ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/column3.cxx | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) New commits: commit 456e2353ef9ae4e1034d078e026187ce5382c54a Author: Caolán McNamara caol...@redhat.com Date: Thu May 29 10:45:39 2014 +0100 Resolves: fdo#79392 don't access after last row, when last row is max last row Change-Id: I06749af90bed6a43f3fb6b3b5ceb61d5fbbc7c02 (cherry picked from commit a35d92197d850527bd294eb6197b5bf83109d5be) Reviewed-on: https://gerrit.libreoffice.org/9546 Reviewed-by: Kohei Yoshida libreoff...@kohei.us Tested-by: Kohei Yoshida libreoff...@kohei.us diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index c7b157e..c311e37 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -236,19 +236,22 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize ) // Check if there are any cells below the end row that will get shifted. bool bShiftCells = false; -aPos = maCells.position(itCell, nEndRow+1); -itCell = aPos.first; -if (itCell-type == sc::element_type_empty) +if (nEndRow MAXROWCOUNT-1) //only makes sense to do this if there *is* a row after the end row { -// This block is empty. See if there is any block that follows. -sc::CellStoreType::iterator itTest = itCell; -++itTest; -if (itTest != maCells.end()) -// Non-empty block follows - cells that will get shifted. +aPos = maCells.position(itCell, nEndRow+1); +itCell = aPos.first; +if (itCell-type == sc::element_type_empty) +{ +// This block is empty. See if there is any block that follows. +sc::CellStoreType::iterator itTest = itCell; +++itTest; +if (itTest != maCells.end()) +// Non-empty block follows - cells that will get shifted. +bShiftCells = true; +} +else bShiftCells = true; } -else -bShiftCells = true; sc::SingleColumnSpanSet aNonEmptySpans; if (bShiftCells) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/formulacell.cxx | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) New commits: commit 68be0e5efb59946edc9a537ef0283f9b720b7cdd Author: Eike Rathke er...@redhat.com Date: Tue May 27 19:28:36 2014 +0200 do not replace a General format with a General format Found when investigating fdo#79228 which was caused by the ScPatternAttr change due to the number format being applied. Change-Id: Ieada557f5e194401a9ce255f26d71d36e0704f35 (cherry picked from commit f68eed1518fe689fe8a535bebc8d2b6c9f257b9c) Reviewed-on: https://gerrit.libreoffice.org/9511 Tested-by: Kohei Yoshida libreoff...@kohei.us Reviewed-by: Kohei Yoshida libreoff...@kohei.us diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 3f3b18b..d4324a3 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -1672,10 +1672,21 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) nFormatIndex = ScGlobal::GetStandardFormat(*pDocument-GetFormatTable(), nFormatIndex, nFormatType); -// set number format explicitly -pDocument-SetNumberFormat( aPos, nFormatIndex ); +// Do not replace a General format (which was the reason why +// mbNeedsNumberFormat was set) with a General format. +// 1. setting a format has quite some overhead in the +// ScPatternAttr/ScAttrArray handling, even if identical. +// 2. the General formats may be of different locales. +// XXX if mbNeedsNumberFormat was set even if the current format +// was not General then we'd have to obtain the current format here +// and check at least the types. +if ((nFormatIndex % SV_COUNTRY_LANGUAGE_OFFSET) != 0) +{ +// set number format explicitly +pDocument-SetNumberFormat( aPos, nFormatIndex ); +bChanged = true; +} -bChanged = true; mbNeedsNumberFormat = false; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/column.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 20857b5d7536b3fcafa16ca6527ba459032933d7 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Tue May 27 14:47:24 2014 -0400 fdo#78976: Correct way to determine the end position for matrix check. Change-Id: Ifd6acd85a9bf33742cb62327a3b8a4320f35d0f3 (cherry picked from commit 054213e86b8f3b1084474b0447cc7ffaf82178c5) Reviewed-on: https://gerrit.libreoffice.org/9512 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 9835a6d..5e5cf43 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -152,7 +152,7 @@ sal_uInt16 ScColumn::GetBlockMatrixEdges( SCROW nRow1, SCROW nRow2, sal_uInt16 n } size_t nRowsToRead = nRow2 - nRow + 1; -size_t nEnd = std::min(it-size, nRowsToRead); +size_t nEnd = std::min(it-size, nOffset+nRowsToRead); // last row + 1 sc::formula_block::const_iterator itCell = sc::formula_block::begin(*it-data); std::advance(itCell, nOffset); for (size_t i = nOffset; i nEnd; ++itCell, ++i) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/document.cxx |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) New commits: commit b256135f1fe5a31735352ec2795e580b5a12fb09 Author: Eike Rathke er...@redhat.com Date: Tue May 27 12:31:30 2014 +0200 resolved rhbz#1101224 do not attempt to obtain names for NULL tabs This happened when the HTML export via clipboard tried to resolve conditional formats, where we have a temporary instance of a document containing only the sheet to be exported. Change-Id: Ic7498a1cab3eabede74773868287a2cc3edef052 (cherry picked from commit 17979abf4fde202cae231be19a218be3fe27d04c) Reviewed-on: https://gerrit.libreoffice.org/9506 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 47164be..2ec7d68 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -259,9 +259,14 @@ std::vectorOUString ScDocument::GetAllTableNames() const TableContainer::const_iterator it = maTabs.begin(), itEnd = maTabs.end(); for (; it != itEnd; ++it) { +// Positions need to be preserved for ScCompiler and address convention +// context, so still push an empty string for NULL tabs. OUString aName; -const ScTable rTab = **it; -rTab.GetName(aName); +if (*it) +{ +const ScTable rTab = **it; +rTab.GetName(aName); +} aNames.push_back(aName); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/dpgroup.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit dd2013f9d2926e65baeb1ba681f29ebc1286d8aa Author: Caolán McNamara caol...@redhat.com Date: Wed May 28 16:19:36 2014 +0100 coverity#1078626 Missing break in switch Change-Id: I4b9b846049d9802a319b403e1f45734b7bd604f2 (cherry picked from commit 4e3e1420af51f7776dceb6b2800b761e57ddfe63) Reviewed-on: https://gerrit.libreoffice.org/9529 Tested-by: Kohei Yoshida libreoff...@kohei.us Reviewed-by: Kohei Yoshida libreoff...@kohei.us diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx index e5da799..2936939 100644 --- a/sc/source/core/data/dpgroup.cxx +++ b/sc/source/core/data/dpgroup.cxx @@ -287,7 +287,7 @@ bool isDateInGroup(const ScDPItemData rGroupItem, const ScDPItemData rChildIte if (nGroupPart == com::sun::star::sheet::DataPilotFieldGroupBy::QUARTERS) // months and quarters are both 1-based return (nGroupValue - 1 == (nChildValue - 1) / 3); - +break; case com::sun::star::sheet::DataPilotFieldGroupBy::DAYS: // a day is only contained in its quarter or month if (nGroupPart == com::sun::star::sheet::DataPilotFieldGroupBy::MONTHS || ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/column3.cxx | 22 -- 1 file changed, 22 deletions(-) New commits: commit 9d8f8074edbb63db467cc451c0596585e2f0422c Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Thu May 22 20:56:04 2014 -0400 fdo#78903: Don't broadcast prematurely during cell deletion. We need to wait until all the affected cells get marked dirty at the end of the deletion process. Change-Id: I49618fcc386ec2209f5f0267d50257ecb8dd21d1 (cherry picked from commit cb167ac784f9b16944da4494b65e56b2a5b66bb7) Reviewed-on: https://gerrit.libreoffice.org/9443 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index cbb38d7..c7b157e 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -169,11 +169,6 @@ public: maRows.push_back(i + nTopRow); } -void endFormulas() -{ -mrDoc.EndListeningFormulaCells(maFormulaCells); -} - const std::vectorSCROW getNonEmptyRows() const { return maRows; @@ -266,12 +261,6 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize ) sc::AutoCalcSwitch aACSwitch(*pDocument, false); -// Parse all non-empty cells in the range to pick up their row positions, -// and end all formula cells. -DeleteRowsHandler aDeleteRowsFunc(*pDocument); -sc::ProcessFormula(itCell, maCells, nStartRow, nEndRow, aDeleteRowsFunc, aDeleteRowsFunc); -aDeleteRowsFunc.endFormulas(); - // Remove the cells. maCells.erase(nStartRow, nEndRow); maCells.resize(MAXROWCOUNT); @@ -285,22 +274,11 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize ) sc::SharedFormulaUtil::joinFormulaCellAbove(aPos); -// Single cell broadcasts on deleted cells. -BroadcastCells(aDeleteRowsFunc.getNonEmptyRows(), SC_HINT_DATACHANGED); - // Shift the text attribute array too (before the broadcast). maCellTextAttrs.erase(nStartRow, nEndRow); maCellTextAttrs.resize(MAXROWCOUNT); CellStorageModified(); - -if (!bShiftCells) -return; - -// Do area broadcast on the old non-empty cell ranges prior to the shift. -sc::SingleColumnSpanSet::SpansType aSpans; -aNonEmptySpans.getSpans(aSpans); -std::for_each(aSpans.begin(), aSpans.end(), RangeBroadcaster(*pDocument, nTab, nCol)); } sc::CellStoreType::iterator ScColumn::GetPositionToInsert( SCROW nRow ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/dialogs/searchresults.cxx | 40 ++--- 1 file changed, 27 insertions(+), 13 deletions(-) New commits: commit 860e8915ff22b610985845b88f5293629f24250a Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Fri May 23 12:54:20 2014 -0400 fdo#76824: Proper way to parse cell address strings. Be aware of the variable address convention. Change-Id: I37ca38758f055e7799cadefafda61174ea3cbf9c (cherry picked from commit 653e4adddfc80aeb91c1d21c18e95b3986c85c54) Reviewed-on: https://gerrit.libreoffice.org/9454 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/ui/dialogs/searchresults.cxx b/sc/source/ui/dialogs/searchresults.cxx index 1f8ee01..2de6ab6 100644 --- a/sc/source/ui/dialogs/searchresults.cxx +++ b/sc/source/ui/dialogs/searchresults.cxx @@ -47,16 +47,20 @@ void SearchResultsDlg::FillResults( ScDocument* pDoc, const ScRangeList rMatche { mpList-Clear(); mpList-SetUpdateMode(false); +std::vectorOUString aTabNames = pDoc-GetAllTableNames(); +SCTAB nTabCount = aTabNames.size(); for (size_t i = 0, n = rMatchedRanges.size(); i n; ++i) { ScCellIterator aIter(pDoc, *rMatchedRanges[i]); for (bool bHas = aIter.first(); bHas; bHas = aIter.next()) { -ScAddress aAddress = aIter.GetPos(); -OUString sAddress; -ScRangeStringConverter::GetStringFromAddress(sAddress, aAddress, -pDoc, formula::FormulaGrammar::CONV_OOO); -mpList-InsertEntry(sAddress.replace('.', '\t') + \t + pDoc-GetString(aAddress)); +ScAddress aPos = aIter.GetPos(); +if (aPos.Tab() = nTabCount) +// Out-of-bound sheet index. +continue; + +OUString aPosStr = aPos.Format(SCA_ABS, NULL, pDoc-GetAddressConvention()); +mpList-InsertEntry(aTabNames[aPos.Tab()] + \t + aPosStr + \t + pDoc-GetString(aPos)); } } mpList-SetUpdateMode(true); @@ -86,15 +90,25 @@ IMPL_LINK_NOARG( SearchResultsDlg, ListSelectHdl ) return 0; SvTreeListEntry *pEntry = mpList-FirstSelected(); -ScAddress aAddress; -sal_Int32 nOffset = 0; -OUString sAddress = mpList-GetEntryText(pEntry).replaceFirst(\t, .); -ScRangeStringConverter::GetAddressFromString(aAddress, sAddress, -mpDoc, formula::FormulaGrammar::CONV_OOO, nOffset, '\t'); +OUString aTabStr = mpList-GetEntryText(pEntry, 0); +OUString aPosStr = mpList-GetEntryText(pEntry, 1); + +SCTAB nTab = -1; +if (!mpDoc-GetTable(aTabStr, nTab)) +// No sheet with specified name. +return 0; + +ScAddress aPos; +sal_uInt16 nRes = aPos.Parse(aPosStr, mpDoc, mpDoc-GetAddressConvention()); +if (!(nRes SCA_VALID)) +// Invalid address string. +return 0; + +// Jump to the cell. ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell(); -pScViewShell-SetTabNo(aAddress.Tab()); -pScViewShell-SetCursor(aAddress.Col(), aAddress.Row()); -pScViewShell-AlignToCursor(aAddress.Col(), aAddress.Row(), SC_FOLLOW_JUMP); +pScViewShell-SetTabNo(nTab); +pScViewShell-SetCursor(aPos.Col(), aPos.Row()); +pScViewShell-AlignToCursor(aPos.Col(), aPos.Row(), SC_FOLLOW_JUMP); return 0; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/app/inputhdl.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit bb8acc29e4ad4fb8245b2ed47e60c6cac641ddb1 Author: Julien Nabet serval2...@yahoo.fr Date: Tue May 20 07:33:00 2014 +0200 Resolves: fdo#78838 past-the-end iterator Inserting data in pColumnData invalidated miAutoPosColumn See https://bugs.freedesktop.org/show_bug.cgi?id=78838#c6 Cherry-picked from 1df54514d7a1ebb1b4fa16cca386a34e7c41c490 Change-Id: Iece423cd8d14f5ae7bf382583c0369895a00f168 Reviewed-on: https://gerrit.libreoffice.org/9409 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index d964312..ed5e352 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1536,7 +1536,10 @@ void ScInputHandler::GetColData() pDoc-GetDataEntries( aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(), true, aEntries, true); if (!aEntries.empty()) +{ pColumnData-insert(aEntries.begin(), aEntries.end()); +miAutoPosColumn = pColumnData-end(); +} } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/app/inputhdl.cxx |8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) New commits: commit 51a868729b5adfa402095f5c08fa889bddcd1b34 Author: Eike Rathke er...@redhat.com Date: Tue May 20 11:38:46 2014 +0200 simplify and ensure valid miAutoPosColumn in all cases, fdo#78838 related Unconditionally set miAutoPosColumn at the end of all operations so it is also valid in case of pColumnData-clear() and no entries inserted after pDoc-GetDataEntries(). Change-Id: I689632f696091fd9ce8e93c06d7918e5eaf05ab4 (cherry picked from commit 23e9f36a21f7daa6175f53fd244677b9c2e2a660) Reviewed-on: https://gerrit.libreoffice.org/9412 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index ed5e352..0041f3c 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1527,19 +1527,15 @@ void ScInputHandler::GetColData() if ( pColumnData ) pColumnData-clear(); else -{ pColumnData = new ScTypedCaseStrSet; -miAutoPosColumn = pColumnData-end(); -} std::vectorScTypedStrData aEntries; pDoc-GetDataEntries( aCursorPos.Col(), aCursorPos.Row(), aCursorPos.Tab(), true, aEntries, true); if (!aEntries.empty()) -{ pColumnData-insert(aEntries.begin(), aEntries.end()); -miAutoPosColumn = pColumnData-end(); -} + +miAutoPosColumn = pColumnData-end(); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/cctrl/checklistmenu.cxx |3 --- 1 file changed, 3 deletions(-) New commits: commit f5e3380a699f7eff866178cd2c2a839b42e16d19 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Sun May 18 12:43:06 2014 -0400 fdo#78786: No need to insert entries here for date members. Data member entries are inserted when they are added in addDateMember(). (cherry picked from commit 836328d6473ae1a0c472c7dbf8262641c74843cb) Conflicts: sc/source/ui/cctrl/checklistmenu.cxx Change-Id: I6cb2e3629053fe2bb49517c4ef8d5c1fee576446 Reviewed-on: https://gerrit.libreoffice.org/9398 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index 999c9bb..5986ea5 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -1517,9 +1517,6 @@ void ScCheckListMenuWindow::initMembers() { if (maMembers[i].mbDate) { -maChecks.InsertEntry(maMembers[i].maName, NULL, sal_False, LIST_APPEND, NULL, -SvLBoxButtonKind_enabledCheckbox ); - maChecks.CheckEntry(maMembers[i].maName, maMembers[i].mpParent, maMembers[i].mbVisible); // Expand first node of checked dates if (!maMembers[i].mpParent maChecks.IsChecked(maMembers[i].maName, maMembers[i].mpParent)) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/excel/read.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 8f1f935beee8495168b19f4b5e02bde8a9399154 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Tue May 13 14:02:45 2014 -0400 fdo#78471: Don't forget to record the ID of the last record for BIFF5. Shared formula import code depends on this. Change-Id: Iecb009252c56673df33e0d681de825911154903a (cherry picked from commit 286760359bae7e21a772dd104ab17a1df69a57b0) Reviewed-on: https://gerrit.libreoffice.org/9347 Tested-by: David Tardon dtar...@redhat.com Reviewed-by: David Tardon dtar...@redhat.com diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx index a8f0fe6..4c69155 100644 --- a/sc/source/filter/excel/read.cxx +++ b/sc/source/filter/excel/read.cxx @@ -90,7 +90,7 @@ FltError ImportExcel::Read( void ) sal_Size nProgressBasePos = 0; sal_Size nProgressBaseSize = 0; -while( eAkt != Z_Ende ) +for (; eAkt != Z_Ende; mnLastRecId = nOpcode) { if( eAkt == Z_Biff5E ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/conditio.cxx | 29 +++-- sc/source/core/tool/interpr4.cxx |8 +--- sc/source/ui/undo/undoblk.cxx| 15 +++ 3 files changed, 47 insertions(+), 5 deletions(-) New commits: commit 0a47daf3175ec16d48669535a34823be47fbb42a Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Tue May 13 12:35:24 2014 -0400 fdo#78402: Adjust references of validity entries as appropriate. Change-Id: I7fd62153c7267a3d606b86d74bebecf6b8d75250 (cherry picked from commit a93bb27aa46c84410c8848a6118d5d63d47be92c) Reviewed-on: https://gerrit.libreoffice.org/9345 Tested-by: David Tardon dtar...@redhat.com Reviewed-by: David Tardon dtar...@redhat.com diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index ae5e098..5e8e549 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -510,13 +510,38 @@ void ScConditionEntry::UpdateReference( sc::RefUpdateContext rCxt ) if (pFormula1) { -sc::RefUpdateResult aRes = pFormula1-AdjustReferenceInName(rCxt, aOldSrcPos); +sc::RefUpdateResult aRes; +switch (rCxt.meMode) +{ +case URM_INSDEL: +aRes = pFormula1-AdjustReferenceOnShift(rCxt, aOldSrcPos); +break; +case URM_MOVE: +aRes = pFormula1-AdjustReferenceOnMove(rCxt, aOldSrcPos, aSrcPos); +break; +default: +; +} + if (aRes.mbReferenceModified || bChangedPos) DELETEZ(pFCell1); // is created again in IsValid } + if (pFormula2) { -sc::RefUpdateResult aRes = pFormula2-AdjustReferenceInName(rCxt, aOldSrcPos); +sc::RefUpdateResult aRes; +switch (rCxt.meMode) +{ +case URM_INSDEL: +aRes = pFormula2-AdjustReferenceOnShift(rCxt, aOldSrcPos); +break; +case URM_MOVE: +aRes = pFormula2-AdjustReferenceOnMove(rCxt, aOldSrcPos, aSrcPos); +break; +default: +; +} + if (aRes.mbReferenceModified || bChangedPos) DELETEZ(pFCell2); // is created again in IsValid } diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index c5ebbd3..4239001 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -1843,6 +1843,8 @@ void ScInterpreter::QueryMatrixType(ScMatrixRef xMat, short rRetTypeExpr, sal_ { if (xMat) { +SCSIZE nCols, nRows; +xMat-GetDimensions(nCols, nRows); ScMatrixValue nMatVal = xMat-Get(0, 0); ScMatValType nMatValType = nMatVal.nType; if (ScMatrix::IsNonValueType( nMatValType)) @@ -1850,14 +1852,14 @@ void ScInterpreter::QueryMatrixType(ScMatrixRef xMat, short rRetTypeExpr, sal_ if ( xMat-IsEmptyPath( 0, 0)) { // result of empty FALSE jump path FormulaTokenRef xRes = new FormulaDoubleToken( 0.0); -PushTempToken( new ScMatrixCellResultToken( xMat, xRes.get())); +PushTempToken( new ScMatrixFormulaCellToken(nCols, nRows, xMat, xRes.get())); rRetTypeExpr = NUMBERFORMAT_LOGICAL; } else { svl::SharedString aStr( nMatVal.GetString()); FormulaTokenRef xRes = new FormulaStringToken( aStr); -PushTempToken( new ScMatrixCellResultToken( xMat, xRes.get())); +PushTempToken( new ScMatrixFormulaCellToken(nCols, nRows, xMat, xRes.get())); rRetTypeExpr = NUMBERFORMAT_TEXT; } } @@ -1869,7 +1871,7 @@ void ScInterpreter::QueryMatrixType(ScMatrixRef xMat, short rRetTypeExpr, sal_ xRes = new FormulaErrorToken( nErr); else xRes = new FormulaDoubleToken( nMatVal.fVal); -PushTempToken( new ScMatrixCellResultToken( xMat, xRes.get())); +PushTempToken( new ScMatrixFormulaCellToken(nCols, nRows, xMat, xRes.get())); if ( rRetTypeExpr != NUMBERFORMAT_LOGICAL ) rRetTypeExpr = NUMBERFORMAT_NUMBER; } diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx index cb4f25a..634e1f6 100644 --- a/sc/source/ui/undo/undoblk.cxx +++ b/sc/source/ui/undo/undoblk.cxx @@ -48,6 +48,8 @@ #include clipparam.hxx #include sc.hrc #include refhint.hxx +#include refupdatecontext.hxx +#include validat.hxx #include set @@ -1265,6 +1267,19 @@ void ScUndoDragDrop::Undo() SCTAB nTabDelta = aSrcRange.aStart.Tab() - aDestRange.aStart.Tab(); sc::RefMovedHint aHint(aDestRange, ScAddress(nColDelta, nRowDelta, nTabDelta)); pDoc-BroadcastRefMoved(aHint); + +ScValidationDataList* pValidList = pDoc-GetValidationList(); +if (pValidList) +{ +
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/excel/xestream.cxx |2 +- sc/source/filter/qpro/qpro.cxx |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit f12631e960a2b4123c96e96d2af7d43741d8e6a5 Author: LuboÅ¡ LuÅák l.lu...@collabora.com Date: Wed Mar 12 13:44:29 2014 +0100 std::strlen requires cstring include to build Or, even simpler, don't bother with the needless namespacing. Change-Id: I4bbb115c1c2c89881a0bf88ccd54b0f5cb8b3518 (cherry picked from commit da9bd301c6f62e829daadb2af6a6b9633d4f1cb9) Signed-off-by: Andras Timar andras.ti...@collabora.com diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index 035a827..df08d2c 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -985,7 +985,7 @@ sax_fastparser::FSHelperPtr XclExpXmlStream::WriteAttributesInternal( sal_Int32 rStream-write( ) -writeId( nAttribute ) -write( =\ ) --writeEscaped( OUString(pValue, std::strlen(pValue), RTL_TEXTENCODING_UTF8) ) +-writeEscaped( OUString(pValue, strlen(pValue), RTL_TEXTENCODING_UTF8) ) -write( \ ); } diff --git a/sc/source/filter/qpro/qpro.cxx b/sc/source/filter/qpro/qpro.cxx index c370492..793412a 100644 --- a/sc/source/filter/qpro/qpro.cxx +++ b/sc/source/filter/qpro/qpro.cxx @@ -229,7 +229,7 @@ void ScQProReader::readString( OUString rString, sal_uInt16 nLength ) sal_Char* pText = new sal_Char[ nLength + 1 ]; mpStream-Read( pText, nLength ); pText[ nLength ] = 0; -rString = OUString( pText, std::strlen(pText), mpStream-GetStreamCharSet() ); +rString = OUString( pText, strlen(pText), mpStream-GetStreamCharSet() ); delete [] pText; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/conditio.cxx | 37 + 1 file changed, 37 insertions(+) New commits: commit 5b76a0057a25966f48caed78bcff21b72fdbdda2 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Tue May 13 22:46:17 2014 -0400 fdo#76710: Adjust sheet position of conditional format entries. When inserting or deleting sheets. Change-Id: Ibf898350e22f092ec38b75ad98957832a5580e6a (cherry picked from commit 146f6e7e68ea56f79b72047b97bd9fba66db499d) Reviewed-on: https://gerrit.libreoffice.org/9350 Reviewed-by: Fridrich Strba fridr...@documentfoundation.org Tested-by: Fridrich Strba fridr...@documentfoundation.org diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 5e8e549..602446c 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -2004,12 +2004,49 @@ void ScConditionalFormat::InsertCol(SCTAB nTab, SCROW nRowStart, SCROW nRowEnd, void ScConditionalFormat::UpdateInsertTab( sc::RefUpdateInsertTabContext rCxt ) { +for (size_t i = 0, n = maRanges.size(); i n; ++i) +{ +// We assume that the start and end sheet indices are equal. +ScRange* pRange = maRanges[i]; +SCTAB nTab = pRange-aStart.Tab(); + +if (nTab rCxt.mnInsertPos) +// Unaffected. +continue; + +pRange-aStart.IncTab(rCxt.mnSheets); +pRange-aEnd.IncTab(rCxt.mnSheets); +} + for (CondFormatContainer::iterator it = maEntries.begin(); it != maEntries.end(); ++it) it-UpdateInsertTab(rCxt); } void ScConditionalFormat::UpdateDeleteTab( sc::RefUpdateDeleteTabContext rCxt ) { +for (size_t i = 0, n = maRanges.size(); i n; ++i) +{ +// We assume that the start and end sheet indices are equal. +ScRange* pRange = maRanges[i]; +SCTAB nTab = pRange-aStart.Tab(); + +if (nTab rCxt.mnDeletePos) +// Left of the deleted sheet(s). Unaffected. +continue; + +if (nTab = rCxt.mnDeletePos+rCxt.mnSheets-1) +{ +// On the deleted sheet(s). +pRange-aStart.SetTab(-1); +pRange-aEnd.SetTab(-1); +continue; +} + +// Right of the deleted sheet(s). Adjust the sheet indices. +pRange-aStart.IncTab(-1*rCxt.mnSheets); +pRange-aEnd.IncTab(-1*rCxt.mnSheets); +} + for (CondFormatContainer::iterator it = maEntries.begin(); it != maEntries.end(); ++it) it-UpdateDeleteTab(rCxt); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/xml/xmlexprt.cxx | 14 +++--- 1 file changed, 11 insertions(+), 3 deletions(-) New commits: commit 181084cb110fefb13200d8a645bca9857964f378 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Thu May 15 20:32:05 2014 -0400 fdo#77537: Exporting font names in edit text needs special handling. Change-Id: Ia9c29d37eaf962e0245920e50f534dd779af72dc (cherry picked from commit 48eccfb812284f43ba24c3be3903537ce954944d) Reviewed-on: https://gerrit.libreoffice.org/9366 Reviewed-by: Fridrich Strba fridr...@documentfoundation.org Tested-by: Fridrich Strba fridr...@documentfoundation.org diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 0f157a1..f7c6787 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -1109,10 +1109,18 @@ const SvxFieldData* toXMLPropertyStates( case EE_CHAR_FONTINFO_CJK: case EE_CHAR_FONTINFO_CTL: { -if (!static_castconst SvxFontItem*(p)-QueryValue(aAny, pEntry-mnFlag)) -continue; +// Apparently font info needs special handling. +const SvxFontItem* pItem = static_castconst SvxFontItem*(p); -rPropStates.push_back(XMLPropertyState(nIndex, aAny)); +sal_Int32 nIndexFontName = xMapper-GetEntryIndex(XML_NAMESPACE_STYLE, font-name, 0); + +if (nIndexFontName == -1 || nIndexFontName = nEntryCount) +break; + +if (!pItem-QueryValue(aAny, MID_FONT_FAMILY_NAME)) +break; + +rPropStates.push_back(XMLPropertyState(nIndexFontName, aAny)); } break; case EE_CHAR_WEIGHT: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/xml/xmlexprt.cxx | 39 +++--- 1 file changed, 36 insertions(+), 3 deletions(-) New commits: commit e373ca05c6d332d139d5a7553faf15d1d0c8cdeb Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Fri May 16 10:45:40 2014 -0400 fdo#75056: Overline attribute needs special treatment as well. Also fix the export of underline types as well. It was always saved as a single line. (cherry picked from commit fcf5b5c081ded93b12dd888236d0a860b7693ed1) Change-Id: I88cb0f3702a6afc14544ecbce8f200b5422fd78f Signed-off-by: Fridrich Strba fridr...@documentfoundation.org diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index f7c6787..885b5bc 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -1164,6 +1164,10 @@ const SvxFieldData* toXMLPropertyStates( if (nIndexWidth == -1 || nIndexWidth nEntryCount) break; +sal_Int32 nIndexType = xMapper-GetEntryIndex(XML_NAMESPACE_STYLE, text-underline-type, 0); +if (nIndexType == -1 || nIndexType nEntryCount) +break; + sal_Int32 nIndexColor = xMapper-FindEntryIndex(CharUnderlineColor, XML_NAMESPACE_STYLE, text-underline-color); if (nIndexColor == -1 || nIndexColor nEntryCount) break; @@ -1175,6 +1179,7 @@ const SvxFieldData* toXMLPropertyStates( const SvxUnderlineItem* pUL = static_castconst SvxUnderlineItem*(p); pUL-QueryValue(aAny, MID_TL_STYLE); rPropStates.push_back(XMLPropertyState(nIndexStyle, aAny)); +rPropStates.push_back(XMLPropertyState(nIndexType, aAny)); rPropStates.push_back(XMLPropertyState(nIndexWidth, aAny)); pUL-QueryValue(aAny, MID_TL_COLOR); @@ -1186,10 +1191,38 @@ const SvxFieldData* toXMLPropertyStates( break; case EE_CHAR_OVERLINE: { -if (!static_castconst SvxOverlineItem*(p)-QueryValue(aAny, pEntry-mnFlag)) -continue; +// Same with overline. Do just as we do with underline attributes. +sal_Int32 nIndexStyle = xMapper-GetEntryIndex(XML_NAMESPACE_STYLE, text-overline-style, 0); +if (nIndexStyle == -1 || nIndexStyle nEntryCount) +break; -rPropStates.push_back(XMLPropertyState(nIndex, aAny)); +sal_Int32 nIndexWidth = xMapper-GetEntryIndex(XML_NAMESPACE_STYLE, text-overline-width, 0); +if (nIndexWidth == -1 || nIndexWidth nEntryCount) +break; + +sal_Int32 nIndexType = xMapper-GetEntryIndex(XML_NAMESPACE_STYLE, text-overline-type, 0); +if (nIndexType == -1 || nIndexType nEntryCount) +break; + +sal_Int32 nIndexColor = xMapper-FindEntryIndex(CharOverlineColor, XML_NAMESPACE_STYLE, text-overline-color); +if (nIndexColor == -1 || nIndexColor nEntryCount) +break; + +sal_Int32 nIndexHasColor = xMapper-FindEntryIndex(CharOverlineHasColor, XML_NAMESPACE_STYLE, text-overline-color); +if (nIndexHasColor == -1 || nIndexHasColor nEntryCount) +break; + +const SvxOverlineItem* pOL = static_castconst SvxOverlineItem*(p); +pOL-QueryValue(aAny, MID_TL_STYLE); +rPropStates.push_back(XMLPropertyState(nIndexStyle, aAny)); +rPropStates.push_back(XMLPropertyState(nIndexType, aAny)); +rPropStates.push_back(XMLPropertyState(nIndexWidth, aAny)); + +pOL-QueryValue(aAny, MID_TL_COLOR); +rPropStates.push_back(XMLPropertyState(nIndexColor, aAny)); + +pOL-QueryValue(aAny, MID_TL_HASCOLOR); +rPropStates.push_back(XMLPropertyState(nIndexHasColor, aAny)); } break; case EE_CHAR_COLOR: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/column4.cxx |4 1 file changed, 4 insertions(+) New commits: commit 8549d1dbe648ce01e4a351eb301dcf146c62676d Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Fri May 16 23:06:33 2014 -0400 fdo#77735: Don't proceed when all cells in the range are empty. That means there is nothing to delete, and proceeding would cause Calc to freeze. Change-Id: I2a8fb5736870ba459082873c8f864283d8b9c664 (cherry picked from commit bc7e0967be52f5eb7948fbb1c30edc7dd5acc18d) Reviewed-on: https://gerrit.libreoffice.org/9388 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx index 7996cd8..9a3ef12 100644 --- a/sc/source/core/data/column4.cxx +++ b/sc/source/core/data/column4.cxx @@ -53,6 +53,10 @@ void ScColumn::DeleteBeforeCopyFromClip( sc::CopyFromClipContext rCxt, const Sc sc::SingleColumnSpanSet::SpansType aSpans; aSpanSet.getSpans(aSpans); +if (aSpans.empty()) +// All cells in the range in the clip are empty. Nothing to delete. +return; + // Translate the clip column spans into the destination column, and repeat as needed. std::vectorsc::RowSpan aDestSpans; SCROW nDestOffset = aRange.mnRow1 - nClipRow1; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/view/gridwin.cxx | 55 +- 1 file changed, 34 insertions(+), 21 deletions(-) New commits: commit d758875cd0ea87f8c7bbe1bbb78e49d06254cbee Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Fri May 16 15:03:31 2014 -0400 fdo#77315: When in cell edit mode, use the EditView instance already there. This prevents creation of a temporary EditView instance which would mess up the cursor state while the mouse pointer is hovering. (cherry picked from commit df51f7d486cafb2795a38ae9fedd8fde8827d8a4) (cherry picked from commit 8c8de51cc954aaae07f76732e6202398e33afeb7) Conflicts: sc/source/ui/view/gridwin.cxx Change-Id: I7759667b105b4389dd4de2673cd2fbe32082c95d Reviewed-on: https://gerrit.libreoffice.org/9386 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index c49d9ea..1fa83c5 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -63,6 +63,7 @@ #include com/sun/star/awt/MouseButton.hpp #include com/sun/star/script/vba/VBAEventId.hpp #include com/sun/star/script/vba/XVBAEventProcessor.hpp +#include com/sun/star/text/textfield/Type.hpp #include gridwin.hxx #include tabvwsh.hxx @@ -5190,11 +5191,43 @@ boost::shared_ptrScFieldEditEngine createEditEngine( ScDocShell* pDocSh, const return pEngine; } +bool extractURLInfo( const SvxFieldItem* pFieldItem, OUString* pName, OUString* pUrl, OUString* pTarget ) +{ +if (!pFieldItem) +return false; + +const SvxFieldData* pField = pFieldItem-GetField(); +if (pField-GetClassId() != text::textfield::Type::URL) +return false; + +const SvxURLField* pURLField = static_castconst SvxURLField*(pField); + +if (pName) +*pName = pURLField-GetRepresentation(); +if (pUrl) +*pUrl = pURLField-GetURL(); +if (pTarget) +*pTarget = pURLField-GetTargetFrame(); + +return true; +} + } bool ScGridWindow::GetEditUrl( const Point rPos, OUString* pName, OUString* pUrl, OUString* pTarget ) { +ScTabViewShell* pViewSh = pViewData-GetViewShell(); +ScInputHandler* pInputHdl = NULL; +if (pViewSh) +pInputHdl = pViewSh-GetInputHandler(); + +if (pInputHdl pInputHdl-IsInputMode()) +{ +EditView* pView = pInputHdl-GetTableView(); +return extractURLInfo(pView-GetFieldUnderMousePointer(), pName, pUrl, pTarget); +} + //! nPosX/Y mit uebergeben? SCsCOL nPosX; SCsROW nPosY; @@ -5303,27 +5336,7 @@ bool ScGridWindow::GetEditUrl( const Point rPos, sal_Bool bRet = false; MapMode aOld = GetMapMode(); SetMapMode(aEditMode); // kein return mehr - -const SvxFieldItem* pFieldItem = aTempView.GetFieldUnderMousePointer(); -if (pFieldItem) -{ -const SvxFieldData* pField = pFieldItem-GetField(); -if ( pField pField-ISA(SvxURLField) ) -{ -if ( pName || pUrl || pTarget ) -{ -const SvxURLField* pURLField = (const SvxURLField*)pField; -if (pName) -*pName = pURLField-GetRepresentation(); -if (pUrl) -*pUrl = pURLField-GetURL(); -if (pTarget) -*pTarget = pURLField-GetTargetFrame(); -} -bRet = sal_True; -} -} - +bRet = extractURLInfo(aTempView.GetFieldUnderMousePointer(), pName, pUrl, pTarget); SetMapMode(aOld); return bRet; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/view/output2.cxx |4 1 file changed, 4 insertions(+) New commits: commit 5caa2548f837c54aac44fde0fdbb145145b60091 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Mon May 12 20:59:29 2014 -0400 fdo#78391: When numbers are auto-fit, reset clipping parameters. Else it would get processed further to a surprising result. Change-Id: I3d6f0d680e0c4c3ffe1d28dcbaf51a156f569359 (cherry picked from commit 162029e55af8f681966497ab7f20277888eac478) Reviewed-on: https://gerrit.libreoffice.org/9335 Reviewed-by: Andras Timar andras.ti...@collabora.com Tested-by: Andras Timar andras.ti...@collabora.com diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 75739d4..d14c901 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -1850,7 +1850,11 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic ) (long) ( aVars.GetLeftTotal() * mnPPTX ) + (long) ( aVars.GetMargin()-GetRightMargin() * mnPPTX ); if ( nNeededWidth = aAreaParam.maClipRect.GetWidth() ) +{ +// Cell value is no longer clipped. Reset relevant parameters. aAreaParam.mbLeftClip = aAreaParam.mbRightClip = false; +aAreaParam.mnLeftClipLength = aAreaParam.mnRightClipLength = 0; +} // If the ### replacement doesn't fit into the cells, no clip marks // are shown, as the ### already denotes too little space. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/view/output.cxx | 96 --- 1 file changed, 54 insertions(+), 42 deletions(-) New commits: commit b30c08e3dd5e1c20923f66684a893a9c2ede6637 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Sun May 11 19:50:53 2014 -0400 fdo#78535: Don't process borders of 0 width. Or they would get drawn for real. Change-Id: Iec24e70a80ff8aa1ef7512e71249a99243297c4e (cherry picked from commit 224b235971a01971de626d38ccc8506d0a55771b) Reviewed-on: https://gerrit.libreoffice.org/9323 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 1a5cdde..30d2ee8 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -1716,50 +1716,62 @@ void ScOutputData::DrawRotatedFrame( const Color* pForceColor ) const svx::frame::Style noStyle; // Horizontal lines -long nUpperRotate = lcl_getRotate( mpDoc, nTab, nX, nY - 1 ); -pProcessor-process( svx::frame::CreateBorderPrimitives( -aPoints[bLayoutRTL?1:0], aPoints[bLayoutRTL?0:1], aTopLine, -svx::frame::Style(), -svx::frame::Style(), -aLeftLine, -svx::frame::Style(), -svx::frame::Style(), -aRightLine, -pForceColor, nUpperRotate, nAttrRotate ) ); - -long nLowerRotate = lcl_getRotate( mpDoc, nTab, nX, nY + 1 ); -pProcessor-process( svx::frame::CreateBorderPrimitives( -aPoints[bLayoutRTL?2:3], aPoints[bLayoutRTL?3:2], aBottomLine, -aLeftLine, -svx::frame::Style(), -svx::frame::Style(), -aRightLine, -svx::frame::Style(), -svx::frame::Style(), -pForceColor, 18000 - nAttrRotate, 18000 - nLowerRotate ) ); +if (aTopLine.Prim() || aTopLine.Secn()) +{ +long nUpperRotate = lcl_getRotate( mpDoc, nTab, nX, nY - 1 ); +pProcessor-process( svx::frame::CreateBorderPrimitives( +aPoints[bLayoutRTL?1:0], aPoints[bLayoutRTL?0:1], aTopLine, +svx::frame::Style(), +svx::frame::Style(), +aLeftLine, +svx::frame::Style(), +svx::frame::Style(), +aRightLine, +pForceColor, nUpperRotate, nAttrRotate ) ); +} + +if (aBottomLine.Prim() || aBottomLine.Secn()) +{ +long nLowerRotate = lcl_getRotate( mpDoc, nTab, nX, nY + 1 ); +pProcessor-process( svx::frame::CreateBorderPrimitives( +aPoints[bLayoutRTL?2:3], aPoints[bLayoutRTL?3:2], aBottomLine, +aLeftLine, +svx::frame::Style(), +svx::frame::Style(), +aRightLine, +svx::frame::Style(), +svx::frame::Style(), +pForceColor, 18000 - nAttrRotate, 18000 - nLowerRotate ) ); +} // Vertical slanted lines -long nLeftRotate = lcl_getRotate( mpDoc, nTab, nX - 1, nY ); -pProcessor-process( svx::frame::CreateBorderPrimitives( -aPoints[0], aPoints[3], aLeftLine, -aTopLine, -svx::frame::Style(), -svx::frame::Style(), -aBottomLine, -svx::frame::Style(), -svx::frame::Style(), -pForceColor, nAttrRotate, nLeftRotate ) ); - -long nRightRotate = lcl_getRotate( mpDoc, nTab, nX + 1, nY ); -pProcessor-process( svx::frame::CreateBorderPrimitives( -
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/column3.cxx | 43 1 file changed, 26 insertions(+), 17 deletions(-) New commits: commit 1b9f4a686c5f397db3bd996acf53e0ad2b5d9ded Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Fri May 9 22:19:15 2014 -0400 fdo#77056: Treat empty cells as if they have a value of 0.0. Change-Id: Ibe64cf7177a5298c1878e0014c049dc9c82b1344 (cherry picked from commit 83a88b942134314e86ac612d0ef70a8e4919e4af) Reviewed-on: https://gerrit.libreoffice.org/9298 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 6f5e4e2..cbb38d7 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -1166,6 +1166,23 @@ class MixDataHandler bool mbSkipEmpty; +void doFunction( size_t nDestRow, double fVal1, double fVal2 ) +{ +bool bOk = lcl_DoFunction(fVal1, fVal2, mnFunction); + +if (bOk) +miNewCellsPos = maNewCells.set(miNewCellsPos, nDestRow-mnRowOffset, fVal1); +else +{ +ScAddress aPos(mrDestColumn.GetCol(), nDestRow, mrDestColumn.GetTab()); + +ScFormulaCell* pFC = new ScFormulaCell(mrDestColumn.GetDoc(), aPos); +pFC-SetErrCode(errNoValue); + +miNewCellsPos = maNewCells.set(miNewCellsPos, nDestRow-mnRowOffset, pFC); +} +} + public: MixDataHandler( sc::ColumnBlockPosition rBlockPos, @@ -1188,22 +1205,15 @@ public: mrBlockPos.miCellPos = aPos.first; switch (aPos.first-type) { +case sc::element_type_empty: case sc::element_type_numeric: { -// Both src and dest are of numeric type. -bool bOk = lcl_DoFunction(f, sc::numeric_block::at(*aPos.first-data, aPos.second), mnFunction); - -if (bOk) -miNewCellsPos = maNewCells.set(miNewCellsPos, nRow-mnRowOffset, f); -else -{ -ScFormulaCell* pFC = -new ScFormulaCell( -mrDestColumn.GetDoc(), ScAddress(mrDestColumn.GetCol(), nRow, mrDestColumn.GetTab())); +double fSrcVal = 0.0; +if (aPos.first-type == sc::element_type_numeric) +fSrcVal = sc::numeric_block::at(*aPos.first-data, aPos.second); -pFC-SetErrCode(errNoValue); -miNewCellsPos = maNewCells.set(miNewCellsPos, nRow-mnRowOffset, pFC); -} +// Both src and dest are of numeric type. +doFunction(nRow, f, fSrcVal); } break; case sc::element_type_formula: @@ -1237,7 +1247,6 @@ public: break; case sc::element_type_string: case sc::element_type_edittext: -case sc::element_type_empty: { // Destination cell is not a number. Just take the source cell. miNewCellsPos = maNewCells.set(miNewCellsPos, nRow-mnRowOffset, f); @@ -1354,9 +1363,9 @@ public: { case sc::element_type_numeric: { -double fVal = sc::numeric_block::at(*aPos.first-data, aPos.second); -miNewCellsPos = maNewCells.set( -miNewCellsPos, nDestRow-mnRowOffset, fVal); +double fVal1 = 0.0; +double fVal2 = sc::numeric_block::at(*aPos.first-data, aPos.second); +doFunction(nDestRow, fVal1, fVal2); } break; case sc::element_type_string: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/document.cxx | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) New commits: commit 3cf9916a38975ea7f9a815b35de47ee1b82fa919 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Fri May 9 11:44:51 2014 -0400 fdo#77806: Check the boundaries before accessing an array Change-Id: I0878f734599f566cde83183947cd7613c0f8d5c6 (cherry picked from commit a45973a90625f4b9e0f603154194f357ff2418d4) Reviewed-on: https://gerrit.libreoffice.org/9292 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 8c69412..47164be 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -6113,14 +6113,30 @@ bool ScDocument::HasNote(const ScAddress rPos) const { return HasNote(rPos.Col(), rPos.Row(), rPos.Tab()); } + bool ScDocument::HasNote(SCCOL nCol, SCROW nRow, SCTAB nTab) const { -const ScPostIt* pNote = maTabs[nTab]-aCol[nCol].GetCellNote(nRow); +if (!ValidColRow(nCol, nRow)) +return false; + +const ScTable* pTab = FetchTable(nTab); +if (!pTab) +return false; + +const ScPostIt* pNote = pTab-aCol[nCol].GetCellNote(nRow); return pNote != NULL; } + bool ScDocument::HasColNotes(SCCOL nCol, SCTAB nTab) const { -return maTabs[nTab]-aCol[nCol].HasCellNotes(); +if (!ValidCol(nCol)) +return false; + +const ScTable* pTab = FetchTable(nTab); +if (!pTab) +return false; + +return pTab-aCol[nCol].HasCellNotes(); } bool ScDocument::HasTabNotes(SCTAB nTab) const ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/column3.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit e4f500934e51946cd1fbfa8b8dc6f6fb26a7779b Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Fri May 9 14:04:30 2014 -0400 fdo#77379: Don't return from the call. Notes are handled at the end. Returning prematurely would end up skipping pasting of notes. Change-Id: I79e0968023342a68fe729f31eb6cfc3cfacd5850 (cherry picked from commit f4673ccd5e26d38a28f297d64ed70ba719d21ef2) Reviewed-on: https://gerrit.libreoffice.org/9295 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index ef726d1..6f5e4e2 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -881,7 +881,7 @@ public: case sc::element_type_string: { if (!bString) -return; +break; sc::string_block::const_iterator it = sc::string_block::begin(*node.data); std::advance(it, nOffset); @@ -905,7 +905,7 @@ public: case sc::element_type_edittext: { if (!bString) -return; +break; sc::edittext_block::const_iterator it = sc::edittext_block::begin(*node.data); std::advance(it, nOffset); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/docshell/docfunc.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit c369a60b60dfeaa12a688d2182c78bc8d4efb38e Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Wed May 7 00:34:06 2014 -0400 fdo#77944: No need to store updated formulas in undo document when moving. This causes crash with dbgutil build, and I'm sure would cause issues with the release build as well. We now use broadcasting to handle reference update during undo of block move, so this old way of handling undo for block move is redundant and obviously causes issues. (cherry picked from commit 6cc92a2fead337eef3d9cc3e5818cfcc505e4651) Conflicts: sc/source/ui/docshell/docfunc.cxx Change-Id: I9dcbb9d9e3808da3f8510eab16ad21b626f881d9 Reviewed-on: https://gerrit.libreoffice.org/9265 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index bcb45b6..2d85309 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -2728,7 +2728,7 @@ sal_Bool ScDocFunc::MoveBlock( const ScRange rSource, const ScAddress rDestPos ScDrawLayer::MoveCells() which may move away inserted objects to wrong positions (e.g. if source and destination range overlaps).*/ pDoc-CopyFromClip( aPasteDest, aDestMark, IDF_ALL ~(IDF_OBJECTS), -pRefUndoDoc, pClipDoc, sal_True, false, bIncludeFiltered ); +NULL, pClipDoc, true, false, bIncludeFiltered ); // skipped rows and merged cells don't mix ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/formulacell.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit f7f1816938e252dcbd342d30c9189b5344c4960b Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Tue May 6 12:22:53 2014 -0400 fdo#77944: Put updated formula cells into undo document. Change-Id: Ib9d6a73d485878bfe6c2a1875936025eb4d0a30a (cherry picked from commit 67563fd55b230eb68fef705ff645af7dab73af73) Reviewed-on: https://gerrit.libreoffice.org/9260 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 8302730..9eccadb 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -2882,7 +2882,7 @@ bool ScFormulaCell::UpdateReferenceOnMove( (bValChanged bHasRelName (bHasRelName || bInDeleteUndo || bRefSizeChanged)) || bOnRefMove) bNeedDirty = true; -if (pUndoDoc (bValChanged || bOnRefMove)) +if (pUndoDoc (bValChanged || bRefModified || bOnRefMove)) setOldCodeToUndo(pUndoDoc, aUndoPos, pOldCode.get(), eTempGrammar, cMatrixFlag); bValChanged = false; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/tool/token.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 043dc226967d28a7ccbc2a39df232ea92a25bc66 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Tue May 6 15:24:50 2014 -0400 fdo#77647: Fix the column insertion use case. Change-Id: I7c78f54c9386eced16113e69e625d23ed4acedd7 (cherry picked from commit 7aa32a759fb7b440f870739f7bb680f405f338ce) Reviewed-on: https://gerrit.libreoffice.org/9261 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index f4064f9..8f51a72 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -2560,7 +2560,7 @@ bool expandRange( const sc::RefUpdateContext rCxt, ScRange rRefRange, const Sc // Selected range is only partially overlapping in vertical direction. Bail out. return false; -if (!rCxt.mrDoc.IsExpandRefs() rSelectedRange.aStart.Col() == rRefRange.aStart.Col()) +if (!rCxt.mrDoc.IsExpandRefs() rSelectedRange.aStart.Col() = rRefRange.aStart.Col()) // Selected range is at the left end and the edge expansion is turned off. No expansion. return false; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/excel/xecontent.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 8a14eb18ffc34ab6d7afb8ab0abeb878b3ad2b11 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Tue Apr 29 20:37:36 2014 +0200 escape conditional formatting formulas during xlsx export, fdo#75168 Change-Id: I9ebdb2315b51c2b53d8cfa0486b3ec22a8e0d88d Reviewed-on: https://gerrit.libreoffice.org/9232 Tested-by: Kohei Yoshida libreoff...@kohei.us Reviewed-by: Kohei Yoshida libreoff...@kohei.us diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 4c4db7f..7ebf959 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -942,13 +942,13 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream rStrm ) if(!IsTextRule(eOperation) !IsTopBottomRule(eOperation)) { rWorksheet-startElement( XML_formula, FSEND ); -rWorksheet-write(XclXmlUtils::ToOUString( GetRoot().GetDoc(), mrFormatEntry.GetValidSrcPos(), +rWorksheet-writeEscaped(XclXmlUtils::ToOUString( GetRoot().GetDoc(), mrFormatEntry.GetValidSrcPos(), mrFormatEntry.CreateTokenArry(0))); rWorksheet-endElement( XML_formula ); if (bFmla2) { rWorksheet-startElement( XML_formula, FSEND ); -rWorksheet-write(XclXmlUtils::ToOUString( GetRoot().GetDoc(), mrFormatEntry.GetValidSrcPos(), +rWorksheet-writeEscaped(XclXmlUtils::ToOUString( GetRoot().GetDoc(), mrFormatEntry.GetValidSrcPos(), mrFormatEntry.CreateTokenArry(1))); rWorksheet-endElement( XML_formula ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/docshell/docsh3.cxx |6 ++ 1 file changed, 6 insertions(+) New commits: commit 3efb6e5c35bb1129a78726b163f8fbf9bd94734a Author: Eike Rathke er...@redhat.com Date: Mon May 5 18:18:57 2014 +0100 resolved fdo#78294 default null-date for document import is 1899-12-30 Change-Id: I9dfe76d422ad732a081442b95a995d8d395a098e (cherry picked from commit 571cefca474e6b77d68f9fa31f805dcf692927fd) Reviewed-on: https://gerrit.libreoffice.org/9253 Reviewed-by: Kohei Yoshida libreoff...@kohei.us Tested-by: Kohei Yoshida libreoff...@kohei.us diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index fcb2760f..42817ee 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -428,6 +428,12 @@ void ScDocShell::InitOptions(bool bForLoading) // called from InitNew and L // so it must not be taken from the global options. // Calculation settings are handled separately in ScXMLBodyContext::EndElement. aDocOpt.SetStdPrecision( SvNumberFormatter::UNLIMITED_PRECISION ); + +// fdo#78294 The default null-date if +// table:null-date table:date-value='...' / +// is absent is 1899-12-30 regardless what the configuration is set to. +// Import filters may override this value. +aDocOpt.SetDate( 30, 12, 1899); } aDocument.SetDocOptions( aDocOpt ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/cctrl/checklistmenu.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 3c726b88461f679237349003e6b5256b5bf3f2b9 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Wed Apr 30 13:16:17 2014 -0400 Build fix. Change-Id: I8685c2e3a6993f3924fe8e7caf75318c8ebc566d diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index 88ad240..3082fef 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -1532,7 +1532,7 @@ void ScCheckListMenuWindow::initMembers() else { SvTreeListEntry* pEntry = maChecks.InsertEntry( -maMembers[i].maName, NULL, false, TREELIST_APPEND, NULL, +maMembers[i].maName, NULL, false, LISTBOX_APPEND, NULL, SvLBoxButtonKind_enabledCheckbox); maChecks.SetCheckButtonState( ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/tool/token.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit fbd7c65a16a2f46ee388795e1bb397a719627b9a Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Mon Apr 28 22:57:56 2014 -0400 fdo#77647: Expand reference only when the top of the selected range is... below the top of the reference range. Change-Id: Ibb3dadb50dd076ae05033b046c9506c60605f713 (cherry picked from commit c3e40f47abe3da7e24059281a9047b1292241398) Reviewed-on: https://gerrit.libreoffice.org/9190 Reviewed-by: Andras Timar andras.ti...@collabora.com Tested-by: Andras Timar andras.ti...@collabora.com diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 0e0f8fd..9089a62 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -2576,7 +2576,7 @@ bool expandRange( const sc::RefUpdateContext rCxt, ScRange rRefRange, const Sc // Selected range is only partially overlapping in horizontal direction. Bail out. return false; -if (!rCxt.mrDoc.IsExpandRefs() rSelectedRange.aStart.Row() == rRefRange.aStart.Row()) +if (!rCxt.mrDoc.IsExpandRefs() rSelectedRange.aStart.Row() = rRefRange.aStart.Row()) // Selected range is at the top end and the edge expansion is turned off. No expansion. return false; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/opencl/formulagroupcl.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 0b6fe077679e33ed91bf81796fe454cc75730916 Author: Julien Nabet serval2...@yahoo.fr Date: Sat Apr 26 22:34:35 2014 +0200 cppcheck: fix Mismatching allocation and deallocation Change-Id: Ic007b07a82eb83978527254518d85c5a2903a48d Reviewed-on: https://gerrit.libreoffice.org/9175 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index ec5c4bf..ee614d6 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -3393,7 +3393,7 @@ DynamicKernel* DynamicKernel::create(ScDocument /* rDoc */, #ifdef NO_FALLBACK_TO_SWINTERP assert(false); #else -free(pDynamicKernel); +delete pDynamicKernel; return NULL; #endif } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/tool/scmatrix.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 473e10aa5e1e3c6a4854dec9ff2ea522be283799 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Mon Apr 28 11:55:23 2014 -0400 fdo#75397: Return an empty string for empty element. This is the behavior as of 3.6. It had changed in 4.0 and onward by accident, and caused the bug as reported in fdo#75397. Change-Id: Id96fea354604b3c13cbbf2d9a73223b7725c7d66 (cherry picked from commit 5fab47ddbe332a150fb2005e941a2c19bd38ce7f) Reviewed-on: https://gerrit.libreoffice.org/9187 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index 215bb76..f48de85 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -580,7 +580,7 @@ svl::SharedString ScMatrixImpl::GetString( SvNumberFormatter rFormatter, SCSIZE { if (!maMatFlag.getbool(nR, nC)) // not an empty path. -break; +return svl::SharedString::getEmptyString(); // result of empty FALSE jump path sal_uLong nKey = rFormatter.GetStandardFormat( NUMBERFORMAT_LOGICAL, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/tool/scmatrix.cxx | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) New commits: commit bfc8a79c957dd65dc7e42c47c4fc6de61443fa29 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Mon Apr 28 13:33:08 2014 -0400 fdo#77969: Return 0 in case of matrix consisting of all empty elements. Change-Id: I225d50445d7f84a17c0b9492c17247e4c1c9ef44 (cherry picked from commit 453ea919e70fa9832f11e3ef042bb80cd86892cc) Reviewed-on: https://gerrit.libreoffice.org/9189 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index f48de85..3b2c42c 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -1236,12 +1236,14 @@ class CalcMaxMinValue : std::unary_functionMatrixImplType::element_block_type, { double mfVal; bool mbTextAsZero; +bool mbHasValue; public: CalcMaxMinValue( bool bTextAsZero ) : mfVal(_Op::init()), -mbTextAsZero(bTextAsZero) {} +mbTextAsZero(bTextAsZero), +mbHasValue(false) {} -double getValue() const { return mfVal; } +double getValue() const { return mbHasValue ? mfVal : 0.0; } void operator() (const MatrixImplType::element_block_node_type node) { @@ -1256,6 +1258,8 @@ public: block_type::const_iterator itEnd = block_type::end(*node.data); for (; it != itEnd; ++it) mfVal = _Op::compare(mfVal, *it); + +mbHasValue = true; } break; case mdds::mtm::element_boolean: @@ -1266,6 +1270,7 @@ public: block_type::const_iterator itEnd = block_type::end(*node.data); double fVal = _Op::boolValue(it, itEnd); mfVal = _Op::compare(mfVal, fVal); +mbHasValue = true; } break; case mdds::mtm::element_string: @@ -1273,7 +1278,10 @@ public: { // empty elements are treated as empty strings. if (mbTextAsZero) +{ mfVal = _Op::compare(mfVal, 0.0); +mbHasValue = true; +} } break; default: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/colorscale.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit c624eea0e46e84c68d1a1ad79ef217390bd28ef3 Author: Markus Mohrhard markus.mohrh...@googlemail.com Date: Tue Apr 29 00:48:07 2014 +0200 the safety check was a bit too strict, fdo#77984 Change-Id: Idfc3b3dd1d9f4de428e43c515b13a8d7e40e347c (cherry picked from commit f1d5c27892b0b6a5dc81c94dbf61f9285a52aa5a) Signed-off-by: Kohei Yoshida kohei.yosh...@collabora.com diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index 29d53b7..e186220 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -996,7 +996,7 @@ ScIconSetInfo* ScIconSetFormat::GetIconSetInfo(const ScAddress rAddr) const double nMax = GetMaxValue(); // this check is for safety -if(nMin = nMax) +if(nMin nMax) return NULL; sal_Int32 nIndex = 0; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/tool/interpr6.cxx |1 + sc/source/core/tool/scmatrix.cxx | 14 ++ 2 files changed, 11 insertions(+), 4 deletions(-) New commits: commit a686162553f68f19663694b8407a47d2ec9be700 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Thu Apr 24 12:26:01 2014 -0400 fdo#76663: Let's not skip the first element of a matrix in PRODUCT. Change-Id: I00683ce64fea58a80cd7137384e8f30464c44e9f (cherry picked from commit 4158d8843d50d50e9830c8dc24af8722de77f4af) Reviewed-on: https://gerrit.libreoffice.org/9153 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx index b98fb9b..d6b46a7 100644 --- a/sc/source/core/tool/interpr6.cxx +++ b/sc/source/core/tool/interpr6.cxx @@ -387,6 +387,7 @@ void IterateMatrix( case ifPRODUCT: { ScMatrix::IterateResult aRes = pMat-Product(bTextAsZero); +fRes = aRes.mfFirst; fRes *= aRes.mfRest; rCount += aRes.mnCount; } diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index 45c8e48..215bb76 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -951,7 +951,7 @@ namespace { struct SumOp { -static const int InitVal = 0; +static const double InitVal; void operator() (double rAccum, double fVal) { @@ -959,9 +959,11 @@ struct SumOp } }; +const double SumOp::InitVal = 0.0; + struct SumSquareOp { -static const int InitVal = 0; +static const double InitVal; void operator() (double rAccum, double fVal) { @@ -969,9 +971,11 @@ struct SumSquareOp } }; +const double SumSquareOp::InitVal = 0.0; + struct ProductOp { -static const int InitVal = 1; +static const double InitVal; void operator() (double rAccum, double fVal) { @@ -979,6 +983,8 @@ struct ProductOp } }; +const double ProductOp::InitVal = 1.0; + templatetypename _Op class WalkElementBlocks : std::unary_functionMatrixImplType::element_block_node_type, void { @@ -988,7 +994,7 @@ class WalkElementBlocks : std::unary_functionMatrixImplType::element_block_node bool mbFirst:1; bool mbTextAsZero:1; public: -WalkElementBlocks(bool bTextAsZero) : maRes(0.0, _Op::InitVal, 0), mbFirst(true), mbTextAsZero(bTextAsZero) {} +WalkElementBlocks(bool bTextAsZero) : maRes(_Op::InitVal, _Op::InitVal, 0), mbFirst(true), mbTextAsZero(bTextAsZero) {} const ScMatrix::IterateResult getResult() const { return maRes; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/tool/queryparam.cxx | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) New commits: commit 9f115c83fe94b0ed86562906f9d96465e59ec761 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Thu Apr 24 19:42:30 2014 -0400 fdo#77039: Fill the match string even if the raw string is empty. And in case of an empty string, call svl::SharedString::getEmptyString() to get an empty shared string instance. (cherry picked from commit 50708577850544920c746ebc382d47275452a761) Conflicts: sc/source/core/tool/queryparam.cxx Change-Id: I0923e59f03468790270de8ef22323c0cedad002f Reviewed-on: https://gerrit.libreoffice.org/9155 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/core/tool/queryparam.cxx b/sc/source/core/tool/queryparam.cxx index e7f73ca..eb6ff44 100644 --- a/sc/source/core/tool/queryparam.cxx +++ b/sc/source/core/tool/queryparam.cxx @@ -173,15 +173,17 @@ void ScQueryParamBase::FillInExcelSyntax( svl::SharedStringPool rPool, const OUString rStr, SCSIZE nIndex) { const OUString aCellStr = rStr; -if (!aCellStr.isEmpty()) -{ -if ( nIndex = maEntries.size() ) -Resize( nIndex+1 ); +if (nIndex = maEntries.size()) +Resize(nIndex+1); -ScQueryEntry rEntry = GetEntry(nIndex); -ScQueryEntry::Item rItem = rEntry.GetQueryItem(); +ScQueryEntry rEntry = GetEntry(nIndex); +ScQueryEntry::Item rItem = rEntry.GetQueryItem(); -rEntry.bDoQuery = sal_True; +if (aCellStr.isEmpty()) +rItem.maString = svl::SharedString::getEmptyString(); +else +{ +rEntry.bDoQuery = true; // Operatoren herausfiltern if (aCellStr[0] == '') { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/column.cxx | 24 +++- 1 file changed, 15 insertions(+), 9 deletions(-) New commits: commit 6b7f07e3dbd990fd63c707d9297b4715e6e3957d Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Fri Apr 25 00:54:47 2014 -0400 fdo#77728: Re-compile tokens when named range is updated. Change-Id: Icd9f8c60d9e105478abb5b5ad64e969623830a4c (cherry picked from commit dafce0665c852297d39cddf76f46c77c14a8f12a) Reviewed-on: https://gerrit.libreoffice.org/9157 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 9ff510c..99d2626 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -2116,6 +2116,16 @@ class UpdateRefOnNonCopy : std::unary_functionsc::FormulaGroupEntry, void ScDocument* mpUndoDoc; bool mbUpdated; +void recompileTokenArray( ScFormulaCell rTopCell ) +{ +// We need to re-compile the token array when a range name is +// modified, to correctly reflect the new references in the +// name. +ScCompiler aComp(mpCxt-mrDoc, rTopCell.aPos, *rTopCell.GetCode()); +aComp.SetGrammar(mpCxt-mrDoc.GetGrammar()); +aComp.CompileTokenArray(); +} + void updateRefOnShift( sc::FormulaGroupEntry rGroup ) { if (!rGroup.mbShared) @@ -2149,7 +2159,10 @@ class UpdateRefOnNonCopy : std::unary_functionsc::FormulaGroupEntry, void aRes.mbValueChanged = true; } -if (aRes.mbReferenceModified) +if (aRes.mbNameModified) +recompileTokenArray(*pTop); + +if (aRes.mbReferenceModified || aRes.mbNameModified) { sc::StartListeningContext aStartCxt(mpCxt-mrDoc); sc::EndListeningContext aEndCxt(mpCxt-mrDoc, pOldCode.get()); @@ -2221,14 +2234,7 @@ class UpdateRefOnNonCopy : std::unary_functionsc::FormulaGroupEntry, void sc::AutoCalcSwitch(mpCxt-mrDoc, false); if (aRes.mbNameModified) -{ -// We need to re-compile the token array when a range name is -// modified, to correctly reflect the new references in the -// name. -ScCompiler aComp(mpCxt-mrDoc, aPos, *pCode); -aComp.SetGrammar(mpCxt-mrDoc.GetGrammar()); -aComp.CompileTokenArray(); -} +recompileTokenArray(*pTop); // Perform end-listening, start-listening, and dirtying on all // formula cells in the group. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/unoobj/chart2uno.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 45b959806da456adf3ba3a1e4f08130480ccf89c Author: Markus Mohrhard markus.mohrh...@collabora.co.uk Date: Thu Apr 17 02:02:15 2014 +0200 limit the range shrinking in charts to really large ranges, fdo#70609, Also improves the situation for fdo#55697. It is just the fist step to a better algorithm. Change-Id: I15de1ca6604e585fcf5690f0d903c757d641e765 Reviewed-on: https://gerrit.libreoffice.org/9078 Reviewed-by: Andras Timar andras.ti...@collabora.com Tested-by: Andras Timar andras.ti...@collabora.com diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 8754057..093dbbe 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -1372,6 +1372,8 @@ bool lcl_addUpperLeftCornerIfMissing(vectorScTokenRef rRefTokens, return true; } +#define SHRINK_RANGE_THRESHOLD 1 + class ShrinkRefTokenToDataRange : std::unary_functionScTokenRef, void { ScDocument* mpDoc; @@ -1391,6 +1393,9 @@ public: ScSingleRefData s = rData.Ref1; ScSingleRefData e = rData.Ref2; +if(abs((e.Col()-s.Col())*(e.Row()-s.Row())) SHRINK_RANGE_THRESHOLD) +return; + SCCOL nMinCol = MAXCOL, nMaxCol = 0; SCROW nMinRow = MAXROW, nMaxRow = 0; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/view/tabview3.cxx |3 --- 1 file changed, 3 deletions(-) New commits: commit 44c9235ba8ab513451fcc6cd5dbdf82c577481f1 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Wed Apr 16 11:08:46 2014 -0400 fdo#75026: Sometimes we need to update grid view while not being active. For example when jumping to mark in the non-active window triggered by hyperlink in the active one. The jump-to-mark command gets dispatched before the new window is officially activated. Change-Id: I4e9c126b061ee3af4440e36d1ba6d796eb1c3539 (cherry picked from commit 52cc88d6191ba0c4b6477e5c4b9c5d0f0228030d) Reviewed-on: https://gerrit.libreoffice.org/9068 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 92aaadc..2a79b15 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -2112,9 +2112,6 @@ void ScTabView::PaintRangeFinderEntry (ScRangeFindData* pData, const SCTAB nTab) void ScTabView::UpdateGrid() { -if (!aViewData.IsActive()) -return; - if (!UpdateVisibleRange()) // Visible range hasn't changed. No need to re-paint. return; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/column2.cxx |9 - 1 file changed, 9 deletions(-) New commits: commit 9585ea8a3f10be60c42b671a07dfafd78f173e52 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Wed Apr 16 14:40:09 2014 -0400 fdo#74555: Avoid excessive calls to GetPreviewCellStyle(). GetOptimalHeight() gets called *all the time* and is very performance sensitive. Let's not do an expensive operation such as GetPreviewCellStyle() which slows down pretty much everything else after the non-default font is applied. Change-Id: I5d5b2e706dd5dd98173044642b98ccaedd9536f0 (cherry picked from commit 947177a5cb79e03a415d9c3d1203420c874d2b35) Reviewed-on: https://gerrit.libreoffice.org/9074 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index f6825e2..465ae23 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -775,15 +775,6 @@ void ScColumn::GetOptimalHeight( ::boost::ptr_vectorScPatternAttr aAltPatterns; while ( pPattern ) { -// GetOptimalHeight called for preview style needs to -// use really use the style -if ( ScStyleSheet* pStyle = pDocument-GetPreviewCellStyle( nCol, nStartRow, nTab ) ) -{ -aAltPatterns.push_back( new ScPatternAttr( *pPattern ) ); -ScPatternAttr* pModifiedPatt = aAltPatterns.back(); -pModifiedPatt-SetStyleSheet( pStyle ); -pPattern = pModifiedPatt; -} const ScMergeAttr* pMerge = (const ScMergeAttr*)pPattern-GetItem(ATTR_MERGE); const ScMergeFlagAttr* pFlag = (const ScMergeFlagAttr*)pPattern-GetItem(ATTR_MERGE_FLAG); if ( pMerge-GetRowMerge() 1 || pFlag-IsOverlapped() ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/undo/undoblk3.cxx | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) New commits: commit 8d63fce4ec73aa4ee9fd5348fe675e4f0b0a3b6b Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Wed Apr 16 15:17:13 2014 -0400 fdo#74687: Undo redo of format-only changes don't need broadcasting. Also discovered that the undo path was broadcasting twice. Let's only do it once. Change-Id: I169f1659aecb1eb78be3a497e244f79c5883e50f (cherry picked from commit 1d1fbbe81b4435765d3f69c6bcae2840dc629912) Reviewed-on: https://gerrit.libreoffice.org/9075 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 3239b1c..a06a076 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -141,7 +141,6 @@ void ScUndoDeleteContents::DoChange( const sal_Bool bUndo ) aCopyRange.aEnd.SetTab(nTabCount-1); pUndoDoc-CopyToDocument( aCopyRange, nUndoFlags, bMulti, pDoc, aMarkData ); -BroadcastChanges(aCopyRange); DoSdrUndoAction( pDrawUndo, pDoc ); @@ -183,7 +182,10 @@ void ScUndoDeleteContents::Undo() DoChange( sal_True ); EndUndo(); -BroadcastChanges(aRange); +if (nFlags IDF_CONTENTS) +// Broadcast only when the content changes. fdo#74687 +BroadcastChanges(aRange); + HelperNotifyChanges::NotifyIfChangesListeners(*pDocShell, aRange); } @@ -193,7 +195,10 @@ void ScUndoDeleteContents::Redo() DoChange( false ); EndRedo(); -BroadcastChanges(aRange); +if (nFlags IDF_CONTENTS) +// Broadcast only when the content changes. fdo#74687 +BroadcastChanges(aRange); + HelperNotifyChanges::NotifyIfChangesListeners(*pDocShell, aRange); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/inc/gridwin.hxx |2 sc/source/ui/view/gridwin.cxx | 180 +- 2 files changed, 145 insertions(+), 37 deletions(-) New commits: commit f2aa4f23a75b48bb8e0d0c3fefa4de5634677e75 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Fri Apr 11 23:07:49 2014 -0400 fdo#74087: Inspect if a mis-spelled word is at cursor position... then decide whether to launch a spell candidate menu or a regular context menu. (cherry picked from commit cd22c3442389f69fc1cc14dd07b17f5a59498e5e) Conflicts: sc/source/ui/view/gridwin.cxx Change-Id: Ib121e9c6729e068c70ff216391f863639aa01951 Reviewed-on: https://gerrit.libreoffice.org/8943 Reviewed-by: Andras Timar andras.ti...@collabora.com Tested-by: Andras Timar andras.ti...@collabora.com diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 5ac059c..f67e1f6 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -274,6 +274,8 @@ class ScGridWindow : public Window, public DropTargetHelper, public DragSourceHe boolGetEditUrl( const Point rPos, OUString* pName=0, OUString* pUrl=0, OUString* pTarget=0 ); +bool IsSpellErrorAtPos( const Point rPos, SCCOL nCol1, SCCOL nCol2, SCROW nRow ); + boolHitRangeFinder( const Point rMouse, RfCorner rCorner, sal_uInt16* pIndex = NULL, SCsCOL* pAddX = NULL, SCsROW* pAddY = NULL ); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index c7342e4..c49d9ea 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -135,6 +135,7 @@ #include vector #include boost/scoped_ptr.hpp +#include boost/shared_ptr.hpp using namespace com::sun::star; using ::com::sun::star::uno::Sequence; @@ -2950,6 +2951,10 @@ void ScGridWindow::Command( const CommandEvent rCEvt ) SCsROW nCellY = -1; pViewData-GetPosFromPixel(aPosPixel.X(), aPosPixel.Y(), eWhich, nCellX, nCellY); +bool bSpellError = false; +SCCOL nColSpellError = nCellX; +ScRefCellValue aSpellCheckCell; + if ( bMouse ) { ScDocument* pDoc = pViewData-GetDocument(); @@ -2972,14 +2977,39 @@ void ScGridWindow::Command( const CommandEvent rCEvt ) // Selecting this cell is not allowed, neither is context menu. return; +if (mpSpellCheckCxt) +{ +// Find the first string to the left for spell checking in case the current cell is empty. +ScAddress aPos(nCellX, nCellY, nTab); +aSpellCheckCell.assign(*pDoc, aPos); +while (aSpellCheckCell.meType == CELLTYPE_NONE) +{ +// Loop until we get the first non-empty cell in the row. +aPos.IncCol(-1); +if (aPos.Col() 0) +break; + +aSpellCheckCell.assign(*pDoc, aPos); +} + +if (aPos.Col() = 0 (aSpellCheckCell.meType == CELLTYPE_STRING || aSpellCheckCell.meType == CELLTYPE_EDIT)) +nColSpellError = aPos.Col(); + +bSpellError = (mpSpellCheckCxt-isMisspelled(nColSpellError, nCellY)); +if (bSpellError) +{ +// Check and see if a misspelled word is under the mouse pointer. +bSpellError = IsSpellErrorAtPos(aPosPixel, nColSpellError, nCellX, nCellY); +} +} + // #i18735# First select the item under the mouse pointer. // This can change the selection, and the view state (edit mode, etc). -SelectForContextMenu( aPosPixel, nCellX, nCellY ); +SelectForContextMenu(aPosPixel, bSpellError ? nColSpellError : nCellX, nCellY); } -sal_Bool bDone = false; -sal_Bool bEdit = pViewData-HasEditView(eWhich); -bool bSpellError = (mpSpellCheckCxt mpSpellCheckCxt-isMisspelled(nCellX, nCellY)); +bool bDone = false; +bool bEdit = pViewData-HasEditView(eWhich); if ( !bEdit ) { @@ -5114,7 +5144,53 @@ void ScGridWindow::RFMouseMove( const MouseEvent rMEvt, sal_Bool bUp ) pViewData-GetView()-ResetTimer(); } -// +namespace { + +SvxAdjust toSvxAdjust( const ScPatternAttr rPat ) +{ +SvxCellHorJustify eHorJust = +static_castSvxCellHorJustify( +static_castconst SvxHorJustifyItem(rPat.GetItem(ATTR_HOR_JUSTIFY)).GetValue()); + +SvxAdjust eSvxAdjust = SVX_ADJUST_LEFT; +switch (eHorJust) +{ +case SVX_HOR_JUSTIFY_LEFT: +case SVX_HOR_JUSTIFY_REPEAT:// nicht implementiert +case SVX_HOR_JUSTIFY_STANDARD: // always
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/formulacell.cxx |9 + 1 file changed, 9 insertions(+) New commits: commit c60c7d09e4d65b57ba448cf3de68391a51dcc1b5 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Fri Apr 11 21:37:54 2014 -0400 fdo#77307: Compare external formula tokens correctly. To avoid different external (add-in) tokens from being evaluated equal. Change-Id: If78187901bdca7fe0da50442b0bb66e0650dc70f (cherry picked from commit f9cc0daec26016722bf5260e4e2634e6dcfe25a2) Reviewed-on: https://gerrit.libreoffice.org/8942 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 78c4fb0..b96d0ad 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -3654,6 +3654,15 @@ ScFormulaCell::CompareState ScFormulaCell::CompareByTokenArray( ScFormulaCell r return NotEqual; } break; +case formula::svExternal: +{ +if (pThisTok-GetExternal() != pOtherTok-GetExternal()) +return NotEqual; + +if (pThisTok-GetByte() != pOtherTok-GetByte()) +return NotEqual; +} +break; default: ; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/view/viewfun2.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit db9a3bf0d7d14d945b9a371b485ecadba81a5919 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Fri Apr 11 12:31:29 2014 -0400 fdo#75970: Let's do it in a straightforward fashion. No idea what the intent of this weird static heap instantiation, but apparently it's not helping us. Change-Id: If6cccf649958b6cf01ede992c286af68eaeb31f6 (cherry picked from commit 0ffe4358c755504bc2754ef88edadde33b5f395a) Reviewed-on: https://gerrit.libreoffice.org/8939 Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 800523e..241d5dd 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -1638,8 +1638,8 @@ void ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem, if (nCommand == SVX_SEARCHCMD_FIND_ALL || nCommand == SVX_SEARCHCMD_REPLACE_ALL) { -static SearchResults *aSearchResults = new SearchResults(pDoc); -aSearchResults-Show(aMatchedRanges); +SearchResults aSearchResults(pDoc); +aSearchResults.Show(aMatchedRanges); rMark.ResetMark(); for (size_t i = 0, n = aMatchedRanges.size(); i n; ++i) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/column4.cxx | 54 ++-- 1 file changed, 30 insertions(+), 24 deletions(-) New commits: commit bb14c069cc58a9a4359299b4ad865f49eb495799 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Fri Apr 11 00:43:18 2014 -0400 fdo#77300: Don't re-compile formulas when the hybrid formula is not there. Change-Id: I9b0f8d031fec08bb8d92333ff67074fdc739e034 (cherry picked from commit 66c6a3bfc9cd89c562107d3d369b3d82bae94d68) (cherry picked from commit 0e63ca4fde4e446f346e35849c756a30ca294aab) Reviewed-on: https://gerrit.libreoffice.org/8928 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx index e25de16..aca38b7 100644 --- a/sc/source/core/data/column4.cxx +++ b/sc/source/core/data/column4.cxx @@ -213,23 +213,26 @@ public: ScFormulaCell* pTop = *rEntry.mpCells; OUString aFormula = pTop-GetHybridFormula(); -// Create a new token array from the hybrid formula string, and -// set it to the group. -ScCompiler aComp(mrCompileFormulaCxt, pTop-aPos); -ScTokenArray* pNewCode = aComp.CompileString(aFormula); -ScFormulaCellGroupRef xGroup = pTop-GetCellGroup(); -assert(xGroup); -xGroup-setCode(pNewCode); -xGroup-compileCode(*mpDoc, pTop-aPos, mpDoc-GetGrammar()); - -// Propagate the new token array to all formula cells in the group. -ScFormulaCell** pp = rEntry.mpCells; -ScFormulaCell** ppEnd = pp + rEntry.mnLength; -for (; pp != ppEnd; ++pp) +if (!aFormula.isEmpty()) { -ScFormulaCell* p = *pp; -p-SyncSharedCode(); -p-SetDirty(); +// Create a new token array from the hybrid formula string, and +// set it to the group. +ScCompiler aComp(mrCompileFormulaCxt, pTop-aPos); +ScTokenArray* pNewCode = aComp.CompileString(aFormula); +ScFormulaCellGroupRef xGroup = pTop-GetCellGroup(); +assert(xGroup); +xGroup-setCode(pNewCode); +xGroup-compileCode(*mpDoc, pTop-aPos, mpDoc-GetGrammar()); + +// Propagate the new token array to all formula cells in the group. +ScFormulaCell** pp = rEntry.mpCells; +ScFormulaCell** ppEnd = pp + rEntry.mnLength; +for (; pp != ppEnd; ++pp) +{ +ScFormulaCell* p = *pp; +p-SyncSharedCode(); +p-SetDirty(); +} } } else @@ -237,16 +240,19 @@ public: ScFormulaCell* pCell = rEntry.mpCell; OUString aFormula = pCell-GetHybridFormula(); -// Create token array from formula string. -ScCompiler aComp(mrCompileFormulaCxt, pCell-aPos); -ScTokenArray* pNewCode = aComp.CompileString(aFormula); +if (!aFormula.isEmpty()) +{ +// Create token array from formula string. +ScCompiler aComp(mrCompileFormulaCxt, pCell-aPos); +ScTokenArray* pNewCode = aComp.CompileString(aFormula); -// Generate RPN tokens. -ScCompiler aComp2(mpDoc, pCell-aPos, *pNewCode); -aComp2.CompileTokenArray(); +// Generate RPN tokens. +ScCompiler aComp2(mpDoc, pCell-aPos, *pNewCode); +aComp2.CompileTokenArray(); -pCell-SetCode(pNewCode); -pCell-SetDirty(); +pCell-SetCode(pNewCode); +pCell-SetDirty(); +} } } }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/xml/xmlexprt.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit c070fe636d75b74874c5e93f5cd5d19bd7af7e6d Author: Niklas Johansson sleeping.pil...@gmail.com Date: Fri Apr 11 13:07:09 2014 +0200 fdo#76961 - Calc link auto-update interval is changed on file save The commit fa0fe19e89ba68a6b02cbdd5eff6bc161024c53d accidentaly made the external links auto-update interval save seconds as milliseconds. This patch fixes the problem at least on Mac and Windows where I tested it. I also did a successful build on Fedora 20 with this patch that works as expected. Change-Id: Ia10d12fb678004a686a4eaa65e9e12f09378a440 Reviewed-on: https://gerrit.libreoffice.org/8934 Reviewed-by: Kohei Yoshida libreoff...@kohei.us Tested-by: Kohei Yoshida libreoff...@kohei.us (cherry picked from commit cf1d4c02c14772824a7149957fa119c6e290640b) Signed-off-by: Kohei Yoshida kohei.yosh...@collabora.com diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index d5c025d..c2ab4b2 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -836,7 +836,7 @@ void ScXMLExport::GetAreaLinks( ScMyAreaLinksContainer rAreaLinks ) aAreaLink.sFilter = pLink-GetFilter(); aAreaLink.sFilterOptions = pLink-GetOptions(); aAreaLink.sURL = pLink-GetFile(); -aAreaLink.nRefresh = pLink-GetTimeout(); +aAreaLink.nRefresh = pLink-GetRefreshDelay(); rAreaLinks.AddNewAreaLink( aAreaLink ); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/column3.cxx | 108 sc/source/ui/docshell/docsh8.cxx | 116 ++- 2 files changed, 165 insertions(+), 59 deletions(-) New commits: commit c73c6b24e64b0fbfb7feab62966ba967fbad8411 Author: Eike Rathke er...@redhat.com Date: Mon Mar 31 19:28:31 2014 +0200 re-enabled user-defined numeric fields for dBase export Since commit f59e350d1733125055f1144f8b3b1b0a46f6d1ca it was impossible to define a numeric field with a precision of less than 2 decimals, even if all values were integers. It was also impossible to define a field width larger than needed for any values in that column. Furthermore, the integer part was shortened if the overall column's values resulted in more precision than defined, but the overall length did not reach the predefined length. This does not change the behavior of the original intention of f59e350d1733125055f1144f8b3b1b0a46f6d1ca to give the precision of number formats precedence over precision defined in the column header, which is debatable though because conflicts may silently change the field definition. (cherry picked from commit e65141e93a540fc9fb4343ee65a5a7da7e3b1769) Plus comment translation. Conflicts: sc/source/ui/docshell/docsh8.cxx Change-Id: I234c4bceaa1a6aadbd259cb8d9b6cb6f16bf91c2 Reviewed-on: https://gerrit.libreoffice.org/8806 Reviewed-by: Kohei Yoshida libreoff...@kohei.us Tested-by: Kohei Yoshida libreoff...@kohei.us diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index d47893f..192efcb 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -2710,25 +2710,42 @@ class MaxNumStringLenHandler SvNumberFormatter* mpFormatter; sal_Int32 mnMaxLen; sal_uInt16 mnPrecision; +sal_uInt16 mnMaxGeneralPrecision; +bool mbHaveSigned; void processCell(size_t nRow, ScRefCellValue rCell) { -if (rCell.meType == CELLTYPE_FORMULA !rCell.mpFormula-IsValue()) -return; +sal_uInt16 nCellPrecision = mnMaxGeneralPrecision; +if (rCell.meType == CELLTYPE_FORMULA) +{ +if (!rCell.mpFormula-IsValue()) +return; + +// Limit unformatted formula cell precision to precision +// encountered so far, if any, otherwise we'd end up with 15 just +// because of =1/3 ... If no precision yet then arbitrarily limit +// to a maximum of 4 unless a maximum general precision is set. +if (mnPrecision) +nCellPrecision = mnPrecision; +else +nCellPrecision = (mnMaxGeneralPrecision = 15) ? 4 : mnMaxGeneralPrecision; +} + +double fVal = rCell.getValue(); +if (!mbHaveSigned fVal 0.0) +mbHaveSigned = true; OUString aString; +OUString aSep; +sal_Int32 nLen; +sal_uInt16 nPrec; sal_uInt32 nFormat = static_castconst SfxUInt32Item*( -mrColumn.GetAttr(nRow, ATTR_VALUE_FORMAT))-GetValue(); -ScCellFormat::GetInputString(rCell, nFormat, aString, *mpFormatter, mrColumn.GetDoc()); -sal_Int32 nLen = aString.getLength(); -if (nLen = 0) -// Ignore empty string. -return; - -if (nFormat) +mrColumn.GetAttr(nRow, ATTR_VALUE_FORMAT))-GetValue(); +if (nFormat % SV_COUNTRY_LANGUAGE_OFFSET) { +aSep = mpFormatter-GetFormatDecimalSep(nFormat); +ScCellFormat::GetInputString(rCell, nFormat, aString, *mpFormatter, mrColumn.GetDoc()); const SvNumberformat* pEntry = mpFormatter-GetEntry(nFormat); -sal_uInt16 nPrec; if (pEntry) { bool bThousand, bNegRed; @@ -2737,15 +2754,54 @@ class MaxNumStringLenHandler } else nPrec = mpFormatter-GetFormatPrecision(nFormat); +} +else +{ +if (mnPrecision = mnMaxGeneralPrecision) +return; // early bail out for nothing changes here -if (nPrec != SvNumberFormatter::UNLIMITED_PRECISION nPrec mnPrecision) -mnPrecision = nPrec; +if (!fVal) +{ +// 0 doesn't change precision, but set a maximum length if none yet. +if (!mnMaxLen) +mnMaxLen = 1; +return; +} + +// Simple number string with at most 15 decimals and trailing +// decimal zeros eliminated. +aSep = .; +aString = rtl::math::doubleToUString( fVal, rtl_math_StringFormat_F, nCellPrecision, '.', true); +nPrec = SvNumberFormatter::UNLIMITED_PRECISION; } +nLen = aString.getLength(); +if (nLen = 0) +
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/view/output2.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 4a2c3371f3ca1cc05732041c96cff9bf494bddb6 Author: Hannah Lyhne hdlyh...@gmail.com Date: Tue Apr 1 07:55:39 2014 -0400 fdo#73588: fix default alignment in RTL mode. (cherry picked from commit 036b1fccbfb87a1aab36632843deb29e0a70630f) Change-Id: Icb932ee51dbf32d8baf4382aa00e89a680f5a41d Signed-off-by: Kohei Yoshida kohei.yosh...@collabora.com diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 9c09b5c..544e737 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -1432,7 +1432,10 @@ static SvxCellHorJustify getAlignmentFromContext( SvxCellHorJustify eInHorJust, else if (nDirection == FRMDIR_ENVIRONMENT) { SAL_WARN_IF( !pDoc, sc.ui, getAlignmentFromContext - pDoc==NULL); -eHorJustContext = (pDoc pDoc-IsLayoutRTL(nTab)) ? SVX_HOR_JUSTIFY_RIGHT : SVX_HOR_JUSTIFY_LEFT; +// fdo#73588: The content of the cell must also +// begin with a RTL character to be right +// aligned; otherwise, it should be left aligned. +eHorJustContext = (pDoc pDoc-IsLayoutRTL(nTab) (beginsWithRTLCharacter( rText))) ? SVX_HOR_JUSTIFY_RIGHT : SVX_HOR_JUSTIFY_LEFT; } else eHorJustContext = SVX_HOR_JUSTIFY_RIGHT; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/ui/inc/namedlg.hxx |5 +++-- sc/source/ui/inc/namemgrtable.hxx | 12 sc/source/ui/namedlg/namedlg.cxx | 17 +++-- sc/source/ui/namedlg/namemgrtable.cxx | 14 -- 4 files changed, 34 insertions(+), 14 deletions(-) New commits: commit 83fe3fb4aa94a8d0e86e944546c277255db2c58c Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Tue Apr 8 14:34:13 2014 -0400 fdo#71729: Fill the range edit boxes after the table is fully initialized. Otherwise the range formula expression would not be available yet. (cherry picked from commit ffaaf35206b8f049bb9e9ffd7a85c8ebd758a21c) Conflicts: sc/source/ui/namedlg/namedlg.cxx Change-Id: If9c5040366f9038e8094fd5448ca5e4ee2e73edd Reviewed-on: https://gerrit.libreoffice.org/8896 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/ui/inc/namedlg.hxx b/sc/source/ui/inc/namedlg.hxx index b6ed196..020c88f 100644 --- a/sc/source/ui/inc/namedlg.hxx +++ b/sc/source/ui/inc/namedlg.hxx @@ -43,7 +43,7 @@ class ScDocument; //== //logic behind the manage names dialog -class ScNameDlg : public ScAnyRefDlg +class ScNameDlg : public ScAnyRefDlg, public ScRangeManagerTable::InitListener { private: Edit* m_pEdName; @@ -133,9 +133,10 @@ public: virtual voidSetActive(); virtual sal_BoolClose(); +virtual void tableInitialized() SAL_OVERRIDE; + void GetRangeNames(boost::ptr_mapOUString, ScRangeName rRangeMap); void SetEntry(const OUString rName, const OUString rScope); - }; diff --git a/sc/source/ui/inc/namemgrtable.hxx b/sc/source/ui/inc/namemgrtable.hxx index 5e5a8ca..a0341bc 100644 --- a/sc/source/ui/inc/namemgrtable.hxx +++ b/sc/source/ui/inc/namemgrtable.hxx @@ -35,6 +35,14 @@ struct ScRangeNameLine //Need some sort of a filter to handle several range names class SC_DLLPUBLIC ScRangeManagerTable : public SvSimpleTable { +public: +class InitListener +{ +public: +virtual ~InitListener(); +virtual void tableInitialized() = 0; +}; + private: OUString maGlobalString; @@ -46,6 +54,8 @@ private: std::mapSvTreeListEntry*, bool maCalculatedFormulaEntries; const ScAddress maPos; +InitListener* mpInitListener; + void GetLine(ScRangeNameLine aLine, SvTreeListEntry* pEntry); void Init(); void CheckForFormulaString(); @@ -60,6 +70,8 @@ public: virtual void Resize(); virtual void StateChanged( StateChangedType nStateChange ); +void setInitListener( InitListener* pListener ); + void addEntry( const ScRangeNameLine rLine, bool bSetCurEntry = true ); void DeleteSelectedEntries(); void SetEntry( const ScRangeNameLine rLine ); diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx index b013ba5..20a1db0 100644 --- a/sc/source/ui/namedlg/namedlg.cxx +++ b/sc/source/ui/namedlg/namedlg.cxx @@ -118,6 +118,7 @@ void ScNameDlg::Init() pCtrl-set_height_request(pCtrl-GetTextHeight()*12); m_pRangeManagerTable = new ScRangeManagerTable(*pCtrl, maRangeMap, maCursorPos); +m_pRangeManagerTable-setInitListener(this); m_pRangeManagerTable-SetSelectHdl( LINK( this, ScNameDlg, SelectionChangedHdl_Impl ) ); m_pRangeManagerTable-SetDeselectHdl( LINK( this, ScNameDlg, SelectionChangedHdl_Impl ) ); @@ -145,15 +146,7 @@ void ScNameDlg::Init() m_pLbScope-InsertEntry(aTabName); } - - -if (m_pRangeManagerTable-GetSelectionCount()) -{ -SelectionChanged(); -} - CheckForEmptyTable(); - } sal_Bool ScNameDlg::IsRefInputMode() const @@ -186,6 +179,12 @@ sal_Bool ScNameDlg::Close() return DoClose( ScNameDlgWrapper::GetChildWindowId() ); } +void ScNameDlg::tableInitialized() +{ +if (m_pRangeManagerTable-GetSelectionCount()) +SelectionChanged(); +} + void ScNameDlg::CheckForEmptyTable() { if (!m_pRangeManagerTable-GetEntryCount()) @@ -417,8 +416,6 @@ void ScNameDlg::NameModified() void ScNameDlg::SelectionChanged() { - - //don't update if we have just modified due to user input if (!mbNeedUpdate) { diff --git a/sc/source/ui/namedlg/namemgrtable.cxx b/sc/source/ui/namedlg/namemgrtable.cxx index e8f831e..c2666bc 100644 --- a/sc/source/ui/namedlg/namemgrtable.cxx +++ b/sc/source/ui/namedlg/namemgrtable.cxx @@ -33,11 +33,14 @@ static OUString createEntryString(const ScRangeNameLine rLine) return aRet; } +ScRangeManagerTable::InitListener::~InitListener() {} + ScRangeManagerTable::ScRangeManagerTable( SvSimpleTableContainer rParent, boost::ptr_mapOUString, ScRangeName rRangeMap, const ScAddress rPos ): SvSimpleTable( rParent, WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP ), maGlobalString( ScGlobal::GetRscString(STR_GLOBAL_SCOPE)), mrRangeMap( rRangeMap
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/filter/excel/xestream.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 2dd84cf254f28523c3ff7f014fdbc515e9b89daa Author: Eike Rathke er...@redhat.com Date: Wed Apr 2 16:54:17 2014 +0200 resolved fdo#76949 correct grammar is GRAM_OOXML Regression introduced with ca8ca8c28742879220f3ff88ae0d71c8d69b11cd that used GRAM_ENGLISH_XL_OOX instead, which is English UI function names with OOXML reference syntax. Change-Id: If6b73e85a45e57f6ef281d1edf8e34dec7cb9bb8 (cherry picked from commit 31e4419ac7581aa7864905bcd4ce42e14df6c9bb) Reviewed-on: https://gerrit.libreoffice.org/8817 Reviewed-by: Kohei Yoshida libreoff...@kohei.us Tested-by: Kohei Yoshida libreoff...@kohei.us diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index 3e9935d..035a827 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -824,7 +824,7 @@ OUString XclXmlUtils::ToOUString( ScDocument rDocument, const ScAddress rAddress, const ScTokenArray* pTokenArray ) { ScCompiler aCompiler( rDocument, rAddress, const_castScTokenArray(*pTokenArray)); -aCompiler.SetGrammar(FormulaGrammar::GRAM_ENGLISH_XL_OOX); +aCompiler.SetGrammar(FormulaGrammar::GRAM_OOXML); OUStringBuffer aBuffer( pTokenArray-GetLen() * 5 ); aCompiler.CreateStringFromTokenArray( aBuffer ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/source
sc/source/core/data/document.cxx | 101 --- 1 file changed, 32 insertions(+), 69 deletions(-) New commits: commit 9ae833b62956a6d86772e2d2bf83a7391f322b00 Author: Kohei Yoshida kohei.yosh...@collabora.com Date: Fri Mar 28 20:50:29 2014 -0400 rhbz#1080196: Delete the destination first then paste. Deleting in-between pasting was causing the block iterators to become invalid when the deletion took place, which resulted in a segfault. Also cleaned up the bits about handling filtered rows. It was using the old row flag which is empty these days (so it never would have worked). Plus we do bail out earlier if the destination contains a filtered row. Change-Id: I78d3ee8bce1647c1c8685f92a3df3c38cc014811 (cherry picked from commit 2ec45841b97a994ef9dca854e142598a063877fd) Reviewed-on: https://gerrit.libreoffice.org/8786 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index e45bd02..90128ef 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2775,21 +2775,6 @@ void ScDocument::CopyFromClip( const ScRange rDestRange, const ScMarkData rMar SetAutoCalc( bOldAutoCalc ); } -static SCROW lcl_getLastNonFilteredRow( -const ScBitMaskCompressedArraySCROW, sal_uInt8 rFlags, SCROW nBegRow, SCROW nEndRow, -SCROW nRowCount) -{ -SCROW nFilteredRow = rFlags.GetFirstForCondition( -nBegRow, nEndRow, CR_FILTERED, CR_FILTERED); - -SCROW nRow = nFilteredRow - 1; -if (nRow - nBegRow + 1 nRowCount) -// make sure the row range stays within the data size. -nRow = nBegRow + nRowCount - 1; - -return nRow; -} - void ScDocument::CopyMultiRangeFromClip( const ScAddress rDestPos, const ScMarkData rMark, sal_uInt16 nInsFlag, ScDocument* pClipDoc, bool bResetCut, bool bAsLink, bool /*bIncludeFiltered*/, bool bSkipAttrForEmpty) @@ -2801,83 +2786,62 @@ void ScDocument::CopyMultiRangeFromClip( // There is nothing in the clip doc to copy. return; -bool bOldAutoCalc = GetAutoCalc(); -SetAutoCalc( false ); // avoid multiple recalculations +// Right now, we don't allow pasting into filtered rows, so we don't even handle it here. +sc::AutoCalcSwitch aACSwitch(*this, false); // turn of auto calc temporarily. NumFmtMergeHandler aNumFmtMergeHdl(this, pClipDoc); +ScRange aDestRange; +rMark.GetMarkArea(aDestRange); + +bInsertingFromOtherDoc = true; // kein Broadcast/Listener aufbauen bei Insert + SCCOL nCol1 = rDestPos.Col(); SCROW nRow1 = rDestPos.Row(); ScClipParam rClipParam = pClipDoc-GetClipParam(); +if (!bSkipAttrForEmpty) +{ +// Do the deletion first. +sal_uInt16 nDelFlag = IDF_CONTENTS; +SCCOL nColSize = rClipParam.getPasteColSize(); +SCROW nRowSize = rClipParam.getPasteRowSize(); + +DeleteArea(nCol1, nRow1, nCol1+nColSize-1, nRow1+nRowSize-1, rMark, nDelFlag); +} + sc::CopyFromClipContext aCxt(*this, NULL, pClipDoc, nInsFlag, bAsLink, bSkipAttrForEmpty); std::pairSCTAB,SCTAB aTabRanges = getMarkedTableRange(maTabs, rMark); aCxt.setTabRange(aTabRanges.first, aTabRanges.second); -ScRange aDestRange; -rMark.GetMarkArea(aDestRange); -SCROW nLastMarkedRow = aDestRange.aEnd.Row(); - -bInsertingFromOtherDoc = true; // kein Broadcast/Listener aufbauen bei Insert - -SCROW nBegRow = nRow1; -sal_uInt16 nDelFlag = IDF_CONTENTS; -const ScBitMaskCompressedArraySCROW, sal_uInt8 rFlags = GetRowFlagsArray(aCxt.getTabStart()); - -for ( size_t i = 0, n = rClipParam.maRanges.size(); i n; ++i ) +for (size_t i = 0, n = rClipParam.maRanges.size(); i n; ++i) { -ScRange* p = rClipParam.maRanges[ i ]; -// The begin row must not be filtered. +ScRange* p = rClipParam.maRanges[i]; SCROW nRowCount = p-aEnd.Row() - p-aStart.Row() + 1; - SCsCOL nDx = static_castSCsCOL(nCol1 - p-aStart.Col()); -SCsROW nDy = static_castSCsROW(nBegRow - p-aStart.Row()); +SCsROW nDy = static_castSCsROW(nRow1 - p-aStart.Row()); SCCOL nCol2 = nCol1 + p-aEnd.Col() - p-aStart.Col(); +SCROW nEndRow = nRow1 + nRowCount - 1; -SCROW nEndRow = lcl_getLastNonFilteredRow(rFlags, nBegRow, nLastMarkedRow, nRowCount); - -if (!bSkipAttrForEmpty) -DeleteArea(nCol1, nBegRow, nCol2, nEndRow, rMark, nDelFlag); +CopyBlockFromClip(aCxt, nCol1, nRow1, nCol2, nEndRow, rMark, nDx, nDy); -CopyBlockFromClip(aCxt, nCol1, nBegRow, nCol2, nEndRow, rMark, nDx, nDy); -nRowCount -= nEndRow - nBegRow + 1; - -while (nRowCount 0) +switch (rClipParam.meDirection) { -// Get the first non-filtered row. -SCROW nNonFilteredRow =