[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/data/table2.cxx| 26 ++ sc/source/ui/condformat/condformatdlg.cxx |8 sc/source/ui/condformat/condformatmgr.cxx | 14 +++--- sc/source/ui/view/cellsh1.cxx |5 - 4 files changed, 45 insertions(+), 8 deletions(-) New commits: commit 5c8e6ccaf6ea7a187e3d16f3d865cbed5eba0874 Author: Markus Mohrhard Date: Sat Jan 19 09:09:29 2013 +0100 copy styles from cond format between different docs, fdo#59159 Change-Id: I5472ab648b248d925f1f07cd4194c1201230ff20 diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 2d909c0..2ad97a6 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -671,6 +671,7 @@ void ScTable::CopyConditionalFormat( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCRO { ScRange aOldRange( nCol1 - nDx, nRow1 - nDy, pTable->nTab, nCol2 - nDx, nRow2 - nDy, pTable->nTab); ScRange aNewRange( nCol1, nRow1, nTab, nCol2, nRow2, nTab ); +bool bSameDoc = pDocument == pTable->pDocument; for(ScConditionalFormatList::const_iterator itr = pTable->mpCondFormatList->begin(), itrEnd = pTable->mpCondFormatList->end(); itr != itrEnd; ++itr) @@ -695,6 +696,29 @@ void ScTable::CopyConditionalFormat( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCRO pNewFormat->SetKey(nMax + 1); mpCondFormatList->InsertNew(pNewFormat); +if(!bSameDoc) +{ +for(size_t i = 0, n = pNewFormat->size(); +i < n; ++i) +{ +OUString aStyleName; +const ScFormatEntry* pEntry = pNewFormat->GetEntry(i); +if(pEntry->GetType() == condformat::CONDITION) +aStyleName = static_cast(pEntry)->GetStyle(); +else if(pEntry->GetType() == condformat::DATE) +aStyleName = static_cast(pEntry)->GetStyleName(); + +if(!aStyleName.isEmpty()) +{ +if(pDocument->GetStyleSheetPool()->Find(aStyleName, SFX_STYLE_FAMILY_PARA)) +continue; + +pDocument->GetStyleSheetPool()->CopyStyleFrom( +pTable->pDocument->GetStyleSheetPool(), aStyleName, SFX_STYLE_FAMILY_PARA ); +} +} +} + pDocument->AddCondFormatData( pNewFormat->GetRange(), nTab, pNewFormat->GetKey() ); } } @@ -980,7 +1004,9 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, } if(pDestTab->pDocument->IsUndo() && (nFlags & IDF_ATTRIB)) +{ pDestTab->mpCondFormatList.reset(new ScConditionalFormatList(pDestTab->pDocument, *mpCondFormatList)); +} if (pDBDataNoName) { commit e2170dd77ffbeda24aabb2b704deedd4440d7620 Author: Markus Mohrhard Date: Fri Jan 18 15:07:00 2013 +0100 prevent to create cond formats with empty range, fdo#58778 Change-Id: I54bac843dc60c419c23c6d3f22c8d2f4b5805327 diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 784f1ed..4bd4c05 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -467,12 +467,20 @@ void ScCondFormatDlg::SetReference(const ScRange& rRef, ScDocument*) ScConditionalFormat* ScCondFormatDlg::GetConditionalFormat() const { rtl::OUString aRangeStr = maEdRange.GetText(); +if(aRangeStr.isEmpty()) +return NULL; + ScRangeList aRange; sal_uInt16 nFlags = aRange.Parse(aRangeStr, mpDoc, SCA_VALID, mpDoc->GetAddressConvention(), maPos.Tab()); ScConditionalFormat* pFormat = maCondFormList.GetConditionalFormat(); if(nFlags & SCA_VALID && !aRange.empty() && pFormat) pFormat->AddRange(aRange); +else +{ +delete pFormat; +pFormat = NULL; +} return pFormat; } diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx index af9e383..977cc36 100644 --- a/sc/source/ui/condformat/condformatmgr.cxx +++ b/sc/source/ui/condformat/condformatmgr.cxx @@ -275,14 +275,14 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, AddBtnHdl) if(pDlg->Execute() == RET_OK) { ScConditionalFormat* pNewFormat = pDlg->GetConditionalFormat(); -if(!pNewFormat) -return 0; - -mpFormatList->InsertNew(pNewFormat); -pNewFormat->SetKey(FindKey(mpFormatList)); -maCtrlManager.Update(); +if(pNewFormat) +{ +mpFormatList->InsertNew(pNewFormat); +pNewFormat->SetKey(FindKey(mpFormatList)); +maCtrlManager.Update(); -mbModified = true; +mbModified = true; +} } Show(true, 0); pScMod->SetRefDialog( nId, false ); diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 5c4d42b..0c96dd5 100644 --- a/sc/source/ui/view/cel
[Libreoffice-commits] .: 2 commits - sc/source vcl/source
sc/source/core/data/colorscale.cxx |1 - sc/source/ui/condformat/condformatdlgentry.cxx |2 ++ vcl/source/window/split.cxx|2 +- 3 files changed, 3 insertions(+), 2 deletions(-) New commits: commit 0f6adf7a8cbccdb0a2697176a6e0e8cf58edd5fe Author: Markus Mohrhard Date: Sat Jan 12 07:22:31 2013 +0100 fix icon set rendering information creation, fdo#58610 Change-Id: Iad5dec601b54893ed809ab908671698919779ddb diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index f5d23c1..073fbdc 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -894,7 +894,6 @@ ScIconSetInfo* ScIconSetFormat::GetIconSetInfo(const ScAddress& rAddr) const sal_Int32 nIndex = 0; const_iterator itr = begin(); -++itr; double nValMax = CalcValue(nMin, nMax, itr); ++itr; diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 487842a..59ddfb3 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -1302,6 +1302,8 @@ void ScIconSetFrmtEntry::ScIconSetFrmtDataEntry::SetLastEntry() maEdEntry.Hide(); maLbEntryType.Hide(); maFtEntry.Hide(); +maLbEntryType.SelectEntryPos(1); +maEdEntry.SetText(OUString("100")); } ScIconSetFrmtEntry::ScIconSetFrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScIconSetFormat* pFormat ): commit c6f919c7288a7b59e9bad51d1452afba9a93c241 Author: Markus Mohrhard Date: Sat Jan 12 06:03:22 2013 +0100 we don't need to cast here Change-Id: I260c7a050c5998e5dca634ea5d5f43742bf604fe diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx index 9e79c8f..f174696 100644 --- a/vcl/source/window/split.cxx +++ b/vcl/source/window/split.cxx @@ -729,7 +729,7 @@ void Splitter::DataChanged( const DataChangedEvent& rDCEvt ) Window::DataChanged( rDCEvt ); if( rDCEvt.GetType() == DATACHANGED_SETTINGS ) { -AllSettings* pOldSettings = static_cast(rDCEvt.GetData()); +const AllSettings* pOldSettings = rDCEvt.GetOldSettings(); if(!pOldSettings) return; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/ui/docshell/dbdocfun.cxx | 146 +++-- sc/source/ui/inc/dbdocfun.hxx |2 sc/source/ui/view/dbfunc3.cxx |2 sc/source/ui/view/gridwin2.cxx |2 4 files changed, 146 insertions(+), 6 deletions(-) New commits: commit d99abd61a9091426bfccd871d6a8f036d5f49479 Author: Kohei Yoshida Date: Fri Jan 11 12:51:13 2013 -0500 Let's not return here to prevent memory leak. There are several heap objects that are deleted at the end of the method. Returning prematurely would leak those objects. Change-Id: If70cb3c9c02e47229d10b30f1542f7b25534d593 diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 403ecd3..d0e3ebb 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -1320,8 +1320,7 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb if ( pDestObj ) { pDestObj->ReloadGroupTableData(); -if (!pDestObj->SyncAllDimensionMembers()) -return false; +pDestObj->SyncAllDimensionMembers(); pDestObj->InvalidateData(); // before getting the new output area // make sure the table has a name (not set by dialog) commit feef29286f0a7c6abd512a07fce9ef48327e0a78 Author: Kohei Yoshida Date: Fri Jan 11 12:12:09 2013 -0500 Create a self-update variant of DataPilotUpdate(). DataPilotUpdate() is getting more and more complicated, with so many branches. Since self-updating a pivot table object is common, let's create a variant just for that. This variant has much less branching. Change-Id: I75b0512258a09961ef13516d8d9bc8a2939287e1 diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 3b1db2f..403ecd3 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -50,6 +50,7 @@ #include "progress.hxx" #include +#include using namespace ::com::sun::star; @@ -1448,6 +1449,144 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb return bDone; } +bool ScDBDocFunc::UpdatePivotTable(ScDPObject& rDPObj, bool bRecord, bool bApi) +{ +ScDocShellModificator aModificator( rDocShell ); +WaitObject aWait( rDocShell.GetActiveDialogParent() ); + +std::auto_ptr pOldUndoDoc; +std::auto_ptr pNewUndoDoc; + +ScDPObject aUndoDPObj(rDPObj); // For undo or revert on failure. + +ScDocument* pDoc = rDocShell.GetDocument(); +if (bRecord && !pDoc->IsUndoEnabled()) +bRecord = false; + +if (!rDocShell.IsEditable() || pDoc->GetChangeTrack()) +{ +// not recorded -> disallow +//! different error messages? +if (!bApi) +rDocShell.ErrorMessage(STR_PROTECTIONERR); + +return false; +} + +{ +ScEditableTester aTester(pDoc, rDPObj.GetOutRange()); +if (!aTester.IsEditable()) +{ +if (!bApi) +rDocShell.ErrorMessage(aTester.GetMessageId()); + +return false; +} +} + +if (bRecord) +{ +ScRange aRange = rDPObj.GetOutRange(); +SCTAB nTab = aRange.aStart.Tab(); +pOldUndoDoc.reset(new ScDocument(SCDOCMODE_UNDO)); +pOldUndoDoc->InitUndo( pDoc, nTab, nTab ); +pDoc->CopyToDocument(aRange, IDF_ALL, false, pOldUndoDoc.get()); +} + +rDPObj.SetAllowMove(false); +rDPObj.ReloadGroupTableData(); +if (!rDPObj.SyncAllDimensionMembers()) +return false; + +rDPObj.InvalidateData(); // before getting the new output area + +// make sure the table has a name (not set by dialog) +if (rDPObj.GetName().isEmpty()) +rDPObj.SetName( pDoc->GetDPCollection()->CreateNewName() ); + +bool bOverflow = false; +ScRange aNewOut = rDPObj.GetNewOutputRange(bOverflow); + +//! test for overlap with other data pilot tables +const ScSheetSourceDesc* pSheetDesc = rDPObj.GetSheetDesc(); +if (pSheetDesc && pSheetDesc->GetSourceRange().Intersects(aNewOut)) +{ +ScRange aOldRange = rDPObj.GetOutRange(); +SCsROW nDiff = aOldRange.aStart.Row()-aNewOut.aStart.Row(); +aNewOut.aStart.SetRow( aOldRange.aStart.Row() ); +aNewOut.aEnd.SetRow( aNewOut.aEnd.Row()+nDiff ); +if (!ValidRow(aNewOut.aStart.Row()) || !ValidRow(aNewOut.aEnd.Row())) +bOverflow = true; +} + +if (bOverflow) +{ +// like with STR_PROTECTIONERR, use undo to reverse everything +OSL_ENSURE( bRecord, "DataPilotUpdate: can't undo" ); + +if (!bApi) +rDocShell.ErrorMessage(STR_PIVOT_ERROR); + +rDPObj = aUndoDPObj; +return false; +} + +{ +ScEditableTester aTester(pDoc, aNewOut); +if (!aTester.IsEditable()) +{ +// destination area i
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/data/dpfilteredcache.cxx | 12 +++- sc/source/ui/docshell/dbdocfun.cxx |7 --- 2 files changed, 15 insertions(+), 4 deletions(-) New commits: commit 3db92283955741b490dc2d4f9e1782b179fee894 Author: Kohei Yoshida Date: Thu Jan 10 23:48:17 2013 -0500 fdo#59084: Sync dimension members after reloading the group data. Else the syncing would end up syncing to the older version of the group data before the reload, which (as you can see in the bug report) may lead to a crash. Change-Id: Ibd674a97a59205e5e28efd007f8857731e8df4d3 diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 4d0d2ec..94d4f1f 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -1319,6 +1319,8 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb if ( pDestObj ) { pDestObj->ReloadGroupTableData(); +if (!pDestObj->SyncAllDimensionMembers()) +return false; pDestObj->InvalidateData(); // before getting the new output area // make sure the table has a name (not set by dialog) @@ -1461,11 +1463,10 @@ sal_uLong ScDBDocFunc::RefreshPivotTables(ScDPObject* pDPObj, bool bApi) for (; it != itEnd; ++it) { ScDPObject* pObj = *it; -if (!pObj->SyncAllDimensionMembers()) -continue; // This action is intentionally not undoable since it modifies cache. -DataPilotUpdate(pObj, pObj, false, bApi); +if (!DataPilotUpdate(pObj, pObj, false, bApi)) +continue; } return 0; commit 6fae3211507884e23b305c1f55e7b1be7951f7a9 Author: Kohei Yoshida Date: Thu Jan 10 23:17:18 2013 -0500 Dump field member IDs cached in the filtered cache object. Change-Id: Id792e9e58a2c62b742eb07b400d30c5027bbc87b diff --git a/sc/source/core/data/dpfilteredcache.cxx b/sc/source/core/data/dpfilteredcache.cxx index ff82719..e3231ce 100644 --- a/sc/source/core/data/dpfilteredcache.cxx +++ b/sc/source/core/data/dpfilteredcache.cxx @@ -437,7 +437,7 @@ void ScDPFilteredCache::dumpRowFlag(const RowFlagType& rFlag) const void ScDPFilteredCache::dump() const { -cout << "--- pivot cache filter dump" << endl; +cout << "--- pivot filtered cache dump" << endl; cout << endl; cout << "* show by filter" << endl; @@ -447,6 +447,16 @@ void ScDPFilteredCache::dump() const cout << "* show by page dimensions" << endl; dumpRowFlag(maShowByPage); +cout << endl; +cout << "* field entries" << endl; +size_t nFieldCount = maFieldEntries.size(); +for (size_t i = 0; i < nFieldCount; ++i) +{ +const vector& rField = maFieldEntries[i]; +cout << " * field " << i << endl; +for (size_t j = 0, n = rField.size(); j < n; ++j) +cout << "ID: " << rField[j] << endl; +} cout << "---" << endl; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source xmloff/source
sc/source/ui/condformat/condformatdlgentry.cxx |1 + xmloff/source/draw/shapeexport.cxx | 15 --- 2 files changed, 9 insertions(+), 7 deletions(-) New commits: commit d5b628720d78ccf842152db955a145473edbe14c Author: Markus Mohrhard Date: Wed Jan 9 04:45:22 2013 +0100 move some OSL_* macros to SAL_WARN Change-Id: I8a5e158eabdbb92eec27a5753004e4f5e826c412 diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 8a39d02..6d24694 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -513,9 +513,10 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape com::sun::star::awt::Point* pRefPoint /* = NULL */, SvXMLAttributeList* pAttrList /* = NULL */ ) { +SAL_WARN("xmloff", xShape->getShapeType()); if( maCurrentShapesIter == maShapesInfos.end() ) { -OSL_FAIL( "XMLShapeExport::exportShape(): no auto styles where collected before export" ); +SAL_WARN( "xmloff", "XMLShapeExport::exportShape(): no auto styles where collected before export" ); return; } sal_Int32 nZIndex = 0; @@ -548,7 +549,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape } catch(const uno::Exception&) { -OSL_FAIL("XMLShapeExport::exportShape(): exception during hyperlink export"); +SAL_WARN("xmloff", "XMLShapeExport::exportShape(): exception during hyperlink export"); } @@ -559,7 +560,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape if( (sal_Int32)aShapeInfoVector.size() <= nZIndex ) { -OSL_FAIL( "XMLShapeExport::exportShape(): no shape info collected for a given shape" ); +SAL_WARN( "xmloff", "XMLShapeExport::exportShape(): no shape info collected for a given shape" ); return; } @@ -586,7 +587,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape XmlShapeType eShapeType(XmlShapeTypeNotYetSet); ImpCalcShapeType(xShape, eShapeType); -DBG_ASSERT( eShapeType == aShapeInfo.meShapeType, "exportShape callings do not correspond to collectShapeAutoStyles calls!" ); +SAL_WARN_IF( eShapeType != aShapeInfo.meShapeType, "xmloff", "exportShape callings do not correspond to collectShapeAutoStyles calls!: " << xShape->getShapeType() ); } #endif @@ -915,7 +916,7 @@ void XMLShapeExport::collectShapesAutoStyles( const uno::Reference < drawing::XS for(sal_Int32 nShapeId = 0; nShapeId < nShapeCount; nShapeId++) { xShapes->getByIndex(nShapeId) >>= xShape; -DBG_ASSERT( xShape.is(), "Shape without a XShape?" ); +SAL_WARN_IF( !xShape.is(), "xmloff", "Shape without a XShape?" ); if(!xShape.is()) continue; @@ -938,7 +939,7 @@ void XMLShapeExport::exportShapes( const uno::Reference < drawing::XShapes >& xS for(sal_Int32 nShapeId = 0; nShapeId < nShapeCount; nShapeId++) { xShapes->getByIndex(nShapeId) >>= xShape; -DBG_ASSERT( xShape.is(), "Shape without a XShape?" ); +SAL_WARN_IF( !xShape.is(), "xmloff", "Shape without a XShape?" ); if(!xShape.is()) continue; @@ -1142,7 +1143,7 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x } catch(const uno::Exception&) { -OSL_FAIL( "XMLShapeExport::ImpCalcShapeType(), expected ole shape to have the CLSID property?" ); +SAL_WARN( "xmloff", "XMLShapeExport::ImpCalcShapeType(), expected ole shape to have the CLSID property?" ); } } else if(aType.match("Chart", 26)) { eShapeType = XmlShapeTypePresChartShape; } commit 46c8aadec35b7057e00053d7b808d60e5bdabc72 Author: Markus Mohrhard Date: Tue Jan 8 23:53:19 2013 +0100 set the list box entry for 3 entry color scales Change-Id: I5718d22e0c31bd645998bcbb508b31370cf36250 diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 15f6f42..3406982 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -506,6 +506,7 @@ ScFormulaFrmtEntry::ScFormulaFrmtEntry( Window* pParent, ScDocument* pDoc, const FreeResource(); maLbType.SelectEntryPos(2); +maLbColorFormat.SelectEntryPos(1); if(pFormat) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/data/documen4.cxx | 32 ++-- sc/source/filter/xml/xmlcelli.cxx |4 ++-- 2 files changed, 12 insertions(+), 24 deletions(-) New commits: commit 5bc348ae930b57f546238a8d24efebdd0972753c Author: Markus Mohrhard Date: Thu Jan 3 17:46:18 2013 +0100 make sure the column index is valid, fdo#58539 This is the first part of the fix for gnome#627150 Change-Id: I02cd8c553dd6b9a026c0ea38d77c6831fef6498e diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index 7e064ae..b3bb256 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -119,6 +119,8 @@ void ScDocument::InsertMatrixFormula(SCCOL nCol1, SCROW nRow1, { PutInOrder(nCol1, nCol2); PutInOrder(nRow1, nRow2); +nCol2 = std::min(nCol2, MAXCOL); +nRow2 = std::min(nRow2, MAXROW); if (!rMark.GetSelectCount()) { SAL_WARN("sc", "ScDocument::InsertMatrixFormula Keine Tabelle markiert"); diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 957cb67..398a49c 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -1063,8 +1063,8 @@ void ScXMLTableRowCellContext::AddFormulaCell( const ScAddress& rCellPos ) //value/text of each matrix cell later rXMLImport.GetTables().AddMatrixRange( rCellPos.Col(), rCellPos.Row(), -rCellPos.Col() + nMatrixCols - 1, -rCellPos.Row() + nMatrixRows - 1, +std::min(rCellPos.Col() + nMatrixCols - 1, MAXCOL), +std::min(rCellPos.Row() + nMatrixRows - 1, MAXROW), pOUFormula->first, pOUFormula->second, eGrammar); //set the value/text of the first matrix position (top-left). commit 95dbe79206b107a987914f8f97f26ca79da5dd2b Author: Markus Mohrhard Date: Thu Jan 3 15:16:57 2013 +0100 simplify this code a little bit and restore some of the old optimizations Change-Id: I1b42ed135bd3f8dfb663740a1bd2dbfa1216a388 diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index cc3b181..7e064ae 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -119,29 +119,14 @@ void ScDocument::InsertMatrixFormula(SCCOL nCol1, SCROW nRow1, { PutInOrder(nCol1, nCol2); PutInOrder(nRow1, nRow2); -SCTAB i, nTab1; -SCCOL j; -SCROW k; -i = 0; -bool bStop = false; -SCTAB nMax = static_cast(maTabs.size()); -ScMarkData::const_iterator itr = rMark.begin(), itrEnd = rMark.end(); -for (; itr != itrEnd && *itr < nMax; ++itr) +if (!rMark.GetSelectCount()) { -if (maTabs[i]) -{ -i = *itr; -bStop = true; -break; -} -} -nTab1 = i; -if (!bStop) -{ -OSL_FAIL("ScDocument::InsertMatrixFormula Keine Tabelle markiert"); +SAL_WARN("sc", "ScDocument::InsertMatrixFormula Keine Tabelle markiert"); return; } +SCTAB nTab1 = *rMark.begin(); + ScFormulaCell* pCell; ScAddress aPos( nCol1, nRow1, nTab1 ); if (pArr) @@ -149,7 +134,8 @@ void ScDocument::InsertMatrixFormula(SCCOL nCol1, SCROW nRow1, else pCell = new ScFormulaCell( this, aPos, rFormula, eGram, MM_FORMULA ); pCell->SetMatColsRows( nCol2 - nCol1 + 1, nRow2 - nRow1 + 1, bDirtyFlag ); -itr = rMark.begin(); +ScMarkData::const_iterator itr = rMark.begin(), itrEnd = rMark.end(); +SCTAB nMax = static_cast(maTabs.size()); for (; itr != itrEnd && *itr < nMax; ++itr) { if (maTabs[*itr]) @@ -186,9 +172,9 @@ void ScDocument::InsertMatrixFormula(SCCOL nCol1, SCROW nRow1, aRefData.nRelTab = *itr - nTab1; t->GetSingleRef() = aRefData; } -for (j = nCol1; j <= nCol2; j++) +for (SCCOL j = nCol1; j <= nCol2; j++) { -for (k = nRow1; k <= nRow2; k++) +for (SCROW k = nRow1; k <= nRow2; k++) { if (j != nCol1 || k != nRow1) // nicht in der ersten Zelle { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/data/conditio.cxx |4 ++-- sc/source/ui/view/cellsh1.cxx|1 + 2 files changed, 3 insertions(+), 2 deletions(-) New commits: commit d6fd3ccb105e164fdc826f1cafff2f5323194794 Author: Markus Mohrhard Date: Mon Dec 31 04:27:44 2012 +0100 handle strings correctly in ScCondFormatEntry::GetExpression, fdo#58781 Change-Id: I418837d4363c14779a4b2a7ce78c8b9e8df7f0d1 diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index d2206ba..9bb6977 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1288,9 +1288,9 @@ rtl::OUString ScConditionEntry::GetExpression( const ScAddress& rCursor, sal_uIn } else if (bIsStr1) { -aRet = ; +aRet = "\""; aRet += aStrVal1; -aRet += ; +aRet += "\""; } else mpDoc->GetFormatTable()->GetInputLineString(nVal1, nNumFmt, aRet); commit faa7667d4a249d1a497610a10c64ac54799c08f4 Author: Markus Mohrhard Date: Mon Dec 31 04:25:14 2012 +0100 don't add a new cond format if we just want to edit one, related fdo#58781 Change-Id: I2f48daa9b317c59515366206f9f17c7d219db5d0 diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index ec105f3..6d434ce 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -1825,6 +1825,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) const ScConditionalFormat* pCondFormat = pList->GetFormat(rCondFormats[0]); assert(pCondFormat); const ScRangeList& rCondFormatRange = pCondFormat->GetRange(); +nKey = pCondFormat->GetKey(); pCondFormatDlg.reset( new ScCondFormatDlg( pTabViewShell->GetDialogParent(), pDoc, pCondFormat, rCondFormatRange, aPos, condformat::dialog::NONE ) ); } else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/data/conditio.cxx | 34 ++--- sc/source/ui/condformat/condformatdlgentry.cxx | 10 +-- 2 files changed, 32 insertions(+), 12 deletions(-) New commits: commit 37f238837cdd2532363efe2af1735ab24cb9a1b9 Author: Markus Mohrhard Date: Tue Dec 18 23:05:29 2012 +0100 some small fixes for UI around date cond formats diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 3fc1612..b516670 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -1170,6 +1170,9 @@ ScDateFrmtEntry::ScDateFrmtEntry( Window* pParent, ScDocument* pDoc, const ScCon { sal_Int32 nPos = static_cast(pFormat->GetDateType()); maLbDateEntry.SelectEntryPos(nPos); + +rtl::OUString aStyleName = pFormat->GetStyleName(); +maLbStyle.SelectEntry(aStyleName); } } @@ -1180,6 +1183,7 @@ void ScDateFrmtEntry::Init() FillStyleListBox( mpDoc, maLbStyle ); maLbStyle.SetSelectHdl( LINK( this, ScDateFrmtEntry, StyleSelectHdl ) ); +maLbStyle.SelectEntryPos(1); } void ScDateFrmtEntry::SetActive() @@ -1193,9 +1197,9 @@ void ScDateFrmtEntry::SetActive() void ScDateFrmtEntry::SetInactive() { -maLbDateEntry.Show(); -maFtStyle.Show(); -maWdPreview.Show(); +maLbDateEntry.Hide(); +maFtStyle.Hide(); +maWdPreview.Hide(); Deselect(); } commit 31eee6b372539f0f1ccb82d9a8012e878d498d56 Author: Markus Mohrhard Date: Tue Dec 18 22:59:35 2012 +0100 handle last week/next week betweek different years, fdo#58340 diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 2b58f33..3dcc3be 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1684,24 +1684,40 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const return true; break; case condformat::LASTWEEK: -if( rActDate.GetYear() == aCellDate.GetYear() ) +if( rActDate.GetDayOfWeek() != SUNDAY ) { -if( rActDate.GetWeekOfYear( SUNDAY ) == aCellDate.GetWeekOfYear( SUNDAY ) + 1 ) -return true; +Date aBegin(rActDate - 8 - static_cast(rActDate.GetDayOfWeek())); +Date aEnd(rActDate - 2 -static_cast(rActDate.GetDayOfWeek())); +return aCellDate.IsBetween( aBegin, aEnd ); +} +else +{ +Date aBegin(rActDate - 8); +Date aEnd(rActDate - 1); +return aCellDate.IsBetween( aBegin, aEnd ); } break; case condformat::THISWEEK: -if( rActDate.GetYear() == aCellDate.GetYear() ) +if( rActDate.GetDayOfWeek() != SUNDAY ) { -if( rActDate.GetWeekOfYear( SUNDAY ) == aCellDate.GetWeekOfYear( SUNDAY ) ) -return true; +Date aBegin(rActDate - 1 - static_cast(rActDate.GetDayOfWeek())); +Date aEnd(rActDate + 5 - static_cast(rActDate.GetDayOfWeek())); +return aCellDate.IsBetween( aBegin, aEnd ); +} +else +{ +Date aEnd( rActDate + 6); +return aCellDate.IsBetween( rActDate, aEnd ); } break; case condformat::NEXTWEEK: -if( rActDate.GetYear() == aCellDate.GetYear() ) +if( rActDate.GetDayOfWeek() != SUNDAY ) { -if( rActDate.GetWeekOfYear( SUNDAY ) == aCellDate.GetWeekOfYear( SUNDAY ) - 1 ) -return true; +return aCellDate.IsBetween( rActDate + 6 - static_cast(rActDate.GetDayOfWeek()), rActDate + 12 - static_cast(rActDate.GetDayOfWeek()) ); +} +else +{ +return aCellDate.IsBetween( rActDate + 7, rActDate + 13 ); } break; case condformat::LASTMONTH: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/data/clipparam.cxx | 26 +- 1 file changed, 1 insertion(+), 25 deletions(-) New commits: commit 40af27d941ab578a341eefc63163b92d399262e7 Author: Markus Mohrhard Date: Wed Dec 19 16:55:35 2012 +0100 even simpler way to get the whole range diff --git a/sc/source/core/data/clipparam.cxx b/sc/source/core/data/clipparam.cxx index 002e0c4..3935141 100644 --- a/sc/source/core/data/clipparam.cxx +++ b/sc/source/core/data/clipparam.cxx @@ -112,28 +112,7 @@ SCROW ScClipParam::getPasteRowSize() ScRange ScClipParam::getWholeRange() const { -ScRange aWhole; -size_t nRangeSize = maRanges.size(); -if (nRangeSize < 1) -return aWhole; -aWhole = *maRanges[0]; -for ( size_t i = 1; i < nRangeSize; ++i ) -{ -const ScRange* p = maRanges[i]; - -if (aWhole.aStart.Col() > p->aStart.Col()) -aWhole.aStart.SetCol(p->aStart.Col()); - -if (aWhole.aStart.Row() > p->aStart.Row()) -aWhole.aStart.SetRow(p->aStart.Row()); - -if (aWhole.aEnd.Col() < p->aEnd.Col()) -aWhole.aEnd.SetCol(p->aEnd.Col()); - -if (aWhole.aEnd.Row() < p->aEnd.Row()) -aWhole.aEnd.SetRow(p->aEnd.Row()); -} -return aWhole; +return maRanges.Combine(); } void ScClipParam::transpose() commit 94deef9b29346a027b88f934b0ca83ef6a8bf846 Author: Rodolfo Ribeiro Gomes Date: Wed Dec 19 12:50:59 2012 -0200 Little optimisation when getting the whole range Just avoid "if" statement every iteration since the condition is true only at the first run Change-Id: I0f2f93196b2b28d457dfbb7b18f568abb45adcbb diff --git a/sc/source/core/data/clipparam.cxx b/sc/source/core/data/clipparam.cxx index 37094b6..002e0c4 100644 --- a/sc/source/core/data/clipparam.cxx +++ b/sc/source/core/data/clipparam.cxx @@ -113,16 +113,13 @@ SCROW ScClipParam::getPasteRowSize() ScRange ScClipParam::getWholeRange() const { ScRange aWhole; -bool bFirst = true; -for ( size_t i = 0, n = maRanges.size(); i < n; ++i ) +size_t nRangeSize = maRanges.size(); +if (nRangeSize < 1) +return aWhole; +aWhole = *maRanges[0]; +for ( size_t i = 1; i < nRangeSize; ++i ) { const ScRange* p = maRanges[i]; -if (bFirst) -{ -aWhole = *p; -bFirst = false; -continue; -} if (aWhole.aStart.Col() > p->aStart.Col()) aWhole.aStart.SetCol(p->aStart.Col()); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source vcl/inc
sc/source/ui/condformat/condformatdlgentry.cxx |4 ++-- sc/source/ui/condformat/condformatmgr.cxx |8 vcl/inc/vcl/dialog.hxx |4 +++- 3 files changed, 9 insertions(+), 7 deletions(-) New commits: commit 4dead7b1e54d3a0441a1eb6a7c067e3c8a9d9f5b Author: Markus Mohrhard Date: Mon Dec 3 21:02:50 2012 +0100 hide the manage cond format dialog when opening the cond format dlg Change-Id: Iee1e8344610e42f22c405c698fdfd82d59ca836e diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx index 295a83e..5a5ea1b 100644 --- a/sc/source/ui/condformat/condformatmgr.cxx +++ b/sc/source/ui/condformat/condformatmgr.cxx @@ -226,7 +226,7 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, EditBtnHdl) pScMod->SetRefDialog( nId, true ); boost::scoped_ptr pDlg(new ScCondFormatDlg(this, mpDoc, pFormat, pFormat->GetRange(), pFormat->GetRange().GetTopLeftCorner(), condformat::dialog::NONE)); -Disable(); +Show(false, 0); if(pDlg->Execute() == RET_OK) { sal_Int32 nKey = pFormat->GetKey(); @@ -241,7 +241,7 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, EditBtnHdl) maCtrlManager.Update(); mbModified = true; } -Enable(); +Show(true, 0); pScMod->SetRefDialog( nId, false ); @@ -272,7 +272,7 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, AddBtnHdl) pScMod->SetRefDialog( nId, true ); boost::scoped_ptr pDlg(new ScCondFormatDlg(this, mpDoc, NULL, ScRangeList(), maPos, condformat::dialog::CONDITION)); -Disable(); +Show(false, 0); if(pDlg->Execute() == RET_OK) { ScConditionalFormat* pNewFormat = pDlg->GetConditionalFormat(); @@ -285,7 +285,7 @@ IMPL_LINK_NOARG(ScCondFormatManagerDlg, AddBtnHdl) mbModified = true; } -Enable(); +Show(true, 0); pScMod->SetRefDialog( nId, false ); return 0; diff --git a/vcl/inc/vcl/dialog.hxx b/vcl/inc/vcl/dialog.hxx index 69ba0b5..3700c8b 100644 --- a/vcl/inc/vcl/dialog.hxx +++ b/vcl/inc/vcl/dialog.hxx @@ -154,12 +154,14 @@ public: ModalDialog( Window* pParent, const rtl::OString& rID, const rtl::OUString& rUIXMLDescription ); ModalDialog( Window* pParent, const ResId& rResId ); -private: +protected: using Window::Show; voidShow( sal_Bool bVisible = sal_True ); using Window::Hide; voidHide(); +private: + // Copy assignment is forbidden and not implemented. SAL_DLLPRIVATE ModalDialog (const ModalDialog &); SAL_DLLPRIVATE ModalDialog & operator= (const ModalDialog &); commit 2b9ba386d897e1ee53589b5a4a22918f6b5fd5e7 Author: Markus Mohrhard Date: Mon Dec 3 21:02:05 2012 +0100 workaround strange crash in dynamically created ref edit fields Change-Id: I8fc509e2e7f6e52209d49d7c866744dd2d3ba000 diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index f648bea..fe2d0e3 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -162,8 +162,8 @@ void FillStyleListBox( ScDocument* pDoc, ListBox& rLbStyle ) ScConditionFrmtEntry::ScConditionFrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry ): ScCondFrmtEntry( pParent, pDoc, rPos ), maLbCondType( this, ScResId( LB_CELLIS_TYPE ) ), -maEdVal1( this, static_cast(pParent->GetParent()), ScResId( ED_VAL1 ) ), -maEdVal2( this, static_cast(pParent->GetParent()), ScResId( ED_VAL2 ) ), +maEdVal1( this, NULL, ScResId( ED_VAL1 ) ), +maEdVal2( this, NULL, ScResId( ED_VAL2 ) ), maFtStyle( this, ScResId( FT_STYLE ) ), maLbStyle( this, ScResId( LB_STYLE ) ), maWdPreview( this, ScResId( WD_PREVIEW ) ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source svtools/inc svtools/source
sc/source/ui/src/xmlsourcedlg.src |2 +- svtools/inc/svtools/viewdataentry.hxx |1 + svtools/source/contnr/treelist.cxx | 10 +++--- svtools/source/contnr/viewdataentry.cxx |8 4 files changed, 13 insertions(+), 8 deletions(-) New commits: commit 215ec266e11e1a45c24fe982cd28b4d360680d3c Author: Kohei Yoshida Date: Wed Nov 28 16:09:22 2012 -0500 Try to reduce direct access/manipulation of the flag value. Change-Id: I252c1ad55099a821d3c1fec3c64255c4f26a0396 diff --git a/svtools/inc/svtools/viewdataentry.hxx b/svtools/inc/svtools/viewdataentry.hxx index 35b9a58..7f49f63 100644 --- a/svtools/inc/svtools/viewdataentry.hxx +++ b/svtools/inc/svtools/viewdataentry.hxx @@ -64,6 +64,7 @@ public: bool IsSelectable() const; void SetFocus( bool bFocus ); void SetCursored( bool bCursored ); +void SetSelected( bool bSelected ); sal_uInt16 GetFlags() const; void SetSelectable( bool bSelectable ); diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx index 9d752ef..9d4b6f9 100644 --- a/svtools/source/contnr/treelist.cxx +++ b/svtools/source/contnr/treelist.cxx @@ -979,7 +979,7 @@ sal_Bool SvTreeList::Select( SvListView* pView, SvTreeListEntry* pEntry, sal_Boo return sal_False; else { -pViewData->nFlags |= SVLISTENTRYFLAG_SELECTED; +pViewData->SetSelected(true); pView->nSelectionCount++; } } @@ -989,7 +989,7 @@ sal_Bool SvTreeList::Select( SvListView* pView, SvTreeListEntry* pEntry, sal_Boo return sal_False; else { -pViewData->nFlags &= ~( SVLISTENTRYFLAG_SELECTED ); +pViewData->SetSelected(false); pView->nSelectionCount--; } } @@ -1054,11 +1054,7 @@ void SvTreeList::SelectAll( SvListView* pView, sal_Bool bSelect ) while ( pEntry ) { SvViewDataEntry* pViewData = pView->GetViewData( pEntry ); -if ( bSelect ) -pViewData->nFlags |= SVLISTENTRYFLAG_SELECTED; -else -pViewData->nFlags &= (~SVLISTENTRYFLAG_SELECTED); - +pViewData->SetSelected(bSelect); pEntry = Next( pEntry ); } if ( bSelect ) diff --git a/svtools/source/contnr/viewdataentry.cxx b/svtools/source/contnr/viewdataentry.cxx index 5288466..9c3d2d3 100644 --- a/svtools/source/contnr/viewdataentry.cxx +++ b/svtools/source/contnr/viewdataentry.cxx @@ -86,6 +86,14 @@ void SvViewDataEntry::SetCursored( bool bCursored ) nFlags |= SVLISTENTRYFLAG_CURSORED; } +void SvViewDataEntry::SetSelected( bool bSelected ) +{ +if ( !bSelected ) +nFlags &= (~SVLISTENTRYFLAG_SELECTED); +else +nFlags |= SVLISTENTRYFLAG_SELECTED; +} + sal_uInt16 SvViewDataEntry::GetFlags() const { return nFlags; commit 918fa06314554d70fbc227b4c6ccf1000a29bb22 Author: Kohei Yoshida Date: Wed Nov 28 15:20:00 2012 -0500 Let's call this mapped cell rather than linked cell. Change-Id: I861b3ad248ce680ae3ced4c10eee151883ed4a9e diff --git a/sc/source/ui/src/xmlsourcedlg.src b/sc/source/ui/src/xmlsourcedlg.src index 009fc96..f690394 100644 --- a/sc/source/ui/src/xmlsourcedlg.src +++ b/sc/source/ui/src/xmlsourcedlg.src @@ -61,7 +61,7 @@ ModelessDialog RID_SCDLG_XML_SOURCE Pos = MAP_APPFONT( 145, 55 ); Size = MAP_APPFONT ( 100 , 8 ) ; -Text [ en-US ] = "Linked cell"; +Text [ en-US ] = "Mapped cell"; }; Edit ED_MAPPED_CELL ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/data/conditio.cxx |2 sc/source/ui/condformat/condformatdlgentry.cxx | 68 - 2 files changed, 45 insertions(+), 25 deletions(-) New commits: commit 93e57ac549abc41bdc875b9cbe5869c251f879a7 Author: Markus Mohrhard Date: Sun Nov 25 02:59:44 2012 +0100 style list should be sorted, fdo#51588 Change-Id: I771a17f2cc20602f2e6f8b18142eb990c473f2d4 diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index d9c5ec5..740f5fb 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1659,7 +1659,7 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& rPos ) const long nCurrentDate = aActDate - *(pFormatter->GetNullDate()); double nVal = mpDoc->GetValue(rPos); -long nCellDate = (long) ::rtl::Math::approxFloor(nVal); +long nCellDate = (long) ::rtl::math::approxFloor(nVal); Date aCellDate = *(pFormatter->GetNullDate()); aCellDate += (long) ::rtl::math::approxFloor(nVal); diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 05e9335..a1cac83 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -29,6 +29,8 @@ #include "globstr.hrc" +#include + ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScAddress& rPos): Control(pParent, ScResId( RID_COND_ENTRY ) ), mbActive(false), @@ -135,6 +137,27 @@ IMPL_LINK(ScCondFrmtEntry, EdModifyHdl, Edit*, pEdit) // //condition +// +namespace { + +void FillStlyeListBox( ScDocument* pDoc, ListBox& rLbStyle ) +{ +rLbStyle.SetSeparatorPos(0); +std::set aStyleNames; +SfxStyleSheetIterator aStyleIter( pDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA ); +for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next() ) +{ +rtl::OUString aName = pStyle->GetName(); +aStyleNames.insert(aName); +} +for(std::set::const_iterator itr = aStyleNames.begin(), itrEnd = aStyleNames.end(); +itr != itrEnd; ++itr) +{ +rLbStyle.InsertEntry( *itr ); +} +} + +} ScConditionFrmtEntry::ScConditionFrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos, const ScCondFormatEntry* pFormatEntry ): ScCondFrmtEntry( pParent, pDoc, rPos ), @@ -265,13 +288,7 @@ void ScConditionFrmtEntry::Init() maEdVal1.SetModifyHdl( LINK( this, ScCondFrmtEntry, EdModifyHdl ) ); maEdVal2.SetModifyHdl( LINK( this, ScCondFrmtEntry, EdModifyHdl ) ); -maLbStyle.SetSeparatorPos(0); -SfxStyleSheetIterator aStyleIter( mpDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA ); -for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next() ) -{ -rtl::OUString aName = pStyle->GetName(); -maLbStyle.InsertEntry( aName ); -} +FillStlyeListBox( mpDoc, maLbStyle ); maLbStyle.SetSelectHdl( LINK( this, ScConditionFrmtEntry, StyleSelectHdl ) ); maLbCondType.SetSelectHdl( LINK( this, ScConditionFrmtEntry, ConditionTypeSelectHdl ) ); @@ -433,13 +450,28 @@ void StyleSelect( ListBox& rLbStyle, ScDocument* pDoc, SvxFontPrevWindow& rWdPre // Find the new style and add it into the style list boxes rtl::OUString aNewStyle; SfxStyleSheetIterator aStyleIter( pDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA ); -for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next() ) +bool bFound = false; +for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle && !bFound; pStyle = aStyleIter.Next() ) { rtl::OUString aName = pStyle->GetName(); if ( rLbStyle.GetEntryPos(aName) == LISTBOX_ENTRY_NOTFOUND )// all lists contain the same entries { -rLbStyle.InsertEntry(aName); -rLbStyle.SelectEntry(aName); +for( sal_uInt16 i = 1, n = rLbStyle.GetEntryCount(); i <= n && !bFound; ++i) +{ +rtl::OUString aStyleName = ScGlobal::pCharClass->uppercase(rtl::OUString(rLbStyle.GetEntry(i))); +if( i == n ) +{ +rLbStyle.InsertEntry(aName); +rLbStyle.SelectEntry(aName); +bFound = true; +} +else if( aStyleName > ScGlobal::pCharClass->uppercase(aName) ) +{ +rLbStyle.InsertEntry(aName, i); +rLbStyle.SelectEntry(aName); +bFound = true; +} +} } } } @@ -488,16 +520,10 @@ ScFormulaFrmtEntry::ScFormulaFrmtEntry( Window* pParent, ScDocument* pDoc, const void ScFormulaFrmtEntry::Init() { -maLbStyle.SetSeparatorPos(0);
[Libreoffice-commits] .: 2 commits - sc/source svtools/inc
sc/source/core/data/table2.cxx |2 +- svtools/inc/svtools/ctrlbox.hxx |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit f44928cbd51fc7d08e2b81dcdf837650cd215847 Author: Markus Mohrhard Date: Sat Nov 17 18:46:14 2012 +0100 delete also note caption, fdo#56548 Change-Id: I1d792082e79d6bb68004a84c172cc3bb5c194826 diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 69e2f02..98a0fdd 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -549,7 +549,7 @@ void ScTable::DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal } if (nDelFlag & IDF_NOTE) -maNotes.erase( nCol1, nRow1, nCol2, nRow2, true ); +maNotes.erase( nCol1, nRow1, nCol2, nRow2 ); if (IsStreamValid()) // TODO: In the future we may want to check if the table has been commit 03798c0c6ee38878cac855835f1ab5ce8f4795f4 Author: Markus Mohrhard Date: Sat Nov 17 18:55:44 2012 +0100 fix error introduced by previous commit diff --git a/svtools/inc/svtools/ctrlbox.hxx b/svtools/inc/svtools/ctrlbox.hxx index 9f0f9f2..a160e11 100644 --- a/svtools/inc/svtools/ctrlbox.hxx +++ b/svtools/inc/svtools/ctrlbox.hxx @@ -85,7 +85,7 @@ units and window size need to be set. Supported units are typographic point All scalar numbers in 1/100 of the corresponding unit. Line1 is the outer, Line2 the inner line, Distance is the distance between -these two lines. If Line2 == 2, only Line1 will be shown. Defaults for +these two lines. If Line2 == 0, only Line1 will be shown. Defaults for source and target unit are FUNIT_POINT. SetColor() sets the line color. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source sw/qa
sc/source/core/data/attarray.cxx |3 ++- sc/source/core/data/column2.cxx |7 +-- sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 20 ++-- 3 files changed, 21 insertions(+), 9 deletions(-) New commits: commit 5115050d01ae4abbba18d07300614fad31dacadf Author: Michael Stahl Date: Wed Oct 31 16:37:57 2012 +0100 convert union SingleLineBorders to struct MSVC warns about the anonymous struct, and the way we write and read from the union is undefined. Change-Id: I683f54d90393a744e5c94857cd87800bcc8f9ffe diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 816c8d0..24618ff 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -404,13 +404,20 @@ void Test::testFdo47669() CPPUNIT_ASSERT_EQUAL(OUString("http://www.google.com/#a";), getProperty(getRun(getParagraph(1), 2), "HyperLinkURL")); } -union SingleLineBorders { +struct SingleLineBorders { +sal_Int16 top, bottom, left, right; SingleLineBorders(int t=0, int b=0, int l=0, int r=0) : top(t), bottom(b), left(l), right(r) {} -struct { -sal_Int16 top, bottom, left, right; -}; -sal_Int16 sizes[4]; +sal_Int16 getBorder(int i) const +{ +switch (i) { +case 0: return top; +case 1: return bottom; +case 2: return left; +case 3: return right; +default: assert(false); return 0; +} +} }; void Test::testTableBorders() { uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); @@ -458,7 +465,8 @@ void Test::testTableBorders() { { std::stringstream message; message << cells[i] << "'s " << borderNames[j] << " is incorrect"; -CPPUNIT_ASSERT_EQUAL_MESSAGE(message.str(), borders.sizes[j], aBorderLine.OuterLineWidth); +CPPUNIT_ASSERT_EQUAL_MESSAGE(message.str(), +borders.getBorder(j), aBorderLine.OuterLineWidth); } } } commit 70c3a6be0698e36ff80b7fc590d807ff37aab581 Author: Michael Stahl Date: Wed Oct 31 16:13:54 2012 +0100 sc: fix erroneous casts of ScCondFormatItem These cause valgrind warnings in sc_unoapi. (regression from d2b49b5b9bffdfa34174af96d85a392fde21fae1) Change-Id: If3128410bfabc23ff85c24156a8602379b8b7edd diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index 3965890..f47bb05 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -1320,7 +1320,8 @@ bool ScAttrArray::HasAttrib( SCROW nRow1, SCROW nRow2, sal_uInt16 nMask ) const else if ((SvxCellHorJustify)((const SvxHorJustifyItem&)pPattern-> GetItem( ATTR_HOR_JUSTIFY )).GetValue() == SVX_HOR_JUSTIFY_BLOCK) bFound = true; -else if (((const SfxUInt32Item&)pPattern->GetItem( ATTR_CONDITIONAL )).GetValue()) + +else if (!static_cast(pPattern->GetItem(ATTR_CONDITIONAL)).GetCondFormatData().empty()) bFound = true; else if (((const SfxInt32Item&)pPattern->GetItem( ATTR_ROTATE_VALUE )).GetValue()) bFound = true; diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 6a74d78..d90f79d 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -711,9 +711,12 @@ void ScColumn::GetOptimalHeight( SCROW nStartRow, SCROW nEndRow, sal_uInt16* pHe bStdOnly = !bBreak; // bedingte Formatierung: Zellen durchgehen -if ( bStdOnly && ((const SfxUInt32Item&)pPattern-> -GetItem(ATTR_CONDITIONAL)).GetValue() ) +if (bStdOnly && +!static_cast(pPattern->GetItem( +ATTR_CONDITIONAL)).GetCondFormatData().empty()) +{ bStdOnly = false; +} // gedrehter Text: Zellen durchgehen if ( bStdOnly && ((const SfxInt32Item&)pPattern-> ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/ui/condformat/colorformat.cxx| 23 ++- sc/source/ui/condformat/condformatdlgentry.cxx | 15 +-- sc/source/ui/inc/colorformat.hxx |8 ++-- sc/source/ui/inc/condformatdlgentry.hxx|2 -- 4 files changed, 21 insertions(+), 27 deletions(-) New commits: commit 2b44ae0a5b20b7e4392d7f034207ac20a888d5ae Author: Markus Mohrhard Date: Wed Oct 10 12:00:33 2012 +0200 also support formulas in the data bar dialog Change-Id: Ie86f935280667c8d9b4497fec7d519a212a452b6 diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx index 532c692..7983591 100644 --- a/sc/source/ui/condformat/colorformat.cxx +++ b/sc/source/ui/condformat/colorformat.cxx @@ -36,7 +36,7 @@ #include #include -ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, ScDocument* pDoc): +ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, ScDocument* pDoc, const ScAddress& rPos): ModalDialog( pWindow, ScResId( RID_SCDLG_DATABAR ) ), maBtnOk( this, ScResId( BTN_OK ) ), maBtnCancel( this, ScResId( BTN_CANCEL ) ), @@ -57,7 +57,9 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, ScDocument* pDoc): maLbAxisPos( this, ScResId( LB_AXIS_POSITION ) ), maEdMin( this, ScResId( ED_MIN ) ), maEdMax( this, ScResId( ED_MAX ) ), -mpNumberFormatter( pDoc->GetFormatTable() ) +mpNumberFormatter( pDoc->GetFormatTable() ), +mpDoc(pDoc), +maPos(rPos) { Init(); FreeResource(); @@ -74,7 +76,8 @@ void SetType(const ScColorScaleEntry* pEntry, ListBox& rLstBox) rLstBox.SelectEntryPos(pEntry->GetType()); } -void GetType(const ListBox& rLstBox, const Edit& rEd, ScColorScaleEntry* pEntry, SvNumberFormatter* pNumberFormatter ) +void GetType(const ListBox& rLstBox, const Edit& rEd, ScColorScaleEntry* pEntry, SvNumberFormatter* pNumberFormatter, +ScDocument* pDoc, const ScAddress& rPos ) { double nVal = 0; sal_uInt32 nIndex = 0; @@ -91,8 +94,8 @@ void GetType(const ListBox& rLstBox, const Edit& rEd, ScColorScaleEntry* pEntry, pNumberFormatter->IsNumberFormat( rEd.GetText(), nIndex, nVal ); pEntry->SetValue(nVal); break; -case 6: -//TODO: moggi +case COLORSCALE_FORMULA: +pEntry->SetFormula(rEd.GetText(), pDoc, rPos); break; } } @@ -109,7 +112,7 @@ void SetValue( ScColorScaleEntry* pEntry, Edit& aEdit) } -ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, const ScDataBarFormatData& rData, ScDocument* pDoc): +ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, const ScDataBarFormatData& rData, ScDocument* pDoc, const ScAddress& rPos): ModalDialog( pWindow, ScResId( RID_SCDLG_DATABAR ) ), maBtnOk( this, ScResId( BTN_OK ) ), maBtnCancel( this, ScResId( BTN_CANCEL ) ), @@ -131,7 +134,9 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(Window* pWindow, const ScDataBarForma maEdMin( this, ScResId( ED_MIN ) ), maEdMax( this, ScResId( ED_MAX ) ), maStrWarnSameValue( SC_RESSTR( STR_WARN_SAME_VALUE ) ), -mpNumberFormatter( pDoc->GetFormatTable() ) +mpNumberFormatter( pDoc->GetFormatTable() ), +mpDoc(pDoc), +maPos(rPos) { Init(); FreeResource(); @@ -240,8 +245,8 @@ ScDataBarFormatData* ScDataBarSettingsDlg::GetData() pData->mpLowerLimit.reset(new ScColorScaleEntry()); pData->maAxisColor = maLbAxisCol.GetSelectEntryColor(); -::GetType(maLbTypeMin, maEdMin, pData->mpLowerLimit.get(), mpNumberFormatter); -::GetType(maLbTypeMax, maEdMax, pData->mpUpperLimit.get(), mpNumberFormatter); +::GetType(maLbTypeMin, maEdMin, pData->mpLowerLimit.get(), mpNumberFormatter, mpDoc, maPos); +::GetType(maLbTypeMax, maEdMax, pData->mpUpperLimit.get(), mpNumberFormatter, mpDoc, maPos); GetAxesPosition(pData, maLbAxisPos); return pData; diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 2e1c148..865cfcc 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -1041,7 +1041,7 @@ IMPL_LINK_NOARG( ScDataBarFrmtEntry, OptionBtnHdl ) { SetColorScaleEntry(mpDataBarData->mpLowerLimit.get(), maLbDataBarMinType, maEdDataBarMin, mpDoc, maPos, true); SetColorScaleEntry(mpDataBarData->mpUpperLimit.get(), maLbDataBarMaxType, maEdDataBarMax, mpDoc, maPos, true); -ScDataBarSettingsDlg* pDlg = new ScDataBarSettingsDlg(this, *mpDataBarData, mpDoc); +ScDataBarSettingsDlg* pDlg = new ScDataBarSettingsDlg(this, *mpDataBarData, mpDoc, maPos); if( pDlg->Execute() == RET_OK) { mpDataBarData.reset(pDlg->GetData()); diff --git a/sc/source/ui/inc/colorformat.hxx b/sc/source/ui/inc/colorformat.hxx index 5f552d8..3c58131 100644 --- a/sc/source/ui/inc/colorformat.hxx +++ b/sc/source/ui/inc/colorformat.hxx @@ -34
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/filter/xml/xmlstyli.cxx | 25 - sc/source/filter/xml/xmlstyli.hxx |1 + 2 files changed, 13 insertions(+), 13 deletions(-) New commits: commit 8e94ac21b72145d59992eaee4fbbd065e597b3d6 Author: Markus Mohrhard Date: Fri Sep 28 20:16:18 2012 +0200 use a as prefix for local variables Change-Id: Id4652eb986c02044e27cd4e91863d5ed97465860 diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx index 2b6c58b..687c841 100644 --- a/sc/source/filter/xml/xmlstyli.cxx +++ b/sc/source/filter/xml/xmlstyli.cxx @@ -428,13 +428,13 @@ void XMLTableStyleContext::ApplyCondFormat( uno::SequenceGetRangeList(); sal_uInt32 nCondId = itr->GetKey(); -size_t n = rRange.size(); +size_t n = aRangeList.size(); for(size_t i = 0; i < n; ++i) { -const ScRange* pRange = rRange[i]; +const ScRange* pRange = aRangeList[i]; rRangeList.Join(*pRange); } ScPatternAttr aPattern( pDoc->GetPool() ); aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_CONDITIONAL, nCondId ) ); ScMarkData aMarkData; -aMarkData.MarkFromRangeList(rRange, true); +aMarkData.MarkFromRangeList(aRangeList, true); pDoc->ApplySelectionPattern( aPattern , aMarkData); break; @@ -469,12 +469,12 @@ void XMLTableStyleContext::ApplyCondFormat( uno::SequenceAddCondFormat(mpCondFormat, nTab ); mpCondFormat->SetKey(nIndex); -mpCondFormat->AddRange(rRange); +mpCondFormat->AddRange(aRangeList); ScPatternAttr aPattern( pDoc->GetPool() ); aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_CONDITIONAL, nIndex ) ); ScMarkData aMarkData; -aMarkData.MarkFromRangeList(rRange, true); +aMarkData.MarkFromRangeList(aRangeList, true); pDoc->ApplySelectionPattern( aPattern , aMarkData); } commit c5d4e2cf96e5c28634ed6968f87b476e8a2a5850 Author: Markus Mohrhard Date: Fri Sep 28 20:14:17 2012 +0200 fetime of mpCondFormat is more complex, fdo#55379 Change-Id: I2b34f9fefdfdfa245ab73f8691090cbde8bcd34e diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx index a05276f..2b6c58b 100644 --- a/sc/source/filter/xml/xmlstyli.cxx +++ b/sc/source/filter/xml/xmlstyli.cxx @@ -390,12 +390,15 @@ XMLTableStyleContext::XMLTableStyleContext( ScXMLImport& rImport, nNumberFormat(-1), nLastSheet(-1), bParentSet(false), -mpCondFormat(NULL) +mpCondFormat(NULL), +mbDeleteCondFormat(true) { } XMLTableStyleContext::~XMLTableStyleContext() { +if(mbDeleteCondFormat) +delete mpCondFormat; } SvXMLImportContext *XMLTableStyleContext::CreateChildContext( @@ -442,11 +445,6 @@ void XMLTableStyleContext::ApplyCondFormat( uno::SequenceEqualEntries(*mpCondFormat)) { -// we don't need the new cond format entry now -// the found one is the same and we just need to add the range to it -delete mpCondFormat; -mpCondFormat = NULL; - ScRangeList& rRangeList = itr->GetRangeList(); sal_uInt32 nCondId = itr->GetKey(); size_t n = rRange.size(); @@ -468,6 +466,7 @@ void XMLTableStyleContext::ApplyCondFormat( uno::SequenceAddCondFormat(mpCondFormat, nTab ); mpCondFormat->SetKey(nIndex); mpCondFormat->AddRange(rRange); diff --git a/sc/source/filter/xml/xmlstyli.hxx b/sc/source/filter/xml/xmlstyli.hxx index def3509..28ea475 100644 --- a/sc/source/filter/xml/xmlstyli.hxx +++ b/sc/source/filter/xml/xmlstyli.hxx @@ -101,6 +101,7 @@ class XMLTableStyleContext : public XMLPropStyleContext SCTAB nLastSheet; boolbParentSet; ScConditionalFormat*mpCondFormat; +boolmbDeleteCondFormat; const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); } ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/filter/oox/extlstcontext.cxx |8 +++- sc/source/filter/oox/formulabuffer.cxx | 17 + 2 files changed, 16 insertions(+), 9 deletions(-) New commits: commit 6ed264ffca065ed2aa36624ba29d9764ff042a72 Author: Markus Mohrhard Date: Fri Sep 28 01:22:44 2012 +0200 fix vell value import from ooxml with array formulas, fdo#54559 Change-Id: I3a7e30940c543a178bba3008db2c6056b4d3 diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx index f2f1d69..70efcaf 100644 --- a/sc/source/filter/oox/formulabuffer.cxx +++ b/sc/source/filter/oox/formulabuffer.cxx @@ -99,23 +99,23 @@ void FormulaBuffer::finalizeImport() applyCellFormulas( cellIt->second ); } +ArrayFormulaDataMap::iterator itArray = cellArrayFormulas.find( nTab ); +if ( itArray != cellArrayFormulas.end() ) +{ +applyArrayFormulas( itArray->second ); +} + FormulaValueMap::iterator itValues = cellFormulaValues.find( nTab ); if ( itValues != cellFormulaValues.end() ) { std::vector< ValueAddressPair > & rVector = itValues->second; applyCellFormulaValues( rVector ); } - -ArrayFormulaDataMap::iterator itArray = cellArrayFormulas.find( nTab ); - -if ( itArray != cellArrayFormulas.end() ) -{ -applyArrayFormulas( itArray->second ); -} } rDoc.SetAutoNameCache( NULL ); xFormulaBar->setPosition( 1.0 ); } + void FormulaBuffer::applyCellFormula( ScDocument& rDoc, const ApiTokenSequence& rTokens, const ::com::sun::star::table::CellAddress& rAddress ) { ScTokenArray aTokenArray; @@ -145,7 +145,8 @@ void FormulaBuffer::applyCellFormulaValues( const std::vector< ValueAddressPair ScAddress aCellPos; ScUnoConversion::FillScAddress( aCellPos, it->first ); ScBaseCell* pBaseCell = rDoc.GetCell( aCellPos ); -if ( pBaseCell->GetCellType() == CELLTYPE_FORMULA ) +SAL_WARN_IF( !pBaseCell, "sc", "why is the formula not imported? bug?"); +if ( pBaseCell && pBaseCell->GetCellType() == CELLTYPE_FORMULA ) { ScFormulaCell* pCell = static_cast< ScFormulaCell* >( pBaseCell ); pCell->SetHybridDouble( it->second ); commit fcd85be5d5e44b00c6fa5717c7ec13ea657483d4 Author: Markus Mohrhard Date: Fri Sep 28 01:21:41 2012 +0200 ooxml spec allow ext ref to non existent entry, fdo#54558 Change-Id: I717917d04a93975472d60248eb61066cd04d1bbe diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx index c1949e8..78fd832 100644 --- a/sc/source/filter/oox/extlstcontext.cxx +++ b/sc/source/filter/oox/extlstcontext.cxx @@ -200,7 +200,13 @@ ContextHandlerRef ExtGlobalContext::onCreateContext( sal_Int32 nElement, const A if(nElement == XLS_EXT_TOKEN( cfRule )) { rtl::OUString aId = rAttribs.getString( XML_id, rtl::OUString() ); -void* pInfo = getExtLst().find( aId )->second; + +// an ext entrie does not need to have an existing corresponding entry +ExtLst::const_iterator aExt = getExtLst().find( aId ); +if(aExt == getExtLst().end()) +return NULL; + +void* pInfo = aExt->second; if (!pInfo) { return NULL; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/data/cell.cxx |3 +++ sc/source/ui/condformat/condformatdlg.cxx |4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) New commits: commit 082155566a88b470da1fa197c264fff6cacc32f5 Author: Markus Mohrhard Date: Tue Sep 18 09:00:29 2012 +0200 broadcaster cells are empty, fdo#54553 Change-Id: Ie7c251b7eaee248c97f4f931175bc26539acb22a diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx index 8f3a0a4..c4ddb68 100644 --- a/sc/source/core/data/cell.cxx +++ b/sc/source/core/data/cell.cxx @@ -264,6 +264,9 @@ void ScBaseCell::Delete() bool ScBaseCell::IsBlank() const { +if(eCellType == CELLTYPE_NOTE) +return true; + return false; } commit 61f6bfca7bd55dd8a9cfdd1f966e0da53a3101b3 Author: Markus Mohrhard Date: Tue Sep 18 06:30:06 2012 +0200 use light red as error color Change-Id: Ia16b683c47743a921e70ce1bb7f37724e4ad7c9d diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 2ed6738..3be5bc2 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -836,7 +836,7 @@ IMPL_LINK_NOARG(ScCondFrmtEntry, TypeListHdl) SetHeight(); return 0; } -#include + IMPL_LINK(ScCondFrmtEntry, EdModifyHdl, Edit*, pEdit) { rtl::OUString aFormula = pEdit->GetText(); @@ -845,7 +845,7 @@ IMPL_LINK(ScCondFrmtEntry, EdModifyHdl, Edit*, pEdit) boost::scoped_ptr mpCode(aComp.CompileString(aFormula)); if(mpCode->GetCodeError()) { -pEdit->SetControlBackground(COL_RED); +pEdit->SetControlBackground(COL_LIGHTRED); } else { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/tool/rangelst.cxx | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) New commits: commit 7a182026fce922a9f69e8da76d46e87e7188a4e9 Author: Markus Mohrhard Date: Mon Sep 17 14:41:19 2012 +0200 don't use delete with remove_if, related fdo#54498 Change-Id: I508ceb8dfe13fbfe54b4262d26bd215462c90c40 diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx index 2f90f39..49b6162 100644 --- a/sc/source/core/tool/rangelst.cxx +++ b/sc/source/core/tool/rangelst.cxx @@ -705,9 +705,16 @@ void ScRangeList::DeleteArea( SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2 ) { ScRange aRange( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 ); -iterator itrDel = std::remove_if(maRanges.begin(), maRanges.end(), FindRangeIn(aRange)); -for_each(itrDel, maRanges.end(), ScDeleteObjectByPtr()); -maRanges.erase(itrDel, maRanges.end()); +for(size_t i = 0; i < maRanges.size();) +{ +if(FindRangeIn(aRange)(maRanges[i])) +{ +ScRange* pRange = Remove(i); +delete pRange; +} +else +++i; +} std::vector aNewRanges; commit e6bca122176cdb2b6e822fc933f159dc3e3c8d46 Author: Markus Mohrhard Date: Mon Sep 17 14:37:30 2012 +0200 don't delete ranges in ScRangeList::UpdateReference, fdo#54498 Change-Id: Id6a1f9f514c8221e5ca79e1eaafe69916fc1d1bd diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx index de87e6c..2f90f39 100644 --- a/sc/source/core/tool/rangelst.cxx +++ b/sc/source/core/tool/rangelst.cxx @@ -417,14 +417,6 @@ bool ScRangeList::UpdateReference( SCTAB nTab2; rWhere.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 ); -// delete all entries that are fully deleted -if( eUpdateRefMode == URM_INSDEL && (nDx < 0 || nDy < 0) ) -{ -vector::iterator itr = std::remove_if(maRanges.begin(), maRanges.end(), FindDeletedRange(nDx, nDy)); -for_each(itr, maRanges.end(), ScDeleteObjectByPtr()); -maRanges.erase(itr, maRanges.end()); -} - vector::iterator itr = maRanges.begin(), itrEnd = maRanges.end(); for (; itr != itrEnd; ++itr) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/filter/xml/xmlimprt.hxx |1 - sc/source/filter/xml/xmlstyli.hxx |2 -- sc/source/ui/docshell/docfunc.cxx |3 +++ 3 files changed, 3 insertions(+), 3 deletions(-) New commits: commit 462451a4256d01072c4fface64b590b7be05f718 Author: Markus Mohrhard Date: Wed Sep 5 20:27:56 2012 +0200 remove two useless definitions Change-Id: Idf804207c2af46dee30d4eff3704b8d61fbe485f diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx index d9d86fc..f3706d9 100644 --- a/sc/source/filter/xml/xmlimprt.hxx +++ b/sc/source/filter/xml/xmlimprt.hxx @@ -852,7 +852,6 @@ class ScXMLImport: public SvXMLImport com::sun::star::uno::Reference xNumberFormats; com::sun::star::uno::Reference xNumberFormatTypes; -ScRangeList maSheetRanges; com::sun::star::uno::Reference xSheetCellRanges; rtl::OUString sEmpty; diff --git a/sc/source/filter/xml/xmlstyli.hxx b/sc/source/filter/xml/xmlstyli.hxx index edc5794..def3509 100644 --- a/sc/source/filter/xml/xmlstyli.hxx +++ b/sc/source/filter/xml/xmlstyli.hxx @@ -143,8 +143,6 @@ public: private: using XMLPropStyleContext::SetStyle; - -ScConditionalFormat* CreateCondFormat(); }; class XMLTableStylesContext : public SvXMLStylesContext commit 5129d01a7fb85390d925c084488493ac19c8b217 Author: Markus Mohrhard Date: Wed Sep 5 20:27:21 2012 +0200 only allow to change conditional formatting if sheet is not protected Change-Id: I38a812a4d4ce24fb9ad65c438f6e001b376f319e diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 70d2456..0472145 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -5063,6 +5063,9 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor { ScDocShellModificator aModificator(rDocShell); ScDocument* pDoc = rDocShell.GetDocument(); +if(pDoc->IsTabProtected(nTab)) +return; + if(nOldFormat) { pDoc->DeleteConditionalFormat(nOldFormat, nTab); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/data/column3.cxx |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) New commits: commit 7a8040665f40fbcb4fa58c036aa066f061abd9ba Author: Markus Mohrhard Date: Tue Aug 28 18:47:37 2012 +0200 prevent double delete of broadcaster, fdo#54074, fdo#53364 Change-Id: I7d94525daaeb7c8268fb10594c8a21ebcd52311c diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 861158c..00ac9fa 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -400,7 +400,10 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDe bool bKeepBC = pBC && pBC->HasListeners(); // #i99844# do not release broadcaster from old cell, it still has to notify deleted content if (bKeepBC) +{ pNoteCell = new ScNoteCell( pBC ); +pOldCell->ReleaseBroadcaster(); +} // remove cell entry in cell item list SCROW nOldRow = maItems[nIdx].nRow; commit 73de74bb6ecbbbc390710ddd9d6c930378cdf142 Author: Markus Mohrhard Date: Tue Aug 28 16:56:31 2012 +0200 fix indentation Change-Id: I666f130fe75bd0e0fcba54fee68b97ae153db2ef diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 1d2e21c..861158c 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -399,8 +399,8 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDe SvtBroadcaster* pBC = pOldCell->GetBroadcaster(); bool bKeepBC = pBC && pBC->HasListeners(); // #i99844# do not release broadcaster from old cell, it still has to notify deleted content -if ( bKeepBC) -pNoteCell = new ScNoteCell( pBC ); +if (bKeepBC) +pNoteCell = new ScNoteCell( pBC ); // remove cell entry in cell item list SCROW nOldRow = maItems[nIdx].nRow; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/data/table3.cxx | 49 ++--- sc/source/ui/optdlg/tpdefaults.cxx |2 - 2 files changed, 31 insertions(+), 20 deletions(-) New commits: commit 1b0a7dc8b787b7be31b1b58a5ea6a9fc7207996d Author: Markus Mohrhard Date: Sun Aug 26 14:04:37 2012 +0200 when swaping cols or rows insert notes at the right place, fdo#53979 Change-Id: I1228b3a064623e810265b47776e33f81f4bf0e51 diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index ef7b3b6..1ea61fb 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -563,7 +563,9 @@ void ScTable::QuickSort( ScSortInfoArray* pArray, SCsCOLROW nLo, SCsCOLROW nHi ) void ScTable::SwapCol(SCCOL nCol1, SCCOL nCol2) { -for (SCROW nRow = aSortParam.nRow1; nRow <= aSortParam.nRow2; nRow++) +SCROW nRowStart = aSortParam.nRow1; +SCROW nRowEnd = aSortParam.nRow2; +for (SCROW nRow = nRowStart; nRow <= nRowEnd; nRow++) { aCol[nCol1].SwapCell(nRow, aCol[nCol2]); if (aSortParam.bIncludePattern) @@ -589,16 +591,19 @@ void ScTable::SwapCol(SCCOL nCol1, SCCOL nCol2) ScPostIt* pPostIt = itr->second; ++itr; -if (nCol == nCol1) +if(nRow >= nRowStart && nRow <= nRowEnd) { -aNoteMap.insert(nCol, nRow, pPostIt); -maNotes.ReleaseNote(nCol2, nRow); -} -else if (nCol == nCol2) -{ -aNoteMap.insert(nCol, nRow, pPostIt); -maNotes.ReleaseNote(nCol1, nRow); +if (nCol == nCol1) +{ +aNoteMap.insert(nCol2, nRow, pPostIt); +maNotes.ReleaseNote(nCol, nRow); +} +else if (nCol == nCol2) +{ +aNoteMap.insert(nCol1, nRow, pPostIt); +maNotes.ReleaseNote(nCol, nRow); +} } } @@ -609,6 +614,7 @@ void ScTable::SwapCol(SCCOL nCol1, SCCOL nCol2) SCCOL nCol = itr->first.first; SCROW nRow = itr->first.second; ScPostIt* pPostIt = itr->second; +++itr; maNotes.insert(nCol, nRow, pPostIt); aNoteMap.ReleaseNote(nCol, nRow); @@ -617,7 +623,9 @@ void ScTable::SwapCol(SCCOL nCol1, SCCOL nCol2) void ScTable::SwapRow(SCROW nRow1, SCROW nRow2) { -for (SCCOL nCol = aSortParam.nCol1; nCol <= aSortParam.nCol2; nCol++) +SCCOL nColStart = aSortParam.nCol1; +SCCOL nColEnd = aSortParam.nCol2; +for (SCCOL nCol = nColStart; nCol <= nColEnd; nCol++) { aCol[nCol].SwapRow(nRow1, nRow2); if (aSortParam.bIncludePattern) @@ -655,16 +663,18 @@ void ScTable::SwapRow(SCROW nRow1, SCROW nRow2) ScPostIt* pPostIt = itr->second; ++itr; -if (nRow == nRow1) +if( nCol >= nColStart && nCol <= nColEnd ) { -aNoteMap.insert(nCol, nRow, pPostIt); -maNotes.ReleaseNote(nCol, nRow2); -} -else if (nRow == nRow2) -{ -aNoteMap.insert(nCol, nRow, pPostIt); -maNotes.ReleaseNote(nCol, nRow1); - +if (nRow == nRow1) +{ +aNoteMap.insert(nCol, nRow2, pPostIt); +maNotes.ReleaseNote(nCol, nRow); +} +else if (nRow == nRow2) +{ +aNoteMap.insert(nCol, nRow1, pPostIt); +maNotes.ReleaseNote(nCol, nRow); +} } } @@ -675,6 +685,7 @@ void ScTable::SwapRow(SCROW nRow1, SCROW nRow2) SCCOL nCol = itr->first.first; SCROW nRow = itr->first.second; ScPostIt* pPostIt = itr->second; +++itr; maNotes.insert(nCol, nRow, pPostIt); aNoteMap.ReleaseNote(nCol, nRow); commit 4d3ad7c59e0d0fe322c76eb4335440e1d1269ac0 Author: Kohei Yoshida Date: Mon Aug 27 09:58:27 2012 -0400 Quick indentation fix on closing brace. Change-Id: I8626b0b3338e17b1b0fc713d4dba5545e1faba1c diff --git a/sc/source/ui/optdlg/tpdefaults.cxx b/sc/source/ui/optdlg/tpdefaults.cxx index c0db2c1..5020b9c 100644 --- a/sc/source/ui/optdlg/tpdefaults.cxx +++ b/sc/source/ui/optdlg/tpdefaults.cxx @@ -65,7 +65,7 @@ ScTpDefaultsOptions::ScTpDefaultsOptions(Window *pParent, const SfxItemSet &rCor aEdNSheets.SetPosPixel( aNewPoint ); aNewPoint.Y() = aEdSheetPrefix.GetPosPixel().Y(); aEdSheetPrefix.SetPosPixel( aNewPoint ); - } +} aEdNSheets.SetModifyHdl( LINK(this, ScTpDefaultsOptions, NumModifiedHdl) ); aEdSheetPrefix.SetModifyHdl( LINK(this, ScTpDefaultsOptions, PrefixModifiedHdl) ); aEdSheetPrefix.SetGetFocusHdl( LINK(this, ScTpDefaultsOptions, PrefixEditOnFocusHdl) ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/data/dpcache.cxx|9 ++--- sc/source/ui/docshell/dbdocfun.cxx |6 -- 2 files changed, 6 insertions(+), 9 deletions(-) New commits: commit 88979ef6ffe7921200311513d6601f9c5d582a42 Author: Kohei Yoshida Date: Wed Aug 22 14:55:34 2012 -0400 Don't clear the database data cache here. This would result in the pivot cache being refreshed twice. This block of code was a leftover from the previous, non-cached version of pivot table, and this logic no longer applies today. In today's pivot table code, the cache gets refreshed first, then the table gets refreshed afterward. We should never clear the cache data during table refresh. Change-Id: Ida6fa1805463facf842cb9ea94f4c1afab716595 diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index ffcc59e..c5ac760 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -1324,12 +1324,6 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb } if ( pDestObj ) { -// create new database connection for "refresh" -// (and re-read column entry collections) -// so all changes take effect -if ( pNewObj == pOldObj && pDestObj->IsImportData() ) -pDestObj->ClearTableData(); - pDestObj->ReloadGroupTableData(); pDestObj->InvalidateData(); // before getting the new output area commit f4ed9a5adbea3de88870ff4f5cb202bd606e0746 Author: Kohei Yoshida Date: Wed Aug 22 14:25:01 2012 -0400 fdo#53640: Correctly cache source data coming from database backend. It was due to a simple misplacement of nRow = 0. Each record was labeled row 0. No wonder it screws up the result badly. Change-Id: Ia94f42a62f98a9bd7c9d34df3606351bb487931b diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx index d04adf1..ff8fc6e 100644 --- a/sc/source/core/data/dpcache.cxx +++ b/sc/source/core/data/dpcache.cxx @@ -461,24 +461,27 @@ bool ScDPCache::InitFromDataBase (const Reference& xRowSet, const Reference xRow(xRowSet, UNO_QUERY_THROW); std::vector aBuckets; +ScDPItemData aData; for (sal_Int32 nCol = 0; nCol < mnColumnCount; ++nCol) { xRowSet->first(); -ScDPItemData aData; aBuckets.clear(); Field& rField = maFields[nCol]; +SCROW nRow = 0; do { -SCROW nRow = 0; short nFormatType = NUMBERFORMAT_UNDEFINED; +aData.SetEmpty(); getItemValue(*this, aData, xRow, aColTypes[nCol], nCol+1, rNullDate, nFormatType); -aBuckets.push_back(Bucket(aData, 0, nRow++)); +aBuckets.push_back(Bucket(aData, 0, nRow)); if (!aData.IsEmpty()) { maEmptyRows.insert_back(nRow, nRow+1, false); SvNumberFormatter* pFormatter = mpDoc->GetFormatTable(); rField.mnNumFormat = pFormatter ? pFormatter->GetStandardFormat(nFormatType) : 0; } + +++nRow; } while (xRowSet->next()); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source vcl/inc vcl/source
sc/source/ui/condformat/condformatdlg.cxx | 22 +- sc/source/ui/inc/condformatdlg.hxx|1 + vcl/inc/vcl/edit.hxx |1 + vcl/source/control/edit.cxx | 17 ++--- 4 files changed, 37 insertions(+), 4 deletions(-) New commits: commit 76ccb5fe45aef020f51a6c0d5ed14c95390a471f Author: Markus Mohrhard Date: Sun Aug 5 14:48:51 2012 +0200 highlight invalid formulas in cond format dlg, fdo#43653, bnc#730048 Change-Id: I4893eb176aca976c037f8196dd3043e98fbf91dc diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 641b02e..cd850ac 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -320,8 +320,11 @@ void ScCondFrmtEntry::Init() maLbEntryTypeMin.SetSelectHdl( LINK( this, ScCondFrmtEntry, EntryTypeHdl ) ); maLbEntryTypeMax.SetSelectHdl( LINK( this, ScCondFrmtEntry, EntryTypeHdl ) ); maLbEntryTypeMiddle.SetSelectHdl( LINK( this, ScCondFrmtEntry, EntryTypeHdl ) ); +maEdVal1.SetStyle( maEdVal1.GetStyle() | WB_FORCECTRLBACKGROUND ); +maEdVal2.SetStyle( maEdVal2.GetStyle() | WB_FORCECTRLBACKGROUND ); - +maEdVal1.SetModifyHdl( LINK( this, ScCondFrmtEntry, EdModifyHdl ) ); +maEdVal2.SetModifyHdl( LINK( this, ScCondFrmtEntry, EdModifyHdl ) ); SfxStyleSheetIterator aStyleIter( mpDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA ); for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next() ) @@ -813,6 +816,23 @@ IMPL_LINK_NOARG(ScCondFrmtEntry, TypeListHdl) return 0; } +IMPL_LINK(ScCondFrmtEntry, EdModifyHdl, Edit*, pEdit) +{ +rtl::OUString aFormula = pEdit->GetText(); +ScCompiler aComp( mpDoc, maPos ); +aComp.SetGrammar( mpDoc->GetGrammar() ); +boost::scoped_ptr mpCode(aComp.CompileString(aFormula)); +if(mpCode->GetCodeError()) +{ + pEdit->SetControlBackground(GetSettings().GetStyleSettings().GetHighlightColor()); +} +else +{ + pEdit->SetControlBackground(GetSettings().GetStyleSettings().GetWindowColor()); +} +return 0; +} + IMPL_LINK_NOARG(ScCondFrmtEntry, ColFormatTypeHdl) { if(maLbColorFormat.GetSelectEntryPos() < 2) diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx index 3100d9b..98e5926 100644 --- a/sc/source/ui/inc/condformatdlg.hxx +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -125,6 +125,7 @@ private: DECL_LINK( DataBarTypeSelectHdl, void* ); DECL_LINK( ConditionTypeSelectHdl, void* ); DECL_LINK( EntryTypeHdl, ListBox* ); +DECL_LINK( EdModifyHdl, Edit* ); public: ScCondFrmtEntry( Window* pParent, ScDocument* pDoc, const ScAddress& rPos ); commit 7b322f9aa315740625f265ce78dd06effd61531a Author: Markus Mohrhard Date: Sun Aug 5 14:24:02 2012 +0200 paint Edit's native borders after background color Change-Id: I3b5865d862ac7b9958d22d2ff1d3dc693cea2536 diff --git a/vcl/inc/vcl/edit.hxx b/vcl/inc/vcl/edit.hxx index 16c0e2f..58f88be 100644 --- a/vcl/inc/vcl/edit.hxx +++ b/vcl/inc/vcl/edit.hxx @@ -105,6 +105,7 @@ private: SAL_DLLPRIVATE voidImplInsertText( const rtl::OUString& rStr, const Selection* pNewSelection = 0, sal_Bool bIsUserInput = sal_False ); SAL_DLLPRIVATE String ImplGetValidString( const String& rString ) const; SAL_DLLPRIVATE voidImplClearBackground( long nXStart, long nXEnd ); +SAL_DLLPRIVATE voidImplPaintBorder( long nXStart, long nXEnd ); SAL_DLLPRIVATE voidImplShowCursor( sal_Bool bOnlyIfVisible = sal_True ); SAL_DLLPRIVATE voidImplAlign(); SAL_DLLPRIVATE voidImplAlignAndPaint(); diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 8c47e2c..2d5e53e 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -556,7 +556,7 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout ) Push( PUSH_FILLCOLOR | PUSH_LINECOLOR ); SetLineColor(); SetFillColor( GetControlBackground() ); -DrawRect( Rectangle( aPos, Size( GetOutputSizePixel().Width() - 2*mnXOffset, nTH ) ) ); +DrawRect( Rectangle( aPos, Size( GetOutputSizePixel().Width() - 2*mnXOffset, GetOutputSizePixel().Height() ) ) ); Pop(); SetTextFillColor( GetControlBackground() ); @@ -566,6 +566,8 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout ) else SetTextFillColor( IsControlBackground() ? GetControlBackground() : rStyleSettings.GetFieldColor() ); +ImplPaintBorder( 0, GetOutputSizePixel().Width() ); + sal_Bool bDrawSelection = maSelection.Len() && ( HasFocus() || ( GetStyle() & WB_NOHIDESELECTION ) || mbActivePopup ); long nPos = nStart ? pDX[2*nStart] : 0; @@ -1095,6 +1097,17 @@ void Edit::ImplClearBackground( long nXStart, long nXEnd ) aRect.Left()
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/ui/app/inputwin.cxx | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) New commits: commit 8e9f9afbe6eb9d676e678f208db48f30a6561af1 Author: Ivan Timofeev Date: Sat Aug 4 17:29:06 2012 +0400 calc input line: don't reset the scrollbar thumb on resize Change-Id: I78d5bb455e8d175cf3813e24854a76407931a0e3 diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index f107349..65b1a0d 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -976,9 +976,6 @@ void ScInputBarGroup::Resize() aScrollBar.SetLineSize( aMultiTextWnd.GetTextHeight() ); aScrollBar.SetRange( Range( 0, aMultiTextWnd.GetEditEngTxtHeight() ) ); -if ( aMultiTextWnd.GetEditView() ) -aScrollBar.SetThumbPos( 0 ); - aScrollBar.Resize(); aScrollBar.Show(); } commit 5081ea1a076c61c01ae3837aa2396501860ae4e9 Author: Ivan Timofeev Date: Sat Aug 4 17:26:59 2012 +0400 calc input line: don't leave an empty area at the bottom if possible Change-Id: Iaaf82ee6b79d091c349a501f3a09e760c295546f diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index d819e0c..f107349 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1197,8 +1197,16 @@ void ScMultiTextWnd::Resize() if(pEditView) { Size aOutputSize = GetOutputSizePixel(); +Rectangle aOutputArea = PixelToLogic( Rectangle( Point(), aOutputSize )); +pEditView->SetOutputArea( aOutputArea ); + +// Don't leave an empty area at the bottom if we can move the text down. +long nMaxVisAreaTop = pEditEngine->GetTextHeight() - aOutputArea.GetHeight(); +if (pEditView->GetVisArea().Top() > nMaxVisAreaTop) +{ +pEditView->Scroll(0, pEditView->GetVisArea().Top() - nMaxVisAreaTop); +} -pEditView->SetOutputArea( PixelToLogic( Rectangle( Point(), aOutputSize ) ) ); pEditEngine->SetPaperSize( PixelToLogic( Size( aOutputSize.Width(), 1 ) ) ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/data/documen2.cxx |6 ++ sc/source/ui/condformat/condformatdlg.cxx | 14 -- sc/source/ui/inc/condformatdlg.hxx|4 ++-- 3 files changed, 16 insertions(+), 8 deletions(-) New commits: commit cbd98c547af4fac641204fb56149e9d7af9ec075 Author: Markus Mohrhard Date: Fri Jul 27 23:03:22 2012 +0200 copy conditional formats with sheets, fdo#52457 Change-Id: Ic7a337e8a6b36fecbd3aad0e3366fd6f0ccc99c6 diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index d537c35..1a49d63 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -871,6 +871,12 @@ bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM SetNoListening( false ); maTabs[nOldPos]->StartAllListeners(); maTabs[nNewPos]->StartAllListeners(); + +ScConditionalFormatList* pNewList = new ScConditionalFormatList(*maTabs[nOldPos]->GetCondFormList()); +pNewList->UpdateReference(URM_COPY, ScRange( 0, 0, nNewPos , MAXCOL, MAXROW, +nNewPos), 0, 0, nDz); +maTabs[nNewPos]->SetCondFormList( pNewList ); + SetDirty(); SetAutoCalc( bOldAutoCalc ); commit 06b5dfff3aa3005093d427e368ae5eeb5f2ad948 Author: Markus Mohrhard Date: Fri Jul 27 22:40:18 2012 +0200 use correct cursor pos for cond format formulas, fdo#52565 Change-Id: I4e270a8c8ee60a6ab9a3d3b717db2c1243a34e1d diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index f77fe37..641b02e 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -113,7 +113,7 @@ void SetDataBarEntryTypes( const ScColorScaleEntry& rEntry, ListBox& rLbType, Ed } -ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc): +ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScAddress& rPos): Control(pParent, ScResId( RID_COND_ENTRY ) ), mbActive(false), meType(CONDITION), @@ -144,6 +144,7 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc): maEdDataBarMax( this, ScResId( ED_COL_SCALE ) ), maBtOptions( this, ScResId( BTN_OPTIONS ) ), mpDoc(pDoc), +maPos(rPos), mnIndex(0), maStrCondition(ScResId( STR_CONDITION ).toString()) { @@ -179,7 +180,7 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc): EntryTypeHdl(&maLbEntryTypeMax); } -ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScFormatEntry* pFormatEntry): +ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScFormatEntry* pFormatEntry, const ScAddress& rPos): Control(pParent, ScResId( RID_COND_ENTRY ) ), mbActive(false), meType(CONDITION), @@ -209,7 +210,8 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScForm maEdDataBarMin( this, ScResId( ED_COL_SCALE ) ), maEdDataBarMax( this, ScResId( ED_COL_SCALE ) ), maBtOptions( this, ScResId( BTN_OPTIONS ) ), -mpDoc(pDoc) +mpDoc(pDoc), +maPos(rPos) { SetControlBackground(GetSettings().GetStyleSettings().GetDialogColor()); FreeResource(); @@ -966,7 +968,7 @@ ScCondFormatList::ScCondFormatList(Window* pParent, const ResId& rResId, ScDocum size_t nCount = pFormat->size(); for (size_t nIndex = 0; nIndex < nCount; ++nIndex) { -maEntries.push_back(new ScCondFrmtEntry( this, mpDoc, pFormat->GetEntry(nIndex))); +maEntries.push_back(new ScCondFrmtEntry( this, mpDoc, pFormat->GetEntry(nIndex), maPos )); } } @@ -1050,7 +1052,7 @@ ScCondFormatDlg::ScCondFormatDlg(Window* pParent, ScDocument* pDoc, const ScCond maBtnRemove( this, ScResId( BTN_REMOVE ) ), maBtnOk( this, ScResId( BTN_OK ) ), maBtnCancel( this, ScResId( BTN_CANCEL ) ), -maCondFormList( this, ScResId( CTRL_LIST ), pDoc, pFormat, rRange, maPos ), +maCondFormList( this, ScResId( CTRL_LIST ), pDoc, pFormat, rRange, rPos ), mpDoc(pDoc), mpFormat(pFormat), maPos(rPos) @@ -1074,7 +1076,7 @@ ScConditionalFormat* ScCondFormatDlg::GetConditionalFormat() const IMPL_LINK_NOARG( ScCondFormatList, AddBtnHdl ) { -ScCondFrmtEntry* pNewEntry = new ScCondFrmtEntry(this, mpDoc); +ScCondFrmtEntry* pNewEntry = new ScCondFrmtEntry(this, mpDoc, maPos); maEntries.push_back( pNewEntry ); for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) { diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx index 46938b9..3100d9b 100644 --- a/sc/source/ui/inc/condformatdlg.hxx +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -127,8 +127,8 @@ private: DECL_LINK( EntryTypeHdl, ListBox* ); public: -ScCondFrmtEntry( Window* pParent, ScDocument* pDoc ); -ScCondFrmtEntry( Window* pParent, ScDoc
[Libreoffice-commits] .: 2 commits - sc/source tubes/inc tubes/qa tubes/source
sc/source/ui/collab/contacts.cxx |6 +- sc/source/ui/collab/sendfunc.cxx |8 sc/source/ui/collab/sendfunc.hxx |3 ++- tubes/inc/tubes/conference.hxx |2 +- tubes/qa/test_manager.cxx|2 +- tubes/source/conference.cxx |4 ++-- tubes/source/manager.cxx |3 ++- 7 files changed, 17 insertions(+), 11 deletions(-) New commits: commit df2369657ebe36c3888bb032e693bf1fcb49bb51 Author: Matúš Kukan Date: Thu Jul 26 17:56:12 2012 +0200 tubes: send file when inviting contact to MUC collaboration - add UUID info to TeleConference - let SendFile function take argument for contact instead of getting contact from the channel info, what couldn't work for MUC channel Change-Id: I4dc45c084966a030ff4b503e192d452797f0bfdd diff --git a/sc/source/ui/collab/contacts.cxx b/sc/source/ui/collab/contacts.cxx index 72c29a0..e6e2239 100644 --- a/sc/source/ui/collab/contacts.cxx +++ b/sc/source/ui/collab/contacts.cxx @@ -107,6 +107,8 @@ class TubeContacts : public ModelessDialog { TpContact* pContact = pAC->mpContact; pSender->GetConference()->invite( pContact ); +pSender->SendFile( pContact, OStringToOUString( +pSender->GetConference()->getUuid(), RTL_TEXTENCODING_UTF8 ) ); } } } @@ -135,7 +137,7 @@ class TubeContacts : public ModelessDialog { ScDocFuncSend* pSender = EnsureScDocFuncSendInCurrentSfxObjectShell(); pSender->SetCollaboration( pConference ); -pSender->SendFile( OStringToOUString( +pSender->SendFile( pContact, OStringToOUString( pConference->getUuid(), RTL_TEXTENCODING_UTF8 ) ); } } diff --git a/sc/source/ui/collab/sendfunc.cxx b/sc/source/ui/collab/sendfunc.cxx index b78d34c..58af1ba 100644 --- a/sc/source/ui/collab/sendfunc.cxx +++ b/sc/source/ui/collab/sendfunc.cxx @@ -156,7 +156,7 @@ void ScDocFuncSend::SendMessage( ScChangeOpWriter &rOp ) mpDirect->RecvMessage( rOp.toString() ); } -void ScDocFuncSend::SendFile( const rtl::OUString &sUuid ) +void ScDocFuncSend::SendFile( TpContact* pContact, const rtl::OUString &sUuid ) { String aTmpPath = utl::TempFile::CreateTempName(); aTmpPath.Append( OUString("_") ); @@ -182,8 +182,8 @@ void ScDocFuncSend::SendFile( const rtl::OUString &sUuid ) fprintf( stderr, "Temp file is '%s'\n", rtl::OUStringToOString( aFileURL, RTL_TEXTENCODING_UTF8 ).getStr() ); -if (mpConference) -mpConference->sendFile( aFileURL, file_sent_cb, NULL ); +if (pContact) +mpConference->sendFile( pContact, aFileURL, file_sent_cb, NULL ); else TeleManager_fileReceived( aFileURL ); @@ -249,7 +249,7 @@ sal_Bool ScDocFuncSend::SetNormalString( bool& o_rbNumFmtSet, const ScAddress& r o_rbNumFmtSet = false; if ( rtl::OUString( rText ) == "saveme" ) -SendFile( rText ); +SendFile( NULL, rText ); if ( rtl::OUString( rText ) == "contacts" ) tubes::createContacts(); diff --git a/sc/source/ui/collab/sendfunc.hxx b/sc/source/ui/collab/sendfunc.hxx index 7299983..16f6e88 100644 --- a/sc/source/ui/collab/sendfunc.hxx +++ b/sc/source/ui/collab/sendfunc.hxx @@ -15,6 +15,7 @@ #include "cell.hxx" #include "docfunc.hxx" class TeleConference; +typedef struct _TpContact TpContact; namespace { @@ -236,7 +237,7 @@ public: voidSetCollaboration( TeleConference* pConference ); TeleConference* GetConference(); // TODO: I think this could be moved to TeleManager later. -voidSendFile( const rtl::OUString &rURL ); +voidSendFile( TpContact* pContact, const rtl::OUString &rURL ); virtual voidEnterListAction( sal_uInt16 nNameResId ); virtual voidEndListAction(); diff --git a/tubes/inc/tubes/conference.hxx b/tubes/inc/tubes/conference.hxx index fc495e5..e5c5d37 100644 --- a/tubes/inc/tubes/conference.hxx +++ b/tubes/inc/tubes/conference.hxx @@ -66,7 +66,7 @@ public: boost::signals2::signal sigPacketReceived; typedef void (*FileSentCallback)( bool aSuccess, void* pUserData); -TUBES_DLLPUBLIC voidsendFile( rtl::OUString &localUri, FileSentCallback pCallback, void* pUserData); +TUBES_DLLPUBLIC voidsendFile( TpContact* pContact, rtl::OUString &localUri, FileSentCallback pCallback, void* pUserData); TUBES_DLLPUBLIC const OString& getUuid() const { return msUuid; } // --- following only to be called only by manager's callbacks --- diff --git a/tubes/qa/test_manager.cxx b/tubes/qa/test_manager.cxx index f914b33..ca03bae 100644 --- a/tubes/qa/test_manager.cxx +++ b/tubes/qa/test_manager.cxx @@ -264,7 +264,7 @@ void TestTeleTubes::testSendFile() /* This has to run after testContactList has run successfully. */ C
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/data/conditio.cxx | 13 +++ sc/source/core/inc/refupdat.hxx |2 sc/source/core/tool/rangelst.cxx | 31 sc/source/core/tool/refupdat.cxx | 142 +++ 4 files changed, 116 insertions(+), 72 deletions(-) New commits: commit 76f56b5e8d4abf17682aa75b7cf183b883809234 Author: Markus Mohrhard Date: Tue Jul 24 08:54:58 2012 +0200 delete conditional format entries that are removed, fdo#52351 Change-Id: I9ab70d2b7a557ae5f717898edfb6c363343462f6 diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index 7444833..3d3611b 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1588,6 +1588,19 @@ void ScConditionalFormatList::UpdateReference( UpdateRefMode eUpdateRefMode, { for( iterator itr = begin(); itr != end(); ++itr) itr->UpdateReference( eUpdateRefMode, rRange, nDx, nDy, nDz ); + +if( eUpdateRefMode == URM_INSDEL ) +{ +// need to check which must be deleted +iterator itr = begin(); +while(itr != end()) +{ +if(itr->GetRange().empty()) +maConditionalFormats.erase(itr++); +else +++itr; +} +} } void ScConditionalFormatList::RenameCellStyle( const String& rOld, const String& rNew ) diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx index d2bdec3..4ff6ff0 100644 --- a/sc/source/core/tool/rangelst.cxx +++ b/sc/source/core/tool/rangelst.cxx @@ -146,6 +146,29 @@ private: bool mbFirst; }; +class FindDeletedRange : public ::std::unary_function +{ +public: +FindDeletedRange( SCsCOL nDx, SCsROW nDy): mnDx(nDx), mnDy(nDy) {} +FindDeletedRange( const FindDeletedRange& r) : mnDx(r.mnDx), mnDy(r.mnDy) {} +bool operator() (const ScRange* p) +{ +ScAddress rStart = p->aStart; +ScAddress rEnd = p->aEnd; + +if( rEnd.Col() +mnDx < rStart.Col() ) +return true; +if( rEnd.Row() + mnDy < rStart.Row() ) +return true; + +return false; +} + +private: +SCsCOL mnDx; +SCsROW mnDy; +}; + } // === ScRangeList @@ -380,6 +403,14 @@ bool ScRangeList::UpdateReference( SCTAB nTab2; rWhere.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 ); +// delete all entries that are fully deleted +if( eUpdateRefMode == URM_INSDEL && (nDx < 0 || nDy < 0) ) +{ +vector::iterator itr = std::remove_if(maRanges.begin(), maRanges.end(), FindDeletedRange(nDx, nDy)); +for_each(itr, maRanges.end(), ScDeleteObjectByPtr()); +maRanges.erase(itr, maRanges.end()); +} + vector::iterator itr = maRanges.begin(), itrEnd = maRanges.end(); for (; itr != itrEnd; ++itr) { commit d619f3a6da2481c6739818a74a328df9ec2bd24d Author: Markus Mohrhard Date: Mon Jul 23 23:18:10 2012 +0200 sal_Bool -> bool in ScRefUpdate Change-Id: I2bf6583a465d1aee1b8a8788f52c61059b98de76 diff --git a/sc/source/core/inc/refupdat.hxx b/sc/source/core/inc/refupdat.hxx index 201ca64..58b4cc9 100644 --- a/sc/source/core/inc/refupdat.hxx +++ b/sc/source/core/inc/refupdat.hxx @@ -68,7 +68,7 @@ public: /// Before calling, the absolute references must be up-to-date! static ScRefUpdateRes Move( ScDocument* pDoc, const ScAddress& rPos, SCsCOL nDx, SCsROW nDy, SCsTAB nDz, -ScComplexRefData& rRef, sal_Bool bWrap, sal_Bool bAbsolute ); +ScComplexRefData& rRef, bool bWrap, bool bAbsolute ); static void MoveRelWrap( ScDocument* pDoc, const ScAddress& rPos, SCCOL nMaxCol, SCROW nMaxRow, ScComplexRefData& rRef ); diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx index 34c48a1..38fe766 100644 --- a/sc/source/core/tool/refupdat.cxx +++ b/sc/source/core/tool/refupdat.cxx @@ -35,9 +35,9 @@ // template< typename R, typename S, typename U > -sal_Bool lcl_MoveStart( R& rRef, U nStart, S nDelta, U nMask ) +bool lcl_MoveStart( R& rRef, U nStart, S nDelta, U nMask ) { -sal_Bool bCut = false; +bool bCut = false; if ( rRef >= nStart ) rRef = sal::static_int_cast( rRef + nDelta ); else if ( nDelta < 0 && rRef >= nStart + nDelta ) @@ -45,20 +45,20 @@ sal_Bool lcl_MoveStart( R& rRef, U nStart, S nDelta, U nMask ) if ( rRef < 0 ) { rRef = 0; -bCut = sal_True; +bCut = true; } else if ( rRef > nMask ) { rRef = nMask; -bCut = sal_True; +bCut = true; } return bCut; } template< typename R, typename S, typename U > -sal_Bool lcl_MoveEnd( R& rRef, U nStart, S nDelta, U nMask ) +bool lcl_MoveEnd( R& rRef, U nStart, S nDelta, U nMask ) { -sal
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/filter/excel/xetable.cxx | 51 ++--- 1 file changed, 20 insertions(+), 31 deletions(-) New commits: commit 4ed0eaca6c14aeb652cbebe18081cc9e7e1444ac Author: Noel Power Date: Wed Jul 25 18:23:38 2012 +0100 hopefully more successful attempt to solve fdo#50304 Change-Id: I86dfff571c14bce97d0851b4093dbc376d8b6ea4 diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index e3967f2..d611077 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -2146,14 +2146,26 @@ XclExpDimensions* XclExpRowBuffer::GetDimensions() XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt32 nXclRow, bool bRowAlwaysEmpty ) { -RowMap::iterator itr = maRowMap.find(nXclRow); -if (itr == maRowMap.end()) +RowMap::iterator itr = maRowMap.begin(); +ScDocument& rDoc = GetRoot().GetDoc(); +SCTAB nScTab = GetRoot().GetCurrScTab(); +for ( size_t nFrom = maRowMap.size(); nFrom <= nXclRow; ++nFrom ) { -RowRef p(new XclExpRow(GetRoot(), nXclRow, maOutlineBfr, bRowAlwaysEmpty)); -::std::pair r = maRowMap.insert(RowMap::value_type(nXclRow, p)); -itr = r.first; +itr = maRowMap.find(nFrom); +if ( itr == maRowMap.end() ) +{ +// only create RowMap entries for rows that differ from previous, +// or if it is the desired row +if ( !nFrom || ( nFrom == nXclRow ) || ( nFrom && ( rDoc.GetRowHeight(nFrom, nScTab, false) != rDoc.GetRowHeight(nFrom-1, nScTab, false) ) ) ) +{ +RowRef p(new XclExpRow(GetRoot(), nFrom, maOutlineBfr, bRowAlwaysEmpty)); +maRowMap.insert(RowMap::value_type(nFrom, p)); +} +} } +itr = maRowMap.find(nXclRow); return *itr->second; + } // commit cad1ab1f12b01aa0b364697aa63ee2fb73b96dd2 Author: Noel Power Date: Tue Jul 24 19:49:49 2012 +0100 Revert "fix excel row height export problems ( I hope ) fdo#50304" This reverts commit 9746c6de3a05fe9284d6d6bb2f636bfe912733cd. diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 69db2be..e3967f2 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -2029,41 +2029,22 @@ void XclExpRowBuffer::Finalize( XclExpDefaultRowData& rDefRowData, const ScfUInt XclExpDefaultRowData aMaxDefData; size_t nMaxDefCount = 0; // only look for default format in existing rows, if there are more than unused -bool bSearchExisting = ( maRowMap.size() >= ( GetMaxPos().Row() - maRowMap.size() ) ); -if ( bSearchExisting ) -{ -for (itr = itrBeg; itr != itrEnd; ++itr) -{ -const RowRef& rRow = itr->second; -if (rRow->IsDefaultable()) -{ -XclExpDefaultRowData aDefData( *rRow ); -size_t& rnDefCount = aDefRowMap[ aDefData ]; -++rnDefCount; -if( rnDefCount > nMaxDefCount ) -{ -nMaxDefCount = rnDefCount; -aMaxDefData = aDefData; -} -} -} -} -else +for (itr = itrBeg; itr != itrEnd; ++itr) { -// find a suitable unused row to get the default height from, -// searching backwards from max row -for ( SCROW nRow = GetMaxPos().Row(); nRow >= 0; --nRow ) +const RowRef& rRow = itr->second; +if (rRow->IsDefaultable()) { -if ( maRowMap.find( nRow ) == maRowMap.end() ) +XclExpDefaultRowData aDefData( *rRow ); +size_t& rnDefCount = aDefRowMap[ aDefData ]; +++rnDefCount; +if( rnDefCount > nMaxDefCount ) { -// use first encountered unused row height as default -// I wonder should we do this always ( and abandon the search -// of exising rows ) -aMaxDefData.mnHeight = GetDoc().GetRowHeight(nRow, GetCurrScTab(), false); -break; +nMaxDefCount = rnDefCount; +aMaxDefData = aDefData; } } } + // return the default row format to caller rDefRowData = aMaxDefData; @@ -2165,17 +2146,13 @@ XclExpDimensions* XclExpRowBuffer::GetDimensions() XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt32 nXclRow, bool bRowAlwaysEmpty ) { -RowMap::iterator itr = maRowMap.begin(); -for ( size_t nFrom = maRowMap.size(); nFrom <= nXclRow; ++nFrom ) +RowMap::iterator itr = maRowMap.find(nXclRow); +if (itr == maRowMap.end()) { -itr = maRowMap.find(nFrom); -if ( itr == maRowMap.end() ) -{ -RowRef p(new XclExpRow(GetRoot(), nFrom, maOutlineBfr, bRowAlwaysEmpty)); -maRowMap.insert(RowMap::v
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/ui/condformat/condformathelper.cxx |2 ++ sc/source/ui/src/globstr.src |4 2 files changed, 6 insertions(+) New commits: commit 7a26388f34feeec9568cbdcbad78fd5cd881747c Author: Markus Mohrhard Date: Sun Jul 22 21:29:27 2012 +0200 show expression for formula condition in manage cond formats Change-Id: I04cda5ba5b248ef7938d36b5af6003ac89642e42 diff --git a/sc/source/ui/condformat/condformathelper.cxx b/sc/source/ui/condformat/condformathelper.cxx index dda40a8..1ec8607 100644 --- a/sc/source/ui/condformat/condformathelper.cxx +++ b/sc/source/ui/condformat/condformathelper.cxx @@ -76,6 +76,8 @@ rtl::OUString ScCondFormatHelper::GetExpression(const ScConditionalFormat& rForm if(eMode == SC_COND_DIRECT) { aBuffer.append(getTextForType(FORMULA)); +aBuffer.append(" "); +aBuffer.append(pEntry->GetExpression(rPos, 0)); } else { commit c53e5a7dceb78980960504515881281c8e40bcdf Author: Markus Mohrhard Date: Sun Jul 22 21:24:50 2012 +0200 add missing string for "Formula is" Change-Id: Ie2c3dae7ebe3181cb8bb85869882a4eed4a07c14 diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src index 9938cd6..0b25b8c 100644 --- a/sc/source/ui/src/globstr.src +++ b/sc/source/ui/src/globstr.src @@ -1891,5 +1891,9 @@ Resource RID_GLOBSTR { Text [ en-US ] = "duplicate"; }; +String STR_COND_FORMULA +{ +Text [ en-US ] = "Formula is"; +}; }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/ui/condformat/colorformat.cxx |2 - sc/source/ui/condformat/condformatdlg.cxx | 40 ++ sc/source/ui/inc/condformatdlg.hxx|1 3 files changed, 42 insertions(+), 1 deletion(-) New commits: commit b85a2af72e3ce0a4111972d51c8f1d43599dee5e Author: Markus Mohrhard Date: Mon Jul 16 04:21:40 2012 +0200 disable edit field for min and max type, fdo#51834 Change-Id: Id77c58f333bfab5446cf96d24cd9ccfc18802862 diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 2ec2dc7..f77fe37 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -173,6 +173,10 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc): SwitchToType(COLLAPSED); SetHeight(); SetCondType(); + +EntryTypeHdl(&maLbEntryTypeMin); +EntryTypeHdl(&maLbEntryTypeMiddle); +EntryTypeHdl(&maLbEntryTypeMax); } ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScFormatEntry* pFormatEntry): @@ -297,6 +301,10 @@ ScCondFrmtEntry::ScCondFrmtEntry(Window* pParent, ScDocument* pDoc, const ScForm maClickHdl = LINK( pParent, ScCondFormatList, EntrySelectHdl ); SwitchToType(COLLAPSED); SetHeight(); + +EntryTypeHdl(&maLbEntryTypeMin); +EntryTypeHdl(&maLbEntryTypeMiddle); +EntryTypeHdl(&maLbEntryTypeMax); } ScCondFrmtEntry::~ScCondFrmtEntry() @@ -307,6 +315,12 @@ void ScCondFrmtEntry::Init() { maLbType.SetSelectHdl( LINK( this, ScCondFrmtEntry, TypeListHdl ) ); maLbColorFormat.SetSelectHdl( LINK( this, ScCondFrmtEntry, ColFormatTypeHdl ) ); +maLbEntryTypeMin.SetSelectHdl( LINK( this, ScCondFrmtEntry, EntryTypeHdl ) ); +maLbEntryTypeMax.SetSelectHdl( LINK( this, ScCondFrmtEntry, EntryTypeHdl ) ); +maLbEntryTypeMiddle.SetSelectHdl( LINK( this, ScCondFrmtEntry, EntryTypeHdl ) ); + + + SfxStyleSheetIterator aStyleIter( mpDoc->GetStyleSheetPool(), SFX_STYLE_FAMILY_PARA ); for ( SfxStyleSheetBase* pStyle = aStyleIter.First(); pStyle; pStyle = aStyleIter.Next() ) { @@ -813,6 +827,31 @@ IMPL_LINK_NOARG(ScCondFrmtEntry, ColFormatTypeHdl) return 0; } +IMPL_LINK( ScCondFrmtEntry, EntryTypeHdl, ListBox*, pBox ) +{ +bool bEnableEdit = true; +sal_Int32 nPos = pBox->GetSelectEntryPos(); +if(nPos == 0 || nPos == 1) +{ +bEnableEdit = false; +} + +Edit* pEd = NULL; +if(pBox == &maLbEntryTypeMin) +pEd = &maEdMin; +else if(pBox == &maLbEntryTypeMiddle) +pEd = &maEdMiddle; +else if(pBox == &maLbEntryTypeMax) +pEd = &maEdMax; + +if(bEnableEdit) +pEd->Enable(); +else +pEd->Disable(); + +return 0; +} + IMPL_LINK_NOARG(ScCondFrmtEntry, StyleSelectHdl) { if(maLbStyle.GetSelectEntryPos() == 0) @@ -906,6 +945,7 @@ IMPL_LINK_NOARG( ScCondFrmtEntry, ConditionTypeSelectHdl ) { maEdVal2.Hide(); } + return 0; } diff --git a/sc/source/ui/inc/condformatdlg.hxx b/sc/source/ui/inc/condformatdlg.hxx index 2c53ab0..46938b9 100644 --- a/sc/source/ui/inc/condformatdlg.hxx +++ b/sc/source/ui/inc/condformatdlg.hxx @@ -124,6 +124,7 @@ private: DECL_LINK( OptionBtnHdl, void* ); DECL_LINK( DataBarTypeSelectHdl, void* ); DECL_LINK( ConditionTypeSelectHdl, void* ); +DECL_LINK( EntryTypeHdl, ListBox* ); public: ScCondFrmtEntry( Window* pParent, ScDocument* pDoc ); commit e11c88d999ad9cab8e309c87088d433fde0d4d9d Author: Markus Mohrhard Date: Mon Jul 16 04:02:23 2012 +0200 use correct value to check for min and max, fdo#51831 Change-Id: I8a5412bc9c22048dd8f6618b38e5a522b7ea02c2 diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx index 867f29f..daa14a8 100644 --- a/sc/source/ui/condformat/colorformat.cxx +++ b/sc/source/ui/condformat/colorformat.cxx @@ -288,7 +288,7 @@ IMPL_LINK_NOARG( ScDataBarSettingsDlg, OkBtnHdl ) mpNumberFormatter->IsNumberFormat(aMinString, nIndex, nMinValue); nIndex = 0; double nMaxValue = 0; -mpNumberFormatter->IsNumberFormat(aMaxString, nIndex, nMinValue); +mpNumberFormatter->IsNumberFormat(aMaxString, nIndex, nMaxValue); if(rtl::math::approxEqual(nMinValue, nMaxValue) || nMinValue > nMaxValue) bWarn = true; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source sw/source
sc/source/filter/oox/extlstcontext.cxx |2 -- sw/source/filter/ww8/ww8graf.cxx | 10 +- 2 files changed, 5 insertions(+), 7 deletions(-) New commits: commit d0e4215b653b0fab6718b06a5dc0e566170f538d Author: Michael Stahl Date: Thu Jul 12 23:45:35 2012 +0200 ExtGlobalContext::onCreateContext: warning C4702: unreachable code Change-Id: Iccbf66d8838fcfa2f2c620dd768aba75f9e071f4 diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx index 6435128..740a841 100644 --- a/sc/source/filter/oox/extlstcontext.cxx +++ b/sc/source/filter/oox/extlstcontext.cxx @@ -180,8 +180,6 @@ ContextHandlerRef ExtGlobalContext::onCreateContext( sal_Int32 nElement, const A else return this; } - -return 0; } void ExtGlobalContext::onStartElement( const AttributeList& rAttribs ) commit 50ce1874041c8ccfb5c9fefa8a66abb48fa26dcc Author: Michael Stahl Date: Thu Jul 12 23:42:29 2012 +0200 SwWW8ImplReader::Read_GrafLayer: appease MSVC: MSVC 2008 refuses to compile this unless it gets a const_iterator, and i have no idea why. Change-Id: I08a6916313ae256388309742604dfb5940b42b9f diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 60c3357..7a87b29 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -2561,12 +2561,12 @@ SwFrmFmt* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) Get the record for top level object, so we can get the word anchoring and wrapping information for it. */ -for (MSDffImportRecords::iterator it = aData.begin(); -it != aData.end(); ++it) +for (MSDffImportRecords::const_iterator it = aData.begin(); +it != aData.end(); ++it) // MSVC2008 wants const_iterator here??? { if (it->pObj == pObject) { -pRecord = &*it; +pRecord = &const_cast(*it); break; } } @@ -2663,10 +2663,10 @@ SwFrmFmt* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) */ if (!aData.empty()) { -for (MSDffImportRecords::iterator it = aData.begin(); +for (MSDffImportRecords::const_iterator it = aData.begin(); it != aData.end(); ++it) { -pRecord = &*it; +pRecord = &const_cast(*it); if (pRecord->pObj && pRecord->aTextId.nTxBxS) { // #i52825# pRetFrmFmt can be NULL pRetFrmFmt = MungeTextIntoDrawBox(pRecord->pObj, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/data/dpcache.cxx | 22 +- sc/source/core/data/dpsave.cxx |1 - 2 files changed, 21 insertions(+), 2 deletions(-) New commits: commit 6747dd33754a15e7d9f5aae01bb8299b6a05e365 Author: Kohei Yoshida Date: Thu Jul 5 16:08:36 2012 -0400 Use correct row indices to keep track of empty rows. In pivot table cache, data rows are always zero-based, and are different from the rows of cells from which the data are pulled. This error resulted in incorrect pivot table result when the "skip empty rows" option was set. Change-Id: I4fccb37a8667f7e40d6130ac641d7b2a1daa7694 diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx index 9163dde..d04adf1 100644 --- a/sc/source/core/data/dpcache.cxx +++ b/sc/source/core/data/dpcache.cxx @@ -412,7 +412,7 @@ bool ScDPCache::InitFromDoc(ScDocument* pDoc, const ScRange& rRange) if (!aData.IsEmpty()) { -maEmptyRows.insert_back(nRow, nRow+1, false); +maEmptyRows.insert_back(i, i+1, false); rField.mnNumFormat = nNumFormat; } } @@ -1212,6 +1212,26 @@ void ScDPCache::Dump() const } { +struct { SCROW start; SCROW end; bool empty; } aRange; +cout << "* empty rows: " << endl; +mdds::flat_segment_tree::const_iterator it = maEmptyRows.begin(), itEnd = maEmptyRows.end(); +if (it != itEnd) +{ +aRange.start = it->first; +aRange.empty = it->second; +++it; +} + +for (; it != itEnd; ++it) +{ +aRange.end = it->first-1; +cout << "rows " << aRange.start << "-" << aRange.end << ": " << (aRange.empty ? "empty" : "not-empty") << endl; +aRange.start = it->first; +aRange.empty = it->second; +} +} + +{ GroupFieldsType::const_iterator it = maGroupFields.begin(), itEnd = maGroupFields.end(); for (size_t i = maFields.size(); it != itEnd; ++it, ++i) { commit 46776932d8118ae0f64945a9a1ee6ff46094067e Author: Kohei Yoshida Date: Thu Jul 5 14:47:46 2012 -0400 Unnecessary header include. Change-Id: I3f25f2275d8351b16d955941bc2cee13eb34d504 diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx index 62bda08..5feec06 100644 --- a/sc/source/core/data/dpsave.cxx +++ b/sc/source/core/data/dpsave.cxx @@ -34,7 +34,6 @@ #include "global.hxx" #include "dptabsrc.hxx" #include "dputil.hxx" -#include "stlalgorithm.hxx" #include #include "comphelper/string.hxx" ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/tool/interpr1.cxx | 17 +++-- sc/source/core/tool/interpr4.cxx |7 +++ 2 files changed, 14 insertions(+), 10 deletions(-) New commits: commit b709845e27db0f439c430c9ebe3c2884dbc48789 Author: Eike Rathke Date: Wed Jun 27 16:29:02 2012 +0200 resolved fdo#51478 handle array context in T() Note that Excel for T() does not use position dependent range intersection (SingleRef of DoubleRef) when a range reference is passed and does not handle evaluation in array context (instead top left value is always used), which both is inconsistent with other functions taking a scalar value parameter. ODFF does not specify this function different. range intersection was already implemented, this change adds array evaluation. Gnumeric does the same. Change-Id: I4acae943fde247c6d60b55d0f8514fb17d401f40 diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index a7f6572..2508b25 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -3082,20 +3082,17 @@ void ScInterpreter::ScT() } } break; +case svMatrix: case svExternalSingleRef: case svExternalDoubleRef: { -ScMatrixRef pMat = GetMatrix(); -if (!pMat || !pMat->GetElementCount()) -{ -SetError( errIllegalParameter); -break; -} - -if (pMat->IsString(0, 0)) -PushString(pMat->GetString(0, 0)); +double fVal; +String aStr; +ScMatValType nMatValType = GetDoubleOrStringFromMatrix( fVal, aStr); +if (ScMatrix::IsValueType( nMatValType)) +PushString( EMPTY_STRING); else -PushString(EMPTY_STRING); +PushString( aStr); } break; case svDouble : commit 72b4cb18a402338dd65d24d9da8da7fe0fa33db0 Author: Eike Rathke Date: Wed Jun 27 16:15:05 2012 +0200 propagate error in ScInterpreter::GetDoubleOrStringFromMatrix() Change-Id: Iadba0f3a28b0a3bda9b99833510e68679d915514 diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 08d9acc..bca2977 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -2451,6 +2451,13 @@ ScMatValType ScInterpreter::GetDoubleOrStringFromMatrix( double& rDouble, else rString = nMatVal.GetString(); +if (ScMatrix::IsValueType( nMatValType)) +{ +sal_uInt16 nError = nMatVal.GetError(); +if (nError) +SetError( nError); +} + return nMatValType; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/tool/interpr1.cxx |4 ++-- sc/source/core/tool/token.cxx| 13 - 2 files changed, 2 insertions(+), 15 deletions(-) New commits: commit 1e8650e0c0902181ac4431fc4fded40abe55a781 Author: Eike Rathke Date: Tue Jun 26 21:57:33 2012 +0200 removed unused lcl_IsReference() Change-Id: I1f79bf11105e06cf713db11a6e00cd41a3aab06b diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 99b0713..1d7f2a1 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -116,19 +116,6 @@ IMPL_FIXEDMEMPOOL_NEWDEL( ScSingleRefToken ) // Need quite a lot of ScDoubleRefToken IMPL_FIXEDMEMPOOL_NEWDEL( ScDoubleRefToken ) -// --- helpers -- - -inline bool lcl_IsReference( OpCode eOp, StackVar eType ) -{ -return -(eOp == ocPush && (eType == svSingleRef || eType == svDoubleRef)) -|| (eOp == ocColRowNameAuto && eType == svDoubleRef) -|| (eOp == ocColRowName && eType == svSingleRef) -|| (eOp == ocMatRef && eType == svSingleRef) -; -} - - // --- class ScRawToken - xub_StrLen ScRawToken::GetStrLen( const sal_Unicode* pStr ) commit a323d44a95c8e4a82599fa33d7d78d4d407741d0 Author: Eike Rathke Date: Tue Jun 26 21:49:01 2012 +0200 bring some sense into translated comment Change-Id: I045927b3310ddef6208a1d0a837ed6bc098f9ca8 diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index f3090bf..a7f6572 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -2970,14 +2970,14 @@ void ScInterpreter::ScN() void ScInterpreter::ScTrim() { -// Doesn't only trim but writes out twice! +// Doesn't only trim but also removes duplicated blanks within! String aVal = comphelper::string::strip(GetString(), ' '); String aStr; register const sal_Unicode* p = aVal.GetBuffer(); register const sal_Unicode* const pEnd = p + aVal.Len(); while ( p < pEnd ) { -if ( *p != ' ' || p[-1] != ' ' )// ' ' can't be first, -1 is fine too +if ( *p != ' ' || p[-1] != ' ' )// first can't be ' ', so -1 is fine aStr += *p; p++; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/ui/inc/prevwsh.hxx |3 - sc/source/ui/view/preview.cxx |5 -- sc/source/ui/view/prevwsh.cxx | 96 +- 3 files changed, 61 insertions(+), 43 deletions(-) New commits: commit baf87aacce6d75f9b01156ce085ef4487d46a406 Author: Noel Power Date: Tue Jun 26 18:19:21 2012 +0100 fix for fdo#51040 preview crash Change-Id: I13d3cfa99294bdce8c9f5133f49e91114feb4baa diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx index f62165f..1da34f3 100644 --- a/sc/source/ui/inc/prevwsh.hxx +++ b/sc/source/ui/inc/prevwsh.hxx @@ -50,7 +50,6 @@ class CommandEvent; class ScPreviewShell: public SfxViewShell { -friend class ScPreview; // allow access to AdjustPosSizePixel ScDocShell* pDocShell; SystemWindow* mpFrameWindow; @@ -66,7 +65,6 @@ friend class ScPreview; // allow access to AdjustPosSizePixel SfxBroadcaster* pAccessibilityBroadcaster; boolGetPageSize( Size& aPageSize ); -voidUpdateNeededScrollBars(); private: voidConstruct( Window* pParent ); DECL_LINK(ScrollHandler, ScrollBar* ); @@ -106,6 +104,7 @@ public: voidInitStartTable(SCTAB nTab); voidUpdateScrollBars(); +voidUpdateNeededScrollBars(bool bFromZoom = false); sal_BoolScrollCommand( const CommandEvent& rCEvt ); voidExecute( SfxRequest& rReq ); diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index ae233ff..8007e0e 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -701,10 +701,7 @@ void ScPreview::SetZoom(sal_uInt16 nNewZoom) SetMapMode( aMMMode ); bInSetZoom = true; // don't scroll during SetYOffset in UpdateScrollBars -if ( Window* pWin = ( pViewShell->GetViewFrame() ? &pViewShell->GetViewFrame()->GetWindow() : NULL ) ) -pViewShell->AdjustPosSizePixel( pWin->GetPosPixel(), pWin->GetSizePixel() ); -else -pViewShell->UpdateScrollBars(); +pViewShell->UpdateNeededScrollBars(true); bInSetZoom = false; bStateValid = false; diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 77f633d..43f9794 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -297,16 +297,9 @@ bool ScPreviewShell::GetPageSize( Size& aPageSize ) return true; } -void ScPreviewShell::UpdateNeededScrollBars() +void ScPreviewShell::UpdateNeededScrollBars( bool bFromZoom ) { -bool bVert = pVerScroll ? pVerScroll->IsVisible() : false; -bool bHori = pHorScroll ? pHorScroll->IsVisible() : false; - Size aPageSize; -if ( !GetPageSize( aPageSize ) ) -return; - -Size aWindowSize = pPreview->GetOutputSize(); OutputDevice* pDevice = Application::GetDefaultDevice(); long nBarW = GetViewFrame()->GetWindow().GetSettings().GetStyleSettings().GetScrollBarSize(); @@ -315,49 +308,74 @@ void ScPreviewShell::UpdateNeededScrollBars() long aHeightOffSet = pDevice ? pDevice->PixelToLogic( Size( nBarW, nBarH ), pPreview->GetMapMode() ).Height() : 0; long aWidthOffSet = aHeightOffSet; -if( pHorScroll ) + +if (!GetPageSize( aPageSize )) +return; + +// for centering, page size without the shadow is used +bool bVert = pVerScroll ? pVerScroll->IsVisible() : false; +bool bHori = pHorScroll ? pHorScroll->IsVisible() : false; +Size aWindowSize = pPreview->GetOutputSize(); +Point aPos = pPreview->GetPosPixel(); +Size aWindowPixelSize = pPreview->GetOutputSizePixel(); + +// if we are called from Zoom then we need to compensate for whatever +// scrollbars were displayed before the zoom was called +if ( bFromZoom ) { -long nMaxPos = aPageSize.Width() - aWindowSize.Width() + aWidthOffSet; -if ( nMaxPos<0 ) -bHori = false; -else -bHori = true; -pHorScroll->Show( bHori ); +if ( bVert ) +{ +aWindowPixelSize.Width() += nBarH; +aWindowSize.Width() += aHeightOffSet; +} +if ( bHori ) +{ +aWindowPixelSize.Height() += nBarW; +aWindowSize.Height() += aWidthOffSet; +} } +// recalculate any needed scrollbars +bHori = false; +bVert = false; -if( pVerScroll ) -{ -nMaxVertPos = aPageSize.Height() - aWindowSize.Height() + aHeightOffSet; +long nMaxWidthPos = aPageSize.Width() - aWindowSize.Width(); +if ( nMaxWidthPos<0 ) +bHori = false; +else +bHori = true; -if ( nMaxVertPos < 0 ) -bVert = false; -else +long nMaxHeightPos = aPageSize.Height() - aWindowSize.Height(); + +if ( nMaxHeightPos < 0 ) +bVert = false; +else +bVert = true; + +// see if having a scroll bar requires the other +if
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/ui/condformat/condformatdlg.cxx |3 +++ sc/source/ui/unoobj/chart2uno.cxx |6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) New commits: commit 555a8955c71f28f93b032e8dd2c627ab3e794b02 Author: Markus Mohrhard Date: Mon Jun 25 01:22:04 2012 +0200 handle also COLLAPSEd in switch this case can never happen Change-Id: Ib1284edb798945a2f6f5ee6268e9426e29b0bd76 diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index f0f677c..6f5ca81 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -628,6 +628,9 @@ void ScCondFrmtEntry::Select() case FORMULA: SetFormulaType(); break; +default: +//should not happen +break; } SwitchToType(meType); mbActive = true; commit 904596e935144e97d762d09942fa0d35068882ce Author: Markus Mohrhard Date: Mon Jun 25 01:19:26 2012 +0200 we still need to check that we have a token, fdo#51326 also fixed another dbgutil crash with gcc safe iterators Change-Id: I5e6675a26f24329125906849c0c2286ea74e9211 diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 35408af..7f17f84 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -308,11 +308,11 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount, SCROW nAllRowCount, { FormulaTokenMap* pCol = it1->second; FormulaTokenMap::const_iterator it2 = pCol->begin(); -for (SCROW nRow = 0; !bFoundValues && nRow < nSmallestValueRowIndex; ++nRow) +for (SCROW nRow = 0; !bFoundValues && nRow < nSmallestValueRowIndex && it2 != pCol->end(); ++nRow) { -if (it2 != pCol->end() && nRow>=nHeaderRowCount) +FormulaToken* pToken = it2->second; +if (pToken && nRow>=nHeaderRowCount) { -FormulaToken* pToken = it2->second; ScRange aRange; bool bExternal = false; StackVar eType = pToken->GetType(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/data/column3.cxx |3 +++ sc/source/ui/condformat/condformatdlg.cxx | 24 2 files changed, 27 insertions(+) New commits: commit d4e2a95a2f7376c36c1241f91a55021fc856c758 Author: Markus Mohrhard Date: Mon Jun 25 00:45:32 2012 +0200 if no new cell exists, create hidden broadcaster cell, fdo#51368 Change-Id: I61b96a0e164269ef85778cba7865d6488ebac79d diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 401f5ec..23dd104 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -1395,6 +1395,9 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, SvtBroadcaster* pBC = pOldCell->ReleaseBroadcaster(); if (pNewCell || pBC) { +if(!pNewCell) +pNewCell = new ScNoteCell(); + if (pBC) { pNewCell->TakeBroadcaster(pBC); commit adc4c53082c2fa1634897bd279afd6b5ba2e16da Author: Markus Mohrhard Date: Sun Jun 24 22:11:41 2012 +0200 only show dialog elements if entry is not collapsed Change-Id: Id85e7b2360c2630c894ce7e4e9ee505810cefe76 diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 75a955f..f0f677c 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -459,6 +459,10 @@ void ScCondFrmtEntry::SwitchToType( ScCondFormatEntryType eType ) maCondText.append(getExpression(maLbCondType.GetSelectEntryPos())); maFtCondition.SetText(maCondText.makeStringAndClear()); maFtCondition.Show(); +maLbType.Hide(); +HideCondElements(); +HideColorScaleElements(); +HideDataBarElements(); } break; default: @@ -466,6 +470,7 @@ void ScCondFrmtEntry::SwitchToType( ScCondFormatEntryType eType ) maLbType.Show(); maFtCondition.SetText(rtl::OUString("")); maFtCondition.Hide(); +maLbType.Show(); break; } } @@ -609,6 +614,21 @@ void ScCondFrmtEntry::SetFormulaType() void ScCondFrmtEntry::Select() { SetControlForeground(Color(COL_RED)); +switch(meType) +{ +case CONDITION: +SetCondType(); +break; +case COLORSCALE: +SetColorScaleType(); +break; +case DATABAR: +SetDataBarType(); +break; +case FORMULA: +SetFormulaType(); +break; +} SwitchToType(meType); mbActive = true; SetHeight(); @@ -1045,6 +1065,10 @@ IMPL_LINK_NOARG( ScCondFormatList, AddBtnHdl ) { ScCondFrmtEntry* pNewEntry = new ScCondFrmtEntry(this, mpDoc); maEntries.push_back( pNewEntry ); +for(EntryContainer::iterator itr = maEntries.begin(); itr != maEntries.end(); ++itr) +{ +itr->Deselect(); +} pNewEntry->Select(); RecalcAll(); return 0; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source tools/inc tools/source
sc/source/ui/view/printfun.cxx |5 - tools/inc/tools/bigint.hxx |6 +++--- tools/source/generic/bigint.cxx |6 +++--- 3 files changed, 10 insertions(+), 7 deletions(-) New commits: commit d29318c78a13f5de031d181b79a655d324ecdf25 Author: Caolán McNamara Date: Fri Jun 22 11:40:19 2012 +0100 Resolves: fdo#45869 we want page preview text to layout for print output We want text to be positioned as it would be for the the high dpi printed output, not as would be ideal for the 96dpi preview window itself. It is supposed to be a print preview surely. This should avoid getting different text positions/widths shown in the "page preview" of calc than gets used when printed/exported to .pdf Change-Id: Iea3acce3c1f2a7051007c22768329c52a7c1d4ee diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index dfc99dc..7f5b665 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -1668,7 +1668,10 @@ void ScPrintFunc::MakeEditEngine() pEditEngine = new ScHeaderEditEngine( EditEngine::CreatePool(), sal_True ); pEditEngine->EnableUndo(false); -pEditEngine->SetRefDevice( pDev ); +//fdo#45869 we want text to be positioned as it would be for the the +//high dpi printed output, not as would be ideal for the 96dpi preview +//window itself +pEditEngine->SetRefDevice(pPrinter ? pPrinter : pDoc->GetRefDevice()); pEditEngine->SetWordDelimiters( ScEditUtil::ModifyDelimiters( pEditEngine->GetWordDelimiters() ) ); pEditEngine->SetControlWord( pEditEngine->GetControlWord() & ~EE_CNTRL_RTFSTYLESHEETS ); commit cd8e530dcd265e2bb67124326957dc4390cc6b0a Author: Caolán McNamara Date: Fri Jun 22 11:30:14 2012 +0100 convert BitInt signatures to rtl::OUString Change-Id: Ic461cdb6283fe48e97787b3f1e8950559d576ca9 diff --git a/tools/inc/tools/bigint.hxx b/tools/inc/tools/bigint.hxx index 1b1d60b..89d2d5e 100644 --- a/tools/inc/tools/bigint.hxx +++ b/tools/inc/tools/bigint.hxx @@ -29,9 +29,9 @@ #define _BIGINT_HXX #include +#include #include "tools/toolsdllapi.h" #include -#include class SvStream; #ifdef _TLBIGINT_INT64 @@ -83,7 +83,7 @@ public: BigInt( sal_uInt16 nVal ); BigInt( sal_uInt32 nVal ); BigInt( const BigInt& rBigInt ); -BigInt( const String& rString ); +BigInt( const rtl::OUString& rString ); #ifdef _TLBIGINT_INT64 BigInt( const SbxINT64 &r ); BigInt( const SbxUINT64 &r ); @@ -97,7 +97,7 @@ public: operatorsal_uIntPtr() const; voidSet( sal_Bool bSet ) { bIsSet = bSet; } -String GetString() const; +rtl::OUString GetString() const; sal_BoolIsSet() const { return bIsSet; } sal_BoolIsNeg() const; diff --git a/tools/source/generic/bigint.cxx b/tools/source/generic/bigint.cxx index 14e4a39..8bff84b 100644 --- a/tools/source/generic/bigint.cxx +++ b/tools/source/generic/bigint.cxx @@ -522,7 +522,7 @@ BigInt::BigInt( const BigInt& rBigInt ) // --- -BigInt::BigInt( const String& rString ) +BigInt::BigInt( const rtl::OUString& rString ) { bIsSet = sal_True; bIsNeg = sal_False; @@ -530,7 +530,7 @@ BigInt::BigInt( const String& rString ) nVal = 0; sal_Bool bNeg = sal_False; -const sal_Unicode* p = rString.GetBuffer(); +const sal_Unicode* p = rString.getStr(); if ( *p == '-' ) { bNeg = sal_True; @@ -655,7 +655,7 @@ BigInt::operator double() const // --- -String BigInt::GetString() const +rtl::OUString BigInt::GetString() const { String aString; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source svl/source svx/source tools/source
sc/source/core/tool/rangelst.cxx |4 sc/source/ui/docshell/olinefun.cxx | 12 sc/source/ui/pagedlg/tphfedit.cxx |5 - sc/source/ui/undo/undoblk.cxx |5 - sc/source/ui/view/cellsh4.cxx |5 - sc/source/ui/view/olkact.cxx |5 - sc/source/ui/view/tabvwshd.cxx |5 - sc/source/ui/view/viewfun3.cxx |5 - sc/source/ui/view/viewfun4.cxx |6 -- svl/source/items/dateitem.cxx |3 --- svx/source/items/hlnkitem.cxx |2 -- svx/source/items/postattr.cxx |3 --- tools/source/string/strascii.cxx |3 --- 13 files changed, 63 deletions(-) New commits: commit 24aa9c16b8e37d63d120901ed04846190490abba Author: Thomas Arnhold Date: Sat Jun 9 05:54:42 2012 +0200 Remove superfluous include comments Change-Id: Id738692aab2043755eb8f051dd8ab9e13051553a diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx index 16f9eca..d2bdec3 100644 --- a/sc/source/core/tool/rangelst.cxx +++ b/sc/source/core/tool/rangelst.cxx @@ -26,10 +26,6 @@ * / - - -// - #define SC_RANGELST_CXX //fuer ICC #include // qsort diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx index 9154152..19925a2 100644 --- a/sc/source/ui/pagedlg/tphfedit.cxx +++ b/sc/source/ui/pagedlg/tphfedit.cxx @@ -26,11 +26,6 @@ * / - - - -//-- - #define _TPHFEDIT_CXX #include "scitems.hxx" #include diff --git a/sc/source/ui/view/cellsh4.cxx b/sc/source/ui/view/cellsh4.cxx index d9b1d2d..8b00066 100644 --- a/sc/source/ui/view/cellsh4.cxx +++ b/sc/source/ui/view/cellsh4.cxx @@ -26,11 +26,6 @@ * / - - - -//-- - #ifdef _MSC_VER #pragma optimize ("", off) #endif diff --git a/sc/source/ui/view/olkact.cxx b/sc/source/ui/view/olkact.cxx index 363fe6c..7175b24 100644 --- a/sc/source/ui/view/olkact.cxx +++ b/sc/source/ui/view/olkact.cxx @@ -26,11 +26,6 @@ * / - - - -//-- - #define _BIGINT_HXX #define _CACHESTR_HXX #define _CONFIG_HXX diff --git a/sc/source/ui/view/tabvwshd.cxx b/sc/source/ui/view/tabvwshd.cxx index db4a498..db83823 100644 --- a/sc/source/ui/view/tabvwshd.cxx +++ b/sc/source/ui/view/tabvwshd.cxx @@ -26,11 +26,6 @@ * / - - - -//-- - #ifdef _MSC_VER #pragma optimize ("", off) #endif diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index c69aaae..77efccc 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -26,11 +26,6 @@ * / - - - -// - #define _SV_NOXSOUND #define _BASE_DLGS_HXX diff --git a/svl/source/items/dateitem.cxx b/svl/source/items/dateitem.cxx index 6acecbd..8d06d45 100644 --- a/svl/source/items/dateitem.cxx +++ b/svl/source/items/dateitem.cxx @@ -26,9 +26,6 @@ * / - -// include --- - #define _DATETIMEITEM_CXX #include #include diff --git a/svx/source/items/hlnkitem.cxx b/svx/source/items/hlnkitem.cxx index bb1abb2..247ef7c 100644 --- a/svx/source/items/hlnkitem.cxx +++ b/svx/source/items/hlnkitem.cxx @@ -26,8 +26,6 @@ * / - -// include --- #define _SVX_HLNKITEM_CXX #include diff --git a/svx/source/items/postattr.cxx b/svx/source/items/postattr.cxx index fc7e0aa..c925ee2 100644 --- a/svx/source/items/postattr.cxx +++ b/svx/source/items/postattr.cxx @@ -26,9 +26,6 @@ * / - -// include --- - #define _SVX_POSTATTR_CXX #include "svx/postattr.hxx" #include diff --git a/tools/source/string/strascii.cxx b/tools/source/string/strascii.cxx index 9360efc..abc7bc2 100644 --- a/tools/source/string/strascii.cxx +++ b/tools/source/string/strascii.cxx @@ -26,9 +26,6 @@ * / - -// ===
[Libreoffice-commits] .: 2 commits - sc/source vcl/source
sc/source/filter/xml/xmlsubti.cxx |2 +- vcl/source/window/decoview.cxx|4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) New commits: commit 6bd0f40d346a36d8b3d454fd0cf087d1ca126ee4 Author: Ivan Timofeev Date: Sat Jun 2 10:36:23 2012 +0400 no need for "> 0" Change-Id: Ie7d4eaffd8e80b6b5c5d11b4e2f255ee7786b5e7 diff --git a/sc/source/filter/xml/xmlsubti.cxx b/sc/source/filter/xml/xmlsubti.cxx index 4d93a21..f760d76 100644 --- a/sc/source/filter/xml/xmlsubti.cxx +++ b/sc/source/filter/xml/xmlsubti.cxx @@ -811,7 +811,7 @@ void ScMyTables::SetMatrix(const ScRange& rScRange, const rtl::OUString& rFormul aMark.SelectTable( rScRange.aStart.Tab(), sal_True ); ScTokenArray* pCode = new ScTokenArray; pCode->AddStringXML( rFormula ); -if( (eGrammar == formula::FormulaGrammar::GRAM_EXTERNAL) && (!rFormulaNmsp.isEmpty() > 0) ) +if( (eGrammar == formula::FormulaGrammar::GRAM_EXTERNAL) && !rFormulaNmsp.isEmpty() ) pCode->AddStringXML( rFormulaNmsp ); pDoc->InsertMatrixFormula( rScRange.aStart.Col(), rScRange.aStart.Row(), commit 402c3c08f4fce12008873510bed47e4f44779a91 Author: Ruslan Kabatsayev Date: Sat Jun 2 01:35:42 2012 +0400 Fix operator precedence error Change-Id: I8806f17aaf9fe2c209b917259dfd1d17e530e170 diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx index 7dfc301..381043e 100644 --- a/vcl/source/window/decoview.cxx +++ b/vcl/source/window/decoview.cxx @@ -666,8 +666,8 @@ void ImplDrawFrame( OutputDevice *const pDev, Rectangle& rRect, if( pWin && pWin->IsNativeControlSupported(CTRL_FRAME, PART_BORDER) ) { ImplControlValue aControlValue( nStyle | -(pWin->GetType()==WINDOW_BORDERWINDOW) ? -FRAME_DRAW_BORDERWINDOWBORDER : 0 ); +(pWin->GetType()==WINDOW_BORDERWINDOW ? +FRAME_DRAW_BORDERWINDOWBORDER : 0) ); Rectangle aBound, aContent; Rectangle aNatRgn( rRect ); if( pWin->GetNativeControlRegion(CTRL_FRAME, PART_BORDER, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/filter/oox/drawingbase.cxx |1 + sc/source/filter/oox/drawingfragment.cxx |4 2 files changed, 5 insertions(+) New commits: commit 1abc0695d770eebd21256a86aeee14a5384d84c7 Author: Noel Power Date: Wed May 30 14:06:27 2012 +0100 don't rotate calc shapes if twoCellAnchor, partial fix bnc#762542 Change-Id: I3ccf6d87db2e9c33f2adaf92e138018f2e27528b diff --git a/sc/source/filter/oox/drawingfragment.cxx b/sc/source/filter/oox/drawingfragment.cxx index f041287..9b7d07a 100644 --- a/sc/source/filter/oox/drawingfragment.cxx +++ b/sc/source/filter/oox/drawingfragment.cxx @@ -257,6 +257,10 @@ void DrawingFragment::onEndElement() case XDR_TOKEN( twoCellAnchor ): if( mxDrawPage.is() && mxShape.get() && mxAnchor.get() ) { +// Rotation is decided by orientation of shape determined +// by the anchor position given by 'twoCellAnchor' +if ( getCurrentElement() == XDR_TOKEN( twoCellAnchor ) ) +mxShape->setRotation(0); EmuRectangle aShapeRectEmu = mxAnchor->calcAnchorRectEmu( getDrawPageSize() ); if( (aShapeRectEmu.X >= 0) && (aShapeRectEmu.Y >= 0) && (aShapeRectEmu.Width >= 0) && (aShapeRectEmu.Height >= 0) ) { commit dbb385df0fc83c36cfc91b82979fabea868592c2 Author: Noel Power Date: Wed May 30 13:59:52 2012 +0100 fix missing form control, partial fix for fdo#49430 Change-Id: I7a0dd3d6e25a48449941e258ea5a16a247a8fe05 diff --git a/sc/source/filter/oox/drawingbase.cxx b/sc/source/filter/oox/drawingbase.cxx index 4a30a15..1cf511c 100644 --- a/sc/source/filter/oox/drawingbase.cxx +++ b/sc/source/filter/oox/drawingbase.cxx @@ -161,6 +161,7 @@ void ShapeAnchor::setCellPos( sal_Int32 nElement, sal_Int32 nParentContext, cons void ShapeAnchor::importVmlAnchor( const OUString& rAnchor ) { meAnchorType = ANCHOR_VML; +meCellAnchorType = CELLANCHOR_PIXEL; ::std::vector< OUString > aTokens; sal_Int32 nIndex = 0; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/data/colorscale.cxx|4 ++-- sc/source/filter/oox/condformatbuffer.cxx |1 + sc/source/filter/oox/extlstcontext.cxx|2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) New commits: commit aaf0b2faab845c624e568d6e1acbc501f5f355cb Author: Markus Mohrhard Date: Mon May 21 13:50:32 2012 +0200 this needs to be the upper limit Change-Id: I4b6f826f8f87b2c4a4bb73d9b6246505d2632b23 diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index 3361d72..8306107 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -654,10 +654,10 @@ double ScDataBarFormat::getMax(double nMin, double nMax) const if(mpFormatData->mpUpperLimit->GetPercent()) { -return nMin + (nMax-nMin)/100*mpFormatData->mpLowerLimit->GetValue(); +return nMin + (nMax-nMin)/100*mpFormatData->mpUpperLimit->GetValue(); } -return mpFormatData->mpLowerLimit->GetValue(); +return mpFormatData->mpUpperLimit->GetValue(); } ScDataBarInfo* ScDataBarFormat::GetDataBarInfo(const ScAddress& rAddr) const commit e8d4b5b6c39d2d0abcd9e814b9fe9ce8c3e2150f Author: Markus Mohrhard Date: Mon May 21 11:11:19 2012 +0200 better import for excel 2007 data bar files Change-Id: I0d32a82aa4829ae635967f24293b2f32a71a4cbe diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx index 8792546..05681b8 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -264,6 +264,7 @@ DataBarRule::DataBarRule( const CondFormat& rFormat ): mrCondFormat( rFormat ), mpFormat(new ScDataBarFormatData) { +mpFormat->meAxisPosition = databar::NONE; } void DataBarRule::importColor( const AttributeList& rAttribs ) diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx index d8c2d1f..3f6991e 100644 --- a/sc/source/filter/oox/extlstcontext.cxx +++ b/sc/source/filter/oox/extlstcontext.cxx @@ -31,6 +31,8 @@ #include #include "colorscale.hxx" +#include + using ::oox::core::ContextHandlerRef; namespace oox { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source sd/source svx/source sw/source vbahelper/source xmloff/source
sc/source/core/data/dpdimsave.cxx |2 +- sc/source/core/data/dpgroup.cxx | 18 +- sd/source/core/CustomAnimationEffect.cxx | 18 +- sd/source/core/CustomAnimationPreset.cxx |2 +- sd/source/core/shapelist.cxx |2 +- sd/source/core/stlpool.cxx|8 sd/source/ui/animations/CustomAnimationPane.cxx |2 +- sd/source/ui/slideshow/slideshowimpl.cxx |5 - sd/source/ui/slideshow/slideshowviewimpl.cxx |2 +- sd/source/ui/view/ViewShellManager.cxx|2 +- sd/source/ui/view/viewshel.cxx|2 +- svx/source/sdr/overlay/overlaymanager.cxx |8 svx/source/sdr/overlay/overlayobjectlist.cxx |6 +++--- sw/source/core/doc/acmplwrd.cxx |2 +- vbahelper/source/vbahelper/vbaapplicationbase.cxx |2 +- xmloff/source/chart/SchXMLExport.cxx |2 +- xmloff/source/table/XMLTableImport.cxx|4 ++-- xmloff/source/text/txtimp.cxx |2 +- 18 files changed, 42 insertions(+), 47 deletions(-) New commits: commit 2b657f5844f9362660c253322e4c4059d5875062 Author: Julien Nabet Date: Sat May 19 15:09:08 2012 +0200 Fix Prefer prefix ++/-- operators for non-primitive types Change-Id: I4ebb1027151c3bc34f81fb1e13de6c4c5cfed54d diff --git a/sc/source/core/data/dpdimsave.cxx b/sc/source/core/data/dpdimsave.cxx index 80257be..b9ce099 100644 --- a/sc/source/core/data/dpdimsave.cxx +++ b/sc/source/core/data/dpdimsave.cxx @@ -185,7 +185,7 @@ rtl::OUString ScDPSaveGroupDimension::CreateGroupName(const rtl::OUString& rPref // look for existing groups for ( ScDPSaveGroupItemVec::const_iterator aIter(aGroups.begin()); -aIter != aGroups.end() && !bExists; aIter++ ) +aIter != aGroups.end() && !bExists; ++aIter ) if (aIter->GetGroupName().equals(aGroupName)) //! ignore case bExists = true; diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx index a0bb5d9..9b5bf9b 100644 --- a/sc/source/core/data/dpgroup.cxx +++ b/sc/source/core/data/dpgroup.cxx @@ -298,7 +298,7 @@ void ScDPGroupItem::AddElement( const ScDPItemData& rName ) bool ScDPGroupItem::HasElement( const ScDPItemData& rData ) const { -for ( ScDPItemDataVec::const_iterator aIter(aElements.begin()); aIter != aElements.end(); aIter++ ) +for ( ScDPItemDataVec::const_iterator aIter(aElements.begin()); aIter != aElements.end(); ++aIter ) if ( aIter->IsCaseInsEqual( rData ) ) return true; @@ -307,7 +307,7 @@ bool ScDPGroupItem::HasElement( const ScDPItemData& rData ) const bool ScDPGroupItem::HasCommonElement( const ScDPGroupItem& rOther ) const { -for ( ScDPItemDataVec::const_iterator aIter(aElements.begin()); aIter != aElements.end(); aIter++ ) +for ( ScDPItemDataVec::const_iterator aIter(aElements.begin()); aIter != aElements.end(); ++aIter ) if ( rOther.HasElement( *aIter ) ) return true; @@ -388,7 +388,7 @@ const ScDPGroupItem* ScDPGroupDimension::GetGroupForData( const ScDPItemData& rD const ScDPGroupItem* ScDPGroupDimension::GetGroupForName( const ScDPItemData& rName ) const { -for ( ScDPGroupItemVec::const_iterator aIter(aItems.begin()); aIter != aItems.end(); aIter++ ) +for ( ScDPGroupItemVec::const_iterator aIter(aItems.begin()); aIter != aItems.end(); ++aIter ) if ( aIter->GetName().IsCaseInsEqual( rName ) ) return &*aIter; @@ -609,7 +609,7 @@ sal_uLong ScDPGroupTableData::GetNumberFormat(long nDim) void ScDPGroupTableData::DisposeData() { -for ( ScDPGroupDimensionVec::iterator aIter(aGroups.begin()); aIter != aGroups.end(); aIter++ ) +for ( ScDPGroupDimensionVec::iterator aIter(aGroups.begin()); aIter != aGroups.end(); ++aIter ) aIter->DisposeData(); for ( long i=0; i& rItems, const vectorGetGroupDim() == nFirstIndex ) diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index ab20da4..16756a5 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -2284,7 +2284,7 @@ CustomAnimationEffectPtr EffectSequenceHelper::findEffect( const ::com::sun::sta CustomAnimationEffectPtr pEffect; EffectSequence::const_iterator aIter( maEffects.begin() ); -for( ; aIter != maEffects.end(); aIter++ ) +for( ; aIter != maEffects.end(); ++aIter ) { if( (*aIter)->getNode() == xNode ) { @@ -2303,7 +2303,7 @@ sal_Int32 EffectSequenceHelper::getOffsetFromEffect( const CustomAnimationEffect sal_Int32 nOffset = 0; EffectSequence::const_iterator aIter( maEffects.begin() ); -for( ; aIter != maEffects.end(); aIter++, nOffset++ ) +
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/ui/view/viewdata.cxx | 49 ++--- 1 file changed, 22 insertions(+), 27 deletions(-) New commits: commit 13bb6dcddcd3e19cd97fdb28e842c778e6e093b3 Author: Markus Mohrhard Date: Fri May 18 19:34:11 2012 +0200 ensure that number of tabs is correctly set in ScViewData, fdo#45987 Change-Id: Ia77ea939f6ce9301afeabe1d1679998ce34b397e diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index b7de81a..71877e8 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -2744,6 +2744,9 @@ void ScViewData::ReadUserDataSequence(const uno::Sequence sal_Int32 nTemp32(0); sal_Int16 nTemp16(0); sal_Bool bPageMode(false); + +EnsureTabDataSize(GetDocument()->GetTableCount()-1); + for (sal_Int32 i = 0; i < nCount; i++) { // SC_VIEWID has to parse and use by mba commit 90d0efb524b2cdd8d65808d18713bfd6b1d117ea Author: Markus Mohrhard Date: Fri May 18 18:11:14 2012 +0200 Revert 4 commits related to fdo#45987 Revert "and another wae ( that I missed )" This reverts commit a1faa06b415f54c0e8ff8a8f1e580e8a57b9296a. Revert "fix wae" This reverts commit 2f5885765445d8a8f50037da3420dbcd19d5634f. Revert "attempt to prevent illegal maTabData access(s)" This reverts commit 8352eb5a1af1eb44550a9d60d31e6c2fb2dc43b9. Conflicts: sc/source/ui/view/viewdata.cxx Revert "fix bad stl access fdo#45987" This reverts commit 8b1d29bc9b00bc2730738a990023a65ab6e0219b. Conflicts: sc/source/ui/view/viewdata.cxx Change-Id: Idba6ec8ab448332ec349f23b10a2cce8b313ff19 33c437c8b9f005c43f03518863e151a6f0fc9589 diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 028ab83..b7de81a 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -486,14 +486,11 @@ void ScViewData::InsertTabs( SCTAB nTab, SCTAB nNewSheets ) void ScViewData::DeleteTab( SCTAB nTab ) { -if ( nTab < static_cast(maTabData.size()) ) -{ -delete maTabData.at(nTab); -if ( nTab == static_cast(maTabData.size()) - 1 ) -maTabData.erase(maTabData.begin() + nTab); -UpdateCurrentTab(); -mpMarkData->DeleteTab( nTab ); -} +delete maTabData.at(nTab); + +maTabData.erase(maTabData.begin() + nTab); +UpdateCurrentTab(); +mpMarkData->DeleteTab( nTab ); } void ScViewData::DeleteTabs( SCTAB nTab, SCTAB nSheets ) @@ -503,8 +500,8 @@ void ScViewData::DeleteTabs( SCTAB nTab, SCTAB nSheets ) mpMarkData->DeleteTab( nTab + i ); delete maTabData.at(nTab + i); } -if ( ( nTab + nSheets ) == static_cast( maTabData.size() - 1 ) ) -maTabData.erase(maTabData.begin() + nTab, maTabData.begin()+ nTab+nSheets); + +maTabData.erase(maTabData.begin() + nTab, maTabData.begin()+ nTab+nSheets); UpdateCurrentTab(); } @@ -541,8 +538,7 @@ void ScViewData::MoveTab( SCTAB nSrcTab, SCTAB nDestTab ) if (nSrcTab < static_cast(maTabData.size())) { pTab = maTabData[nSrcTab]; -if ( nSrcTab == static_cast( maTabData.size() - 1 ) ) -maTabData.erase( maTabData.begin() + nSrcTab ); +maTabData.erase( maTabData.begin() + nSrcTab ); } if (nDestTab < static_cast(maTabData.size())) @@ -663,18 +659,15 @@ void ScViewData::SetZoom( const Fraction& rNewX, const Fraction& rNewY, std::vec SCTAB i = *it; if ( i < static_cast(maTabData.size()) && maTabData[i] ) { -if ( maTabData[i] ) +if ( bPagebreak ) { -if ( bPagebreak ) -{ -maTabData[i]->aPageZoomX = aValidX; -maTabData[i]->aPageZoomY = aValidY; -} -else -{ -maTabData[i]->aZoomX = aValidX; -maTabData[i]->aZoomY = aValidY; -} +maTabData[i]->aPageZoomX = aValidX; +maTabData[i]->aPageZoomY = aValidY; +} +else +{ +maTabData[i]->aZoomX = aValidX; +maTabData[i]->aZoomY = aValidY; } } } @@ -696,8 +689,7 @@ void ScViewData::SetZoom( const Fraction& rNewX, const Fraction& rNewY, sal_Bool void ScViewData::SetShowGrid( bool bShow ) { CreateSelectedTabData(); -if ( maTabData[nTabNo] ) -maTabData[nTabNo]->bShowGrid = bShow; +maTabData[nTabNo]->bShowGrid = bShow; } void ScViewData::RefreshZoom() @@ -2954,7 +2946,7 @@ sal_Bool ScViewData::UpdateFixX( SCTAB nTab ) // sal_True = Wert g if (!ValidTab(nTab))// Default nTab=nTabNo;// akuelle Tabelle -if (!maTabData
[Libreoffice-commits] .: 2 commits - sc/source sw/source
sc/source/filter/excel/xecontent.cxx |1 + sw/source/ui/uiview/pview.cxx|2 +- 2 files changed, 2 insertions(+), 1 deletion(-) New commits: commit 6f6a419a39f8d97a49a84ae730ecd3d93738a744 Author: Ivan Timofeev Date: Tue May 15 10:39:17 2012 +0400 missing break (I suppose) Change-Id: I504cbe271ef4475963b8277a1ab7dcb09b0dda38 diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 9bf323e..a4315ba 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -822,6 +822,7 @@ const char* GetOperatorString(ScConditionMode eMode, bool& bFrmla2) break; case SC_COND_DIRECT: pRet = "expression"; +break; case SC_COND_NONE: default: pRet = ""; commit 9b01e60444b0c176770f0adafc8f1bb4718dfba5 Author: Ivan Timofeev Date: Tue May 15 10:35:41 2012 +0400 use real visibility of SwScrollbar again Change-Id: Idd21d7efa2708ab2486cdaf8bf5910af36551687 diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index 2f1fea6..0bf63ec 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -1367,7 +1367,7 @@ void SwPagePreView::CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool /*bInner* const long nTmp = rSet.GetScrollBarSize(); if ( pVScrollbar->IsVisible( true ) ) rToFill.Right() = nTmp; -if ( pHScrollbar->IsVisible( false ) ) +if ( pHScrollbar->IsVisible( true ) ) rToFill.Bottom() = nTmp; SetBorderPixel( rToFill ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/tool/interpr2.cxx | 76 +++ sc/source/filter/excel/xlformula.cxx |5 -- 2 files changed, 28 insertions(+), 53 deletions(-) New commits: commit eb1770f05fde3777af7a62ec1c84ce8b088e3ec4 Author: Eike Rathke Date: Mon May 14 13:38:37 2012 +0200 further changes to patch fdo#44456 added calc function DATEDIF Calculation needed tweaking. * simplified "m" case, equal dates return 0 anyway, need to handle only date1 nDate1 ) -{ -if ( d2 < d1 ) -md -= 1; -} -else -{ -if ( d2 >= d1 ) -md += 1; -} +if (d1 > d2) +--md; PushInt( md ); } else if ( aInterval.EqualsIgnoreCaseAscii( "y" ) ) @@ -493,38 +485,26 @@ void ScInterpreter::ScGetDateDif() } else if ( aInterval.EqualsIgnoreCaseAscii( "md" ) ) { -// Return number of days, ignoring months and years. +// Return number of days, excluding months and years. // This is actually the remainder of days when subtracting years // and months from the difference of dates. Birthday-like 23 years -// and 10 months and 42 days. +// and 10 months and 19 days. // Algorithm's roll-over behavior extracted from Excel by try and // error.. -// If day1 < day2 then simply day2 - day1. -// If day1 > day2 and month1 <= month2 then set day1 in month -// before date of day2 and subtract dates, e.g. for -// 2012-01-28,2012-03-01 set 2012-02-28 and then -// (2012-03-01)-(2012-02-28) => 2 days (leap year). +// If day1 <= day2 then simply day2 - day1. +// If day1 > day2 then set month1 to month2-1 and year1 to +// year2(-1) and subtract dates, e.g. for 2012-01-28,2012-03-01 set +// 2012-02-28 and then (2012-03-01)-(2012-02-28) => 2 days (leap +// year). // For 2011-01-29,2011-03-01 the non-existent 2011-02-29 rolls over // to 2011-03-01 so the result is 0. Same for day 31 in months with // only 30 days. -// If day1 >= day2 and month1 > month2 then set year2 to year1 and -// subtract dates reverse (effectively swaps day1/month1 with -// day2/month2). -// If day1 == day2 and month1 <= month2 the result is 0. long nd; -if (d1 < d2) +if (d1 <= d2) nd = d2 - d1; -else if (m1 > m2) // && d1 >= d2 -{ -aDate2.SetYear( y1 ); -aDate2.Normalize(); -nd = aDate1 - aDate2; -} -else if (d1 == d2) // && m1 <= m2 -nd = 0; -else// d1 > d2 && m1 <= m2 +else { if (m2 == 1) { @@ -536,7 +516,6 @@ void ScInterpreter::ScGetDateDif() aDate1.SetYear( y2 ); aDate1.SetMonth( m2 - 1 ); } -// aDate1 day is still d1 aDate1.Normalize(); nd = aDate2 - aDate1; } @@ -544,27 +523,16 @@ void ScInterpreter::ScGetDateDif() } else if ( aInterval.EqualsIgnoreCaseAscii( "ym" ) ) { -// Return number of months, ignoring years. - -/* TODO: check what Excel really does, though this seems to be - * reasonable */ - -int md; -if (m1 == m2) -md = 0; -else -{ -md = m2 - m1; -if (m1 > m2) -md += 12; // year roll-over -if (d1 > d2) ---md; // one incomplete month -} +// Return number of months, excluding years. +int md = m2 - m1 + 12 * (y2 - y1); +if (d1 > d2) +--md; +md %= 12; PushInt( md ); } else if ( aInterval.EqualsIgnoreCaseAscii( "yd" ) ) { -// Return number of days, ignoring years. +// Return number of days, excluding years. /* TODO: check what Excel really does, though this seems to be * reasonable */ @@ -573,7 +541,15 @@ void ScInterpreter::ScGetDateDif() if (m2 > m1 || (m2 == m1 && d2 >= d1)) aDate1.SetYear( y2 ); else -aDate1.SetYear( y2 - 1 ); // one incomplete year +aDate1.SetYear( y2 - 1 ); +// XXX NOTE: Excel for the case 1988-06-22,2012-05-11 returns +// 323, whereas the result here is 324. Don't they use the leap +// year of 2012? +// htt
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/filter/lotus/tool.cxx | 115 1 file changed, 59 insertions(+), 56 deletions(-) New commits: commit cb7ff0d3801868d6ed7ba9be79095cdce9e29915 Author: Eike Rathke Date: Wed May 9 17:25:36 2012 +0200 changes to fdo#44738 patch to make it work with other locales Using some fixed format code for whatever locale is wrong anyway, use NfIndexTableOffset and NfKeywordIndex instead. Probably those didn't exist back at that time. diff --git a/sc/source/filter/lotus/tool.cxx b/sc/source/filter/lotus/tool.cxx index b8928ea..3795b53 100644 --- a/sc/source/filter/lotus/tool.cxx +++ b/sc/source/filter/lotus/tool.cxx @@ -213,11 +213,11 @@ SfxUInt32Item* FormCache::NewAttr( sal_uInt8 nFormat, sal_uInt8 nSt ) // creates a new format sal_uInt8 nL, nH; // Low-/High-Nibble sal_uInt8 nForm = nFormat; -String aFormString; -const sal_Char* pFormString = 0; +String aFormString; sal_Int16 eType = NUMBERFORMAT_ALL; sal_uInt32 nIndex1; sal_uInt32 nHandle; +NfIndexTableOffset eIndexTableOffset = NF_NUMERIC_START; sal_BoolbDefault = false; //void GenerateFormat( aFormString, eType, COUNTRY_SYSTEM, LANGUAGE_SYSTEM, // sal_Bool bThousand, sal_Bool IsRed, sal_uInt16 nPrecision, sal_uInt16 nAnzLeading ); @@ -302,57 +302,61 @@ SfxUInt32Item* FormCache::NewAttr( sal_uInt8 nFormat, sal_uInt8 nSt ) case 0x02: // Date: Day, Month, Year //fDate;dfDayMonthYearLong; eType = NUMBERFORMAT_DATE; -pFormString = "DD.MM."; +eIndexTableOffset = NF_DATE_SYS_DDMM; break; case 0x03: // Date: Day, Month //fDate;dfDayMonthLong; eType = NUMBERFORMAT_DATE; -pFormString = "DD."; +aFormString = pFormTable->GetKeyword( eLanguage, NF_KEY_DD); +aFormString += pFormTable->GetDateSep();// matches last eLanguage +aFormString += pFormTable->GetKeyword( eLanguage, NF_KEY_); break; case 0x04: // Date: Month, Year //fDate;dfMonthYearLong; eType = NUMBERFORMAT_DATE; -pFormString = "MM."; +aFormString = pFormTable->GetKeyword( eLanguage, NF_KEY_MM); +aFormString += pFormTable->GetDateSep();// matches last eLanguage +aFormString += pFormTable->GetKeyword( eLanguage, NF_KEY_); break; case 0x05: // text format //fString;nSt; eType = NUMBERFORMAT_TEXT; -pFormString = "@"; +eIndexTableOffset = NF_TEXT; break; case 0x06: // hidden //wFlag |= paHideAll;bSetFormat = sal_False; eType = NUMBERFORMAT_NUMBER; -pFormString = ""; +aFormString = "\"\""; break; case 0x07: // Time: hour, min, sec //fTime;tfHourMinSec24; eType = NUMBERFORMAT_TIME; -pFormString = "HH:MM:SS"; +eIndexTableOffset = NF_TIME_HHMMSS; break; case 0x08: // Time: hour, min //fTime;tfHourMin24; eType = NUMBERFORMAT_TIME; -pFormString = "HH:MM"; +eIndexTableOffset = NF_TIME_HHMM; break; case 0x09: // Date, intern sal_Int32 1 //fDate;dfDayMonthYearLong; eType = NUMBERFORMAT_DATE; -pFormString = "DD.MM."; +eIndexTableOffset = NF_DATE_SYS_DDMM; break; case 0x0A: // Date, intern sal_Int32 2 //fDate;dfDayMonthYearLong; eType = NUMBERFORMAT_DATE; -pFormString = "DD.MM."; +eIndexTableOffset = NF_DATE_SYS_DDMM; break; case 0x0B: // Time, intern sal_Int32 1 //fTime;tfHourMinSec24; eType = NUMBERFORMAT_TIME; -pFormString = "HH:MM:SS"; +eIndexTableOffset = NF_TIME_HHMMSS; break; case 0x0C: // Time, intern sal_Int32 2 //fTime;tfHourMinSec24; eType = NUMBERFORMAT_TIME; -pFormString = "HH:MM:SS"; +eIndexTableOffset = NF_TIME_HHMMSS; break; case 0x0F: // standard //fStand
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/core/data/colorscale.cxx|5 +++-- sc/source/core/data/documen4.cxx |3 ++- sc/source/filter/oox/condformatbuffer.cxx | 25 - 3 files changed, 29 insertions(+), 4 deletions(-) New commits: commit 9cfab5c687b337b035179561af49c16eea93b459 Author: Markus Mohrhard Date: Wed May 9 06:17:47 2012 +0200 index is 1-based in this case Change-Id: I74aae3f422423de09cb012e274f8d536f8b778f1 diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index 4e74d1e..787690d 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -148,12 +148,13 @@ void ScColorScaleFormatList::AddFormat( ScColorScaleFormat* pFormat ) maColorScaleFormats.push_back( pFormat ); } +// attention nFormat is 1 based, 0 is reserved for no format ScColorScaleFormat* ScColorScaleFormatList::GetFormat(sal_uInt32 nFormat) { -if( nFormat >= size() ) +if( nFormat > size() || !nFormat ) return NULL; -return &maColorScaleFormats[nFormat]; +return &maColorScaleFormats[nFormat-1]; } ScColorScaleFormatList::iterator ScColorScaleFormatList::begin() diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index 7df52cc..b936699 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -629,6 +629,7 @@ sal_uLong ScDocument::AddCondFormat( const ScConditionalFormat& rNew ) } //takes ownership +// returns a 1-based index, 0 is reserved for no entry sal_uLong ScDocument::AddColorScaleFormat( ScColorScaleFormat* pNew ) { if(!pNew) @@ -639,7 +640,7 @@ sal_uLong ScDocument::AddColorScaleFormat( ScColorScaleFormat* pNew ) mpColorScaleList->AddFormat( pNew ); -return mpColorScaleList->size()-1; +return mpColorScaleList->size(); } sal_uLong ScDocument::AddValidationEntry( const ScValidationData& rNew ) commit a2a9f197f3f3e16ef5efa1d9c35e0d1fee4e3c71 Author: Markus Mohrhard Date: Wed May 9 06:15:34 2012 +0200 apply color scale to area during xlsx import Change-Id: I8f616c85df0e9d33c74c7354dfcadbf55bb91dc7 diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx index 7292245..e189c75 100644 --- a/sc/source/filter/oox/condformatbuffer.cxx +++ b/sc/source/filter/oox/condformatbuffer.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include "oox/helper/attributelist.hxx" #include "oox/helper/containerhelper.hxx" #include "oox/helper/propertyset.hxx" @@ -50,8 +51,15 @@ #include "addressconverter.hxx" #include "biffinputstream.hxx" #include "stylesbuffer.hxx" + #include "colorscale.hxx" #include "document.hxx" +#include "convuno.hxx" +#include "docsh.hxx" +#include "docfunc.hxx" +#include "markdata.hxx" +#include "docpool.hxx" +#include "scitems.hxx" #include @@ -654,7 +662,22 @@ void CondFormatRule::finalizeImport( const Reference< XSheetConditionalEntries > ScColorScaleFormat* pFormat = new ScColorScaleFormat(); mpColor->AddEntries( pFormat ); -rDoc.AddColorScaleFormat(pFormat); +sal_Int32 nIndex = rDoc.AddColorScaleFormat(pFormat); + +// apply attributes to cells +// +const ApiCellRangeList& rRanges = mrCondFormat.getRanges(); +for( ApiCellRangeList::const_iterator itr = rRanges.begin(); itr != rRanges.end(); ++itr) +{ +ScRange aRange; +ScUnoConversion::FillScRange(aRange, *itr); +ScPatternAttr aPattern( rDoc.GetPool() ); +aPattern.GetItemSet().Put( SfxUInt32Item( ATTR_COLORSCALE, nIndex ) ); +ScDocShell* pShell = static_cast(rDoc.GetDocumentShell()); +ScMarkData aMarkData; +aMarkData.SetMarkArea(aRange); +pShell->GetDocFunc().ApplyAttributes( aMarkData, aPattern, sal_True, sal_True ); +} } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/filter/excel/xlroot.cxx |6 +++--- sc/source/ui/unoobj/textuno.cxx |3 --- 2 files changed, 3 insertions(+), 6 deletions(-) New commits: commit ed89b3799f2b0131f2150b7762044afd4ffd8fd2 Author: Kohei Yoshida Date: Thu Apr 26 21:09:52 2012 -0400 Evil manual reference counter manipulations. Let's murder them. Incidentally, this fixes the dbgutil error problem. The old code was passing a copy of the ScHeaderFooterContentObj object to the ScHeaderFooterTextData object, which was why the counter was incremented on copy (though they should still have used a wrapper instead of manual reference counting). My new code passes a reference, which removes the copying, but those pesky acquire() and release() calls were still there. This caused the ScHeaderFooterContentObj object to never get deleted, which in turn caused the dbgutil refcounting check of SvxUnoTextRangeBase object to fail. Change-Id: I4e1780b32b21098a121ec7a43bb3eb842a419584 diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index fbae7fd..b6fd429 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -204,7 +204,6 @@ ScHeaderFooterTextData::ScHeaderFooterTextData( pForwarder( NULL ), bDataValid(false) { -rContentObj.acquire(); // must not go away } ScHeaderFooterTextData::~ScHeaderFooterTextData() @@ -213,8 +212,6 @@ ScHeaderFooterTextData::~ScHeaderFooterTextData() delete pForwarder; delete pEditEngine; - -rContentObj.release(); } SvxTextForwarder* ScHeaderFooterTextData::GetTextForwarder() commit 861acd5b73956425da788c78fb1ed5c283a1f6a0 Author: Kohei Yoshida Date: Thu Apr 26 19:12:07 2012 -0400 Get it to build in non-dbgutil build with debug=true. diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx index 6f088f4..a3168c6 100644 --- a/sc/source/filter/excel/xlroot.cxx +++ b/sc/source/filter/excel/xlroot.cxx @@ -177,7 +177,7 @@ XclRootData::~XclRootData() XclRoot::XclRoot( XclRootData& rRootData ) : mrData( rRootData ) { -#if OSL_DEBUG_LEVEL > 0 +#if defined(DBG_UTIL) && OSL_DEBUG_LEVEL > 0 ++mrData.mnObjCnt; #endif @@ -189,14 +189,14 @@ XclRoot::XclRoot( XclRootData& rRootData ) : XclRoot::XclRoot( const XclRoot& rRoot ) : mrData( rRoot.mrData ) { -#if OSL_DEBUG_LEVEL > 0 +#if defined(DBG_UTIL) && OSL_DEBUG_LEVEL > 0 ++mrData.mnObjCnt; #endif } XclRoot::~XclRoot() { -#if OSL_DEBUG_LEVEL > 0 +#if defined(DBG_UTIL) && OSL_DEBUG_LEVEL > 0 --mrData.mnObjCnt; #endif } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: 2 commits - sc/source
sc/source/ui/dbgui/asciiopt.cxx |2 ++ sc/source/ui/dbgui/imoptdlg.cxx |5 + sc/source/ui/dbgui/imoptdlg.hrc |1 + sc/source/ui/dbgui/imoptdlg.src | 28 ++-- sc/source/ui/dbgui/scuiimoptdlg.cxx | 14 -- sc/source/ui/docshell/docsh.cxx |6 +- sc/source/ui/inc/imoptdlg.hxx | 14 +- sc/source/ui/inc/scuiimoptdlg.hxx |3 ++- 8 files changed, 50 insertions(+), 23 deletions(-) New commits: commit 3cceb8a900cd1fe1ae9bdb0c2e532e82a1835861 Author: Eike Rathke Date: Wed Apr 25 14:17:00 2012 +0200 changes to fdo#45664 EasyHack * in dialog, placed "Save cell formulas" checkbox directly under "Save cell content as shown" as they are related and "Fixed column width" should be last * also reordered entries in .src file for overview * added HelpIDs, also to older "Quote all text cells" checkbox * reordered checkbox member variables for tab order * do not disable "Save cell content as shown" if "Save cell formulas" is checked, they are independent, content as shown still applies to value cells * changed label to "Save cell formulas instead of calculated values" for clarity * initialize "Save cell formulas" with view option that was removed from ScDocShell::AsciiSave() diff --git a/sc/source/ui/dbgui/imoptdlg.src b/sc/source/ui/dbgui/imoptdlg.src index ce00740..7ad67be 100644 --- a/sc/source/ui/dbgui/imoptdlg.src +++ b/sc/source/ui/dbgui/imoptdlg.src @@ -92,36 +92,37 @@ ModalDialog RID_SCDLG_IMPORTOPT Size = MAP_APPFONT ( 188 , 8 ) ; Text [ en-US ] = "Field options" ; }; -CheckBox CB_FIXEDWIDTH +CheckBox CB_SAVESHOWN { -HelpID = "sc:CheckBox:RID_SCDLG_IMPORTOPT:CB_FIXEDWIDTH"; -Pos = MAP_APPFONT( 12, 92 ); +HelpID = "sc:CheckBox:RID_SCDLG_IMPORTOPT:CB_SAVESHOWN"; +Pos = MAP_APPFONT( 12, 66 ); Size = MAP_APPFONT( 172, 10 ); Hide = TRUE; -Text [ en-US ] = "Fixed column ~width"; +Text [ en-US ] = "Save cell content as ~shown"; }; -CheckBox CB_SAVESHOWN +CheckBox CB_FORMULAS { -Pos = MAP_APPFONT( 12, 66 ); +HelpID = "sc:CheckBox:RID_SCDLG_IMPORTOPT:CB_FORMULAS"; +Pos = MAP_APPFONT( 12, 79 ); Size = MAP_APPFONT( 172, 10 ); -TabStop = TRUE; Hide = TRUE; -Text [ en-US ] = "Save cell content as ~shown"; +Text [ en-US ] = "Save cell fo~rmulas instead of calculated values"; }; CheckBox CB_QUOTEALL { HelpID = "sc:CheckBox:RID_SCDLG_IMPORTOPT:CB_QUOTEALL"; -Pos = MAP_APPFONT( 12, 79 ); -Size = MAP_APPFONT( 164, 10 ); +Pos = MAP_APPFONT( 12, 92 ); +Size = MAP_APPFONT( 172, 10 ); Hide = TRUE; Text [ en-US ] = "~Quote all text cells"; }; -CheckBox CB_FORMULAS +CheckBox CB_FIXEDWIDTH { +HelpID = "sc:CheckBox:RID_SCDLG_IMPORTOPT:CB_FIXEDWIDTH"; Pos = MAP_APPFONT( 12, 105 ); Size = MAP_APPFONT( 172, 10 ); Hide = TRUE; -Text [ en-US ] = "Save cell fo~rmulas"; +Text [ en-US ] = "Fixed column ~width"; }; OKButton BTN_OK { diff --git a/sc/source/ui/dbgui/scuiimoptdlg.cxx b/sc/source/ui/dbgui/scuiimoptdlg.cxx index 245d685..e6952d9 100644 --- a/sc/source/ui/dbgui/scuiimoptdlg.cxx +++ b/sc/source/ui/dbgui/scuiimoptdlg.cxx @@ -32,6 +32,7 @@ #include "scuiimoptdlg.hxx" +#include "tabvwsh.hxx" #include "scresid.hxx" #include "imoptdlg.hrc" #include @@ -133,10 +134,10 @@ ScImportOptionsDlg::ScImportOptionsDlg( aEdFieldSep ( this, ScResId( ED_FIELDSEP ) ), aFtTextSep ( this, ScResId( FT_TEXTSEP ) ), aEdTextSep ( this, ScResId( ED_TEXTSEP ) ), -aCbQuoteAll ( this, ScResId( CB_QUOTEALL ) ), aCbShown( this, ScResId( CB_SAVESHOWN ) ), -aCbFixed( this, ScResId( CB_FIXEDWIDTH ) ), aCbFormulas ( this, ScResId( CB_FORMULAS ) ), +aCbQuoteAll ( this, ScResId( CB_QUOTEALL ) ), +aCbFixed( this, ScResId( CB_FIXEDWIDTH ) ), aBtnOk ( this, ScResId( BTN_OK ) ), aBtnCancel ( this, ScResId( BTN_CANCEL ) ), aBtnHelp( this, ScResId( BTN_HELP ) ) @@ -208,7 +209,7 @@ ScImportOptionsDlg::ScImportOptionsDlg( if( bAscii ) { Size aWinSize( GetSizePixel() ); -aWinSize.Height() = aCbFormulas.GetPosPixel().Y() + aCbFormulas.GetSizePixel().Height(); +aWinSize.Height() = aCbFixed.GetPosPixel().Y() + aCbFixed.GetSizePixel().Height(); Size aDiffSize( LogicToPixel( Size( 0, 6 ), MapMode( MAP_APPFONT ) ) ); aWinSize.Height() += aDiffSize.Height(); SetSizePixel( aWinSize ); @@ -220,8 +221,11 @@ ScImportOptionsDlg::ScImportOptionsDlg( aCbQuoteAll.Show(); aCbQuoteAll.Check( false ); aCbFormulas.Show(); -aCbFormulas.SetClickHdl( LINK(