[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/ui/Accessibility/AccessibleCsvControl.cxx | 74 +--- sc/source/ui/inc/AccessibleCsvControl.hxx | 53 +++--- 2 files changed, 18 insertions(+), 109 deletions(-) New commits: commit 28b7b783202d251f43658b2ff1d8df3f10d6d1b8 Author: Stephan Bergmann AuthorDate: Fri Jan 27 15:30:06 2023 +0100 Commit: Stephan Bergmann CommitDate: Sat Jan 28 17:43:29 2023 + Use ImplInheritanceHelper in ScAccessibleCsvCell Change-Id: I46e9985fe3bb05dc677b4046b3cad18dea1086b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146276 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index 075657fd9b21..eeaee6e2f91c 100644 --- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx @@ -1219,7 +1219,7 @@ ScAccessibleCsvCell::ScAccessibleCsvCell( ScCsvGrid& rGrid, OUString aCellText, sal_Int32 nRow, sal_Int32 nColumn ) : -ScAccessibleCsvControl( rGrid ), +ImplInheritanceHelper( rGrid ), AccessibleStaticTextBase( SvxEditSourcePtr() ), maCellText(std::move( aCellText )), mnLine( nRow ? (nRow + rGrid.GetFirstVisLine() - 1) : CSV_LINE_HEADER ), @@ -1310,11 +1310,11 @@ sal_Int64 SAL_CALL ScAccessibleCsvCell::getAccessibleStateSet() // XInterface - -IMPLEMENT_FORWARD_XINTERFACE2( ScAccessibleCsvCell, ScAccessibleCsvControl, AccessibleStaticTextBase ) +IMPLEMENT_FORWARD_XINTERFACE2( ScAccessibleCsvCell, ImplInheritanceHelper, AccessibleStaticTextBase ) // XTypeProvider -- -IMPLEMENT_FORWARD_XTYPEPROVIDER2( ScAccessibleCsvCell, ScAccessibleCsvControl, AccessibleStaticTextBase ) +IMPLEMENT_FORWARD_XTYPEPROVIDER2( ScAccessibleCsvCell, ImplInheritanceHelper, AccessibleStaticTextBase ) // helpers diff --git a/sc/source/ui/inc/AccessibleCsvControl.hxx b/sc/source/ui/inc/AccessibleCsvControl.hxx index ea3308fc4eb5..cb1efc309353 100644 --- a/sc/source/ui/inc/AccessibleCsvControl.hxx +++ b/sc/source/ui/inc/AccessibleCsvControl.hxx @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -400,8 +399,9 @@ private: }; /** Accessible class representing a cell of the CSV grid control. */ -class ScAccessibleCsvCell : public ScAccessibleCsvControl - , public cppu::ImplHelper1 +class ScAccessibleCsvCell : public cppu::ImplInheritanceHelper< +ScAccessibleCsvControl, +css::accessibility::XAccessible> , public ::accessibility::AccessibleStaticTextBase { protected: commit ec68d4bb894882835aed28cee8537481afd0e302 Author: Stephan Bergmann AuthorDate: Fri Jan 27 15:25:24 2023 +0100 Commit: Stephan Bergmann CommitDate: Sat Jan 28 17:43:22 2023 + Use ImplInheritanceHelper in ScAccessibleCsvGrid Change-Id: I1713fb24ed16ef9db6d2815a286d4182f19a5e6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146275 Tested-by: Jenkins Reviewed-by: Stephan Bergmann diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index bc5dd8208b80..075657fd9b21 100644 --- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx @@ -727,7 +727,7 @@ static sal_uInt32 lcl_GetGridColumn( sal_Int32 nApiColumn ) } ScAccessibleCsvGrid::ScAccessibleCsvGrid(ScCsvGrid& rGrid) -: ScAccessibleCsvControl(rGrid) +: ImplInheritanceHelper(rGrid) { } @@ -1069,39 +1069,6 @@ void SAL_CALL ScAccessibleCsvGrid::deselectAccessibleChild( sal_Int64 nSelectedC implSelectColumn( nColumn, false ); } -// XInterface - - -Any SAL_CALL ScAccessibleCsvGrid::queryInterface( const css::uno::Type& rType ) -{ -Any aAny( ScAccessibleCsvGridImpl::queryInterface( rType ) ); -return aAny.hasValue() ? aAny : ScAccessibleCsvControl::queryInterface( rType ); -} - -void SAL_CALL ScAccessibleCsvGrid::acquire() noexcept -{ -ScAccessibleCsvControl::acquire(); -} - -void SAL_CALL ScAccessibleCsvGrid::release() noexcept -{ -ScAccessibleCsvControl::release(); -} - -// XTypeProvider -- - -Sequence< css::uno::Type > SAL_CALL ScAccessibleCsvGrid::getTypes() -{ -return ::comphelper::concatSequences( ScAccessibleCsvControl::getTypes(), -Sequence { -cppu::UnoType::get(), -cppu::UnoType::get() }); -} - -Sequence< sal_Int8 > SAL_CALL ScAccessibleCsvGrid::getImplementationId() -{ -return css::uno::S
[Libreoffice-commits] core.git: 3 commits - sc/source vcl/source vcl/unx
sc/source/filter/inc/workbookhelper.hxx |2 -- sc/source/filter/oox/defnamesbuffer.cxx |4 ++-- sc/source/filter/oox/workbookhelper.cxx | 25 - vcl/source/font/font.cxx|3 ++- vcl/unx/generic/gdi/cairotextrender.cxx |6 ++ 5 files changed, 22 insertions(+), 18 deletions(-) New commits: commit eba5cfe961d3b6e429ee88d452001e689268f3ff Author: Caolán McNamara AuthorDate: Sun Dec 11 20:45:48 2022 + Commit: Caolán McNamara CommitDate: Sun Dec 11 23:11:08 2022 + ofz#54221 Out-of-memory Change-Id: I4b4da37dfa0a961f77bc3bccdf2d25321f7d2447 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143951 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx index 7bd74f0a4830..878eb3e1ac99 100644 --- a/vcl/unx/generic/gdi/cairotextrender.cxx +++ b/vcl/unx/generic/gdi/cairotextrender.cxx @@ -266,6 +266,12 @@ void CairoTextRender::DrawTextLayout(const GenericSalLayout& rLayout, const SalG return; } +if (nWidth > 4024) +{ +SAL_WARN("vcl", "rendering text would use > 2G Memory: " << nWidth); +return; +} + if (__lsan_disable) __lsan_disable(); #endif commit c6fcdc2a4a354f284ddb5f000572e2146a706715 Author: jsala AuthorDate: Fri Dec 9 19:44:30 2022 +0100 Commit: Eike Rathke CommitDate: Sun Dec 11 23:11:02 2022 + tdf#91367 Remove ApiTokenSequence uses. Remove unneeded empty ApiTokenSequence parameters. They go throught some calls and then are converted to ScTokenArray. A call to ConvertToTokenArray can be removed. Change-Id: Ic22845e0e06e3af3a91dab966538e59c3e21d470 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143886 Tested-by: Jenkins Reviewed-by: Eike Rathke diff --git a/sc/source/filter/inc/workbookhelper.hxx b/sc/source/filter/inc/workbookhelper.hxx index 0234c50252ff..7aec3a68409c 100644 --- a/sc/source/filter/inc/workbookhelper.hxx +++ b/sc/source/filter/inc/workbookhelper.hxx @@ -168,7 +168,6 @@ public: @param orName (in/out-parameter) Returns the resulting used name. */ RangeDataRet createNamedRangeObject( OUString& orName, -const css::uno::Sequence< css::sheet::FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, bool bHidden ) const; @@ -177,7 +176,6 @@ public: @param orName (in/out-parameter) Returns the resulting used name. */ RangeDataRet createLocalNamedRangeObject( OUString& orName, -const css::uno::Sequence< css::sheet::FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab, bool bHidden ) const; diff --git a/sc/source/filter/oox/defnamesbuffer.cxx b/sc/source/filter/oox/defnamesbuffer.cxx index 8cae1fb737bd..4f8155cae40e 100644 --- a/sc/source/filter/oox/defnamesbuffer.cxx +++ b/sc/source/filter/oox/defnamesbuffer.cxx @@ -234,9 +234,9 @@ void DefinedName::createNameObject( sal_Int32 nIndex ) // create the name and insert it into the document, maCalcName will be changed to the resulting name if (maModel.mnSheet >= 0) -maScRangeData = createLocalNamedRangeObject( maCalcName, ApiTokenSequence(), nIndex, nNameFlags, maModel.mnSheet, maModel.mbHidden ); +maScRangeData = createLocalNamedRangeObject(maCalcName, nIndex, nNameFlags, maModel.mnSheet, maModel.mbHidden); else -maScRangeData = createNamedRangeObject( maCalcName, ApiTokenSequence(), nIndex, nNameFlags, maModel.mbHidden ); +maScRangeData = createNamedRangeObject( maCalcName, nIndex, nNameFlags, maModel.mbHidden); mnTokenIndex = nIndex; } diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index 1f07567f1672..7d651b9764ab 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -150,9 +150,9 @@ public: /** Returns the specified cell or page style from the Calc document. */ Reference< XStyle > getStyleObject( const OUString& rStyleName, bool bPageStyle ) const; /** Creates and returns a defined name on-the-fly in the Calc document. */ -WorkbookHelper::RangeDataRet createNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, bool bHidden ); +WorkbookHelper::RangeDataRet createNamedRangeObject(OUString& orName, sal_Int32 nIndex, sal_Int32 nNameFlags, bool bHidden); /** Creates and returns a defined name on the-fly in the correct Calc sheet. */ -WorkbookHelper::RangeDataRet createLocalNamedRangeObject( OUString& orName, const Sequence< FormulaToken>& rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags,
[Libreoffice-commits] core.git: 3 commits - sc/source sd/source vcl/unx
sc/source/filter/lotus/lotimpop.cxx | 36 ++ sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx | 10 --- sd/source/ui/inc/AccessibleDocumentViewBase.hxx |5 - vcl/unx/gtk3/a11y/atkwrapper.hxx |1 vcl/unx/gtk3/a11y/gtk3atkwrapper.cxx | 28 ++ 5 files changed, 65 insertions(+), 15 deletions(-) New commits: commit 1bc297cb63e52b5cad3580ac5a3cb274c6dfcf66 Author: Caolán McNamara AuthorDate: Wed Mar 24 09:30:18 2021 + Commit: Caolán McNamara CommitDate: Wed Mar 24 20:41:58 2021 +0100 cid#1474363 Untrusted value as argument and... cid#1474164 Untrusted value as argument cid#1474033 Untrusted value as argument cid#1473968 Untrusted value as argument cid#1473922 Untrusted value as argument cid#1473817 Untrusted value as argument Change-Id: I19d3b758767c2b0cb4369257efbe477c37f231ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113027 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/filter/lotus/lotimpop.cxx b/sc/source/filter/lotus/lotimpop.cxx index 78ff31f824ef..1fa5c14632e7 100644 --- a/sc/source/filter/lotus/lotimpop.cxx +++ b/sc/source/filter/lotus/lotimpop.cxx @@ -173,6 +173,12 @@ void ImportLotus::Errcell() Read( aA ); +if (!rD.ValidAddress(aA)) +{ +SAL_WARN("sc.filter", "invalid address"); +return; +} + ScSetStringParam aParam; aParam.setTextInput(); rD.EnsureTable(aA.Tab()); @@ -185,6 +191,12 @@ void ImportLotus::Nacell() Read( aA ); +if (!rD.ValidAddress(aA)) +{ +SAL_WARN("sc.filter", "invalid address"); +return; +} + ScSetStringParam aParam; aParam.setTextInput(); rD.EnsureTable(aA.Tab()); @@ -201,6 +213,12 @@ void ImportLotus::Labelcell() Read( cAlign ); Read( aLabel ); +if (!rD.ValidAddress(aA)) +{ +SAL_WARN("sc.filter", "invalid address"); +return; +} + ScSetStringParam aParam; aParam.setTextInput(); rD.EnsureTable(aA.Tab()); @@ -215,6 +233,12 @@ void ImportLotus::Numbercell() Read( aAddr ); Read( fVal ); +if (!rD.ValidAddress(aAddr)) +{ +SAL_WARN("sc.filter", "invalid address"); +return; +} + rD.EnsureTable(aAddr.Tab()); rD.SetValue(aAddr, fVal); } @@ -227,6 +251,12 @@ void ImportLotus::Smallnumcell() Read( aAddr ); Read( nVal ); +if (!rD.ValidAddress(aAddr)) +{ +SAL_WARN("sc.filter", "invalid address"); +return; +} + rD.EnsureTable(aAddr.Tab()); rD.SetValue(aAddr, SnumToDouble(nVal)); } @@ -251,6 +281,12 @@ void ImportLotus::Formulacell( sal_uInt16 n ) if (!aConv.good()) return; +if (!rD.ValidAddress(aAddr)) +{ +SAL_WARN("sc.filter", "invalid address"); +return; +} + ScFormulaCell* pCell = pErg ? new ScFormulaCell(rD, aAddr, std::move(pErg)) : new ScFormulaCell(rD, aAddr); pCell->AddRecalcMode( ScRecalcMode::ONLOAD_ONCE ); rD.EnsureTable(aAddr.Tab()); commit c72a00868cd13be911798d2c508c10b6367606ab Author: Caolán McNamara AuthorDate: Tue Mar 23 13:13:37 2021 + Commit: Caolán McNamara CommitDate: Wed Mar 24 20:39:29 2021 +0100 Related: tdf#135363 don't keep a reference to the vcl::Window in fact, why keep a VclPtr reference to that window at all Change-Id: I3f0511b41434cba744a63d4a9e185c97a6cef5e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112992 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx index a819ca19b3e4..2e198ba8827e 100644 --- a/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx +++ b/sd/source/ui/accessibility/AccessibleDocumentViewBase.cxx @@ -66,7 +66,6 @@ AccessibleDocumentViewBase::AccessibleDocumentViewBase ( pViewShell->GetDoc()->GetDocumentType() == DocumentType::Impress ? AccessibleRole::DOCUMENT_PRESENTATION : AccessibleRole::DOCUMENT), - mpWindow (pSdWindow), mxController (rxController), maViewForwarder ( static_cast(pViewShell->GetView()), @@ -88,17 +87,10 @@ AccessibleDocumentViewBase::AccessibleDocumentViewBase ( mpViewShell = pViewShell; } -void AccessibleDocumentViewBase::ReleaseWindow() -{ -SolarMutexGuard g; -mpWindow.reset(); -} - AccessibleDocumentViewBase::~AccessibleDocumentViewBase() { // At this place we should be disposed. You may want to add a // corresponding assertion into the destructor of a derived class. -ReleaseWindow(); // this should already be done by impl_dispose } void AccessibleDocumentViewBase::Init() @@ -488,8 +480,6 @@ void AccessibleDoc
[Libreoffice-commits] core.git: 3 commits - sc/source sd/source sfx2/source
sc/source/ui/dataprovider/dataprovider.cxx |5 - sc/source/ui/dataprovider/htmldataprovider.hxx |2 +- sc/source/ui/inc/dataprovider.hxx |2 -- sd/source/ui/dlg/BulletAndPositionDlg.cxx |8 sd/source/ui/inc/BulletAndPositionDlg.hxx |1 - sfx2/source/doc/sfxbasemodel.cxx |5 - sfx2/source/inc/docundomanager.hxx |6 +- 7 files changed, 2 insertions(+), 27 deletions(-) New commits: commit ab5805c34af1ad45a2ee8983b0e451704ab33c09 Author: Noel Grandin AuthorDate: Mon Jun 10 08:37:11 2019 +0200 Commit: Noel Grandin CommitDate: Tue Jun 11 07:52:27 2019 +0200 loplugin:virtualdown in SfxModelSubComponent Change-Id: Ied6f58301a648404c988184b67e1acb3fa1133de Reviewed-on: https://gerrit.libreoffice.org/73766 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 4caf74eb15c6..4d1833e31d11 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -4447,9 +4447,4 @@ SfxModelSubComponent::~SfxModelSubComponent() { } -void SfxModelSubComponent::disposing() -{ -// nothing to do here -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/docundomanager.hxx b/sfx2/source/inc/docundomanager.hxx index ab713c1d50e2..ce38680e264f 100644 --- a/sfx2/source/inc/docundomanager.hxx +++ b/sfx2/source/inc/docundomanager.hxx @@ -41,9 +41,6 @@ public: m_rModel.MethodEntryCheck( true ); } -// called when the SfxBaseModel which the component is superordinate of is being disposed -virtual void disposing(); - protected: SfxModelSubComponent( SfxBaseModel& i_model ) :m_rModel( i_model ) @@ -109,8 +106,7 @@ namespace sfx2 DocumentUndoManager(const DocumentUndoManager&) = delete; DocumentUndoManager& operator=(const DocumentUndoManager&) = delete; -// SfxModelSubComponent overridables -virtual voiddisposing() override; +voiddisposing(); // non-UNO API for our owner /** determines whether we have an open Undo context. No mutex locking within this method, no disposal check - this commit 27d5fd27cbf4ed91bafb4f051a418494506ea6f6 Author: Noel Grandin AuthorDate: Mon Jun 10 08:36:54 2019 +0200 Commit: Noel Grandin CommitDate: Tue Jun 11 07:52:23 2019 +0200 loplugin:virtualdown in SvxBulletAndPositionDlg Change-Id: I98da96a09a61fe8a197065773d649dc55d6095b7 Reviewed-on: https://gerrit.libreoffice.org/73765 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sd/source/ui/dlg/BulletAndPositionDlg.cxx b/sd/source/ui/dlg/BulletAndPositionDlg.cxx index 6575850c6a6b..bbf5c6687bd8 100644 --- a/sd/source/ui/dlg/BulletAndPositionDlg.cxx +++ b/sd/source/ui/dlg/BulletAndPositionDlg.cxx @@ -287,14 +287,6 @@ SvxBulletAndPositionDlg::SvxBulletAndPositionDlg(weld::Window* pWindow, const Sf SvxBulletAndPositionDlg::~SvxBulletAndPositionDlg() {} -void SvxBulletAndPositionDlg::dispose() -{ -m_xPreviewWIN.reset(); -m_xBulColLB.reset(); -pActNum.reset(); -pSaveNum.reset(); -} - void SvxBulletAndPositionDlg::SetMetric(FieldUnit eMetric) { if (eMetric == FieldUnit::MM) diff --git a/sd/source/ui/inc/BulletAndPositionDlg.hxx b/sd/source/ui/inc/BulletAndPositionDlg.hxx index fb95af11c6f0..fe16cdd539ab 100644 --- a/sd/source/ui/inc/BulletAndPositionDlg.hxx +++ b/sd/source/ui/inc/BulletAndPositionDlg.hxx @@ -145,7 +145,6 @@ class SvxBulletAndPositionDlg : public weld::GenericDialogController public: SvxBulletAndPositionDlg(weld::Window* pWindow, const SfxItemSet& rSet, ::sd::View* pView); virtual ~SvxBulletAndPositionDlg() override; -virtual void dispose(); SfxItemSet* GetOutputItemSet(SfxItemSet* rSet); bool IsApplyToMaster(); commit fa1e5e556349bc4ae92275ce88d877db91f6a44b Author: Noel Grandin AuthorDate: Mon Jun 10 08:36:32 2019 +0200 Commit: Noel Grandin CommitDate: Tue Jun 11 07:52:15 2019 +0200 loplugin:virtualdown in DataProvider Change-Id: Id61d2ddc25767c642e13212be8b00c5836ce4996 Reviewed-on: https://gerrit.libreoffice.org/73764 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/sc/source/ui/dataprovider/dataprovider.cxx b/sc/source/ui/dataprovider/dataprovider.cxx index e0a5571971d2..f87e006618ec 100644 --- a/sc/source/ui/dataprovider/dataprovider.cxx +++ b/sc/source/ui/dataprovider/dataprovider.cxx @@ -212,11 +212,6 @@ void DataProvider::setDeterministic() mbDeterministic = true; } -std::map DataProvider::getDataSourcesForURL(const OUString& /*rURL*/) -{ -return std::map(); -} - DataProvider::~DataProvider() { } diff --git a/sc/source/ui/dataprovider/htmldataprovider.hxx b/sc/source/ui/dataprovider/htmldataprovider.hxx index 249249dcef88..0eb27f4b8891 100644 --- a/sc/source/ui/dataprovider/htmldataprovider.hx
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/filter/inc/workbooksettings.hxx |8 ++-- sc/source/filter/inc/worksheetsettings.hxx |6 +- sc/source/filter/oox/workbooksettings.cxx | 25 +++-- sc/source/filter/oox/worksheetsettings.cxx |5 + 4 files changed, 39 insertions(+), 5 deletions(-) New commits: commit 2d5a9e9f26daf95f33afb0d28ffd088cdd41ae8c Author: Eike Rathke Date: Fri Feb 23 11:15:54 2018 +0100 tdf#115933 set document read-only on presence of hashValue attribute Though there's currently no way (password dialog) to edit the document other than saving it to a different file, this seems to be what is expected. Change-Id: Iafa8ac9f6e41c3011ed0ad4b19cc57382c9f2a75 diff --git a/sc/source/filter/oox/workbooksettings.cxx b/sc/source/filter/oox/workbooksettings.cxx index 9dd4caff95f1..34be4e5608fa 100644 --- a/sc/source/filter/oox/workbooksettings.cxx +++ b/sc/source/filter/oox/workbooksettings.cxx @@ -192,15 +192,31 @@ void WorkbookSettings::finalizeImport() aPropSet.setProperty( PROP_Wildcards, true ); // always in Excel // write protection -if( maFileSharing.mbRecommendReadOnly || (maFileSharing.mnPasswordHash != 0) ) try +if (maFileSharing.mbRecommendReadOnly || (maFileSharing.mnPasswordHash != 0) || +!maFileSharing.maHashValue.isEmpty()) try { getBaseFilter().getMediaDescriptor()[ "ReadOnly" ] <<= true; Reference< XPropertySet > xDocumentSettings( getBaseFilter().getModelFactory()->createInstance( "com.sun.star.document.Settings" ), UNO_QUERY_THROW ); PropertySet aSettingsProp( xDocumentSettings ); -if( maFileSharing.mbRecommendReadOnly ) + +/* TODO: not setting read-only if only mnPasswordHash ('password' + * attribute) is present looks a bit silly, any reason for that? + * 'readOnlyRecommended' is defined as "indicates on open, whether the + * application alerts the user that the file be marked as read-only", + * which sounds silly in itself and seems not to be present if the + * 'password' attribute isn't present, but.. */ +if (maFileSharing.mbRecommendReadOnly || !maFileSharing.maHashValue.isEmpty()) aSettingsProp.setProperty( PROP_LoadReadonly, true ); + +/* TODO: setting ModifyPasswordHash was commented out with commit + * 1a842832cd174d5ccfd832fdb94c93ae42e8eacc of which the filter + * fragment parts meanwhile contain PASSWORDTOMODIFY again, also for + * calc_OOXML.xcu, but setting the property doesn't raise a dialog. If + * it worked, a Sequence should be used for + * algorithmName,hashValue,... see also + * SfxObjectShell::SetModifyPasswordInfo() */ //if( maFileSharing.mnPasswordHash != 0 ) //aSettingsProp.setProperty( PROP_ModifyPasswordHash, static_cast< sal_Int32 >( maFileSharing.mnPasswordHash ) ); } commit 0fe1b2fb823470e2f5eae574f9c9f877eecc932d Author: Eike Rathke Date: Fri Feb 23 10:17:01 2018 +0100 Read algorithmName, hashValue, saltValue, spinCount, tdf#115933 prep Change-Id: I799d4652099059fcd09088c02537ed5dec087259 diff --git a/sc/source/filter/inc/workbooksettings.hxx b/sc/source/filter/inc/workbooksettings.hxx index 02c8fa204a7f..dda6cc366f15 100644 --- a/sc/source/filter/inc/workbooksettings.hxx +++ b/sc/source/filter/inc/workbooksettings.hxx @@ -30,8 +30,12 @@ namespace xls { /** Settings for workbook write protection. */ struct FileSharingModel { -OUString maUserName; /// User who added the write protection password. -sal_uInt16 mnPasswordHash; /// Hash value of the write protection password. +OUStringmaUserName; /// User who added the write protection password. +OUStringmaAlgorithmName;/// Algorithm name, "SHA-512", "SHA-1", ... +OUStringmaHashValue;/// Hash value computed by the algorithm, base-64 encoded +OUStringmaSaltValue;/// Salt value to be prepended to the password, base-64 encoded +sal_uInt32 mnSpinCount;/// Spin count, iterations to run algorithm +sal_uInt16 mnPasswordHash; /// Hash value of the write protection password. (unrelated to the above) boolmbRecommendReadOnly;/// True = recommend read-only mode on opening. explicitFileSharingModel(); diff --git a/sc/source/filter/oox/workbooksettings.cxx b/sc/source/filter/oox/workbooksettings.cxx index 44c017bbafbc..9dd4caff95f1 100644 --- a/sc/source/filter/oox/workbooksettings.cxx +++ b/sc/source/filter/oox/workbooksettings.cxx @@ -63,6 +63,7 @@ const sal_Int16 API_SHOWMODE_PLACEHOLDER= 2; /// Show placeholder } // namespace FileSharingModel::FileSharingModel() : +mnSpinCount( 0 ), mnPasswordHash( 0 ), mbRecommendR
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/ui/view/formatsh.cxx | 49 +++-- 1 file changed, 18 insertions(+), 31 deletions(-) New commits: commit 0bb0299b29960c3a27427eba5d5fc34e5e913a8b Author: Eike Rathke Date: Sat Dec 9 00:09:00 2017 +0100 Name it what it is, the format category for the sidebar Change-Id: Ice6bbfc5f9412ba2d7bce7fb63782a12b48304a1 diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index dda99fc78495..0716ff89a815 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -2604,7 +2604,7 @@ void ScFormatShell::GetNumFormatState( SfxItemSet& rSet ) case SID_NUMBER_TYPE_FORMAT: { -sal_Int16 aFormatCode = -1; +sal_Int16 nFormatCategory = -1; if ( eItemState >= SfxItemState::DEFAULT ) //Modify for more robust { switch(nType) @@ -2612,43 +2612,43 @@ void ScFormatShell::GetNumFormatState( SfxItemSet& rSet ) case css::util::NumberFormat::NUMBER: // Determine if General format. if ((nNumberFormat % SV_COUNTRY_LANGUAGE_OFFSET) == 0) -aFormatCode = 0; +nFormatCategory = 0; else -aFormatCode = 1; +nFormatCategory = 1; break; case css::util::NumberFormat::PERCENT: -aFormatCode = 2; +nFormatCategory = 2; break; case css::util::NumberFormat::CURRENCY: -aFormatCode = 3; +nFormatCategory = 3; break; case css::util::NumberFormat::DATE: //Add case css::util::NumberFormat::DATETIME: -aFormatCode = 4; +nFormatCategory = 4; break; case css::util::NumberFormat::TIME: -aFormatCode = 5; +nFormatCategory = 5; break; case css::util::NumberFormat::SCIENTIFIC: -aFormatCode = 6; +nFormatCategory = 6; break; case css::util::NumberFormat::FRACTION: -aFormatCode = 7; +nFormatCategory = 7; break; case css::util::NumberFormat::LOGICAL: -aFormatCode = 8; +nFormatCategory = 8; break; case css::util::NumberFormat::TEXT: -aFormatCode = 9; +nFormatCategory = 9; break; default: -aFormatCode = -1; //for more robust +nFormatCategory = -1; //for more robust } -if( aFormatCode == -1 ) +if( nFormatCategory == -1 ) rSet.InvalidateItem( nWhich ); else -rSet.Put( SfxInt16Item( nWhich, aFormatCode ) ); +rSet.Put( SfxInt16Item( nWhich, nFormatCategory ) ); } else { commit 3679eccc0b4f2aa33a8b3e812f1230e0664c2010 Author: Eike Rathke Date: Sat Dec 9 00:04:48 2017 +0100 Rip out already masked out css::util::NumberFormat::DEFINED in cases Change-Id: Ic769a755fba5cf89596509098ec6dff4fc011598 diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index eee8fd2f5c94..dda99fc78495 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -2519,6 +2519,8 @@ void ScFormatShell::GetNumFormatState( SfxItemSet& rSet ) // don't have to iterate over all // selected cells' attribute ranges to // determine selected types. + // Does *NOT* include the + // css::util::NumberFormat::DEFINED bit. const short nType = (eItemState >= SfxItemState::DEFAULT ? pFormatter->GetType( nNumberFormat) : GetCurrentNumberFormatType()); NfIndexTableOffset nOffset = pFormatter->GetIndexTableOffset(nNumberFormat); @@ -2608,7 +2610,6 @@
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/core/inc/interpre.hxx |2 sc/source/core/tool/interpr1.cxx | 87 +-- 2 files changed, 66 insertions(+), 23 deletions(-) New commits: commit 6a6aa56b45f19c250e9c4111b478203ddb75478b Author: Eike Rathke Date: Tue May 23 10:39:25 2017 +0200 Handle SUMIF and AVERAGEIF with array of references, tdf#58874 Change-Id: I37bad7b85ee61631399f1b49d0bc9be3b8d00423 diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 51ddade6e1e8..e5ba5ede6b0c 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -5115,6 +5115,10 @@ void ScInterpreter::IterateParametersIf( ScIterFuncIf eFunc ) double fCount = 0.0; bool bNull = true; short nParam = 1; +const SCSIZE nMatRows = GetRefListArrayMaxSize( nParam); +// There's either one RefList and nothing else, or none. +ScMatrixRef xResMat = (nMatRows ? GetNewMat( 1, nMatRows) : nullptr); +SCSIZE nRefListArrayPos = 0; size_t nRefInList = 0; while (nParam-- > 0) { @@ -5130,10 +5134,12 @@ void ScInterpreter::IterateParametersIf( ScIterFuncIf eFunc ) case svRefList : if (bSumExtraRange) { +/* TODO: this could resolve if all refs are of the same size */ SetError( FormulaError::IllegalParameter); } else { +nRefListArrayPos = nRefInList; ScRange aRange; PopDoubleRef( aRange, nParam, nRefInList); aRange.GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2); @@ -5370,14 +5376,28 @@ void ScInterpreter::IterateParametersIf( ScIterFuncIf eFunc ) PushError( FormulaError::IllegalParameter); return; } -} -switch( eFunc ) -{ -case ifSUMIF: fRes = ::rtl::math::approxAdd( fSum, fMem ); break; -case ifAVERAGEIF: fRes = div( ::rtl::math::approxAdd( fSum, fMem ), fCount); break; +switch( eFunc ) +{ +case ifSUMIF: fRes = ::rtl::math::approxAdd( fSum, fMem ); break; +case ifAVERAGEIF: fRes = div( ::rtl::math::approxAdd( fSum, fMem ), fCount); break; +} +if (xResMat) +{ +if (nGlobalError == FormulaError::NONE) +xResMat->PutDouble( fRes, 0, nRefListArrayPos); +else +{ +xResMat->PutError( nGlobalError, 0, nRefListArrayPos); +nGlobalError = FormulaError::NONE; +} +fRes = fSum = fMem = fCount = 0.0; +} } -PushDouble( fRes); +if (xResMat) +PushMatrix( xResMat); +else +PushDouble( fRes); } void ScInterpreter::ScSumIf() commit 44a1f0c17d3c5b212ff60b2f24f50693b3da9eab Author: Eike Rathke Date: Tue May 23 01:28:13 2017 +0200 Move pushing result token into IterateParametersIf(), tdf#58874 Change-Id: I98c52784992f5734480736ce4f8290490ca752f1 diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx index 9e5de664d0dc..8e6d89206c3a 100644 --- a/sc/source/core/inc/interpre.hxx +++ b/sc/source/core/inc/interpre.hxx @@ -596,7 +596,7 @@ void ScColumn(); void ScRow(); void ScSheet(); void ScMatch(); -double IterateParametersIf( ScIterFuncIf ); +void IterateParametersIf( ScIterFuncIf ); void ScCountIf(); void ScSumIf(); void ScAverageIf(); diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 12aa11b97bbf..51ddade6e1e8 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -4967,11 +4967,14 @@ void ScInterpreter::ScCountEmptyCells() } } -double ScInterpreter::IterateParametersIf( ScIterFuncIf eFunc ) +void ScInterpreter::IterateParametersIf( ScIterFuncIf eFunc ) { sal_uInt8 nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 2, 3 ) ) -return 0; +{ +PushError( nGlobalError); +return; +} SCCOL nCol3 = 0; SCROW nRow3 = 0; @@ -4994,8 +4997,8 @@ double ScInterpreter::IterateParametersIf( ScIterFuncIf eFunc ) PopDoubleRef( nCol3, nRow3, nTab3, nColJunk, nRowJunk, nTabJunk ); if ( nTabJunk != nTab3 ) { -SetError( FormulaError::IllegalParameter); -return 0; +PushError( FormulaError::IllegalParameter); +return; } } break; @@ -5012,7 +5015,10 @@ double ScInterpreter::IterateParametersIf( ScIterFuncIf eFunc ) ScExternalRefCache::TokenRef pToken; PopExternalSingleRef(pToken); if (nGlobalError != FormulaError::NONE) -return 0; +{ +
[Libreoffice-commits] core.git: 3 commits - sc/source sw/qa
sc/source/core/inc/interpre.hxx |1 sc/source/core/tool/interpr5.cxx | 37 +- sw/qa/extras/ooxmlexport/ooxmlexport9.cxx |2 - 3 files changed, 33 insertions(+), 7 deletions(-) New commits: commit a9118665637dafddd41ca549d0f73948cf1d332c Author: Justin Luth Date: Mon May 22 14:24:49 2017 +0300 tdf#99227: remove unneeded specificity in unit test The unit test should only be ensuring that the drawing is in the footnote, not that it is located in the 5th character portion. Change-Id: I58040dc3498b2e78000891a26b7188dfac6c72f7 Reviewed-on: https://gerrit.libreoffice.org/37906 Tested-by: Jenkins Reviewed-by: Mike Kaganski Reviewed-by: Justin Luth diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index d38a6ff46364..d2f4aad276aa 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -461,7 +461,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf99227, "tdf99227.docx") if (!pXmlDoc) return; -assertXPath(pXmlDoc, "//w:footnote[3]/w:p/w:r[5]/w:drawing", 1); +assertXPath(pXmlDoc, "//w:footnote/w:p/w:r/w:drawing", 1); } DECLARE_OOXMLEXPORT_TEST(testTdf104162, "tdf104162.docx") commit 6b417ec3daaec72c736fcfe0d980ce205e589633 Author: Eike Rathke Date: Mon May 22 21:13:38 2017 +0200 Handle SUMPRODUCT with svRefList arguments, tdf#58874 Change-Id: I03c2ed1f957db5ad8a67aaab45076373a020e9c1 diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index 4e0ee214897c..3d994f4852ea 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -1690,28 +1690,30 @@ public: void ScInterpreter::ScSumProduct() { -sal_uInt8 nParamCount = GetByte(); +short nParamCount = GetByte(); if ( !MustHaveParamCount( nParamCount, 1, 30 ) ) return; ScMatrixRef pMatLast; ScMatrixRef pMat; +size_t nRefInList = 0; -pMatLast = GetMatrix(); +pMatLast = GetMatrix( nParamCount, nRefInList); if (!pMatLast) { PushIllegalParameter(); return; } +--nParamCount; SCSIZE nC, nCLast, nR, nRLast; pMatLast->GetDimensions(nCLast, nRLast); std::vector aResArray; pMatLast->GetDoubleArray(aResArray); -for (sal_uInt16 i = 1; i < nParamCount; ++i) +while (nParamCount--) { -pMat = GetMatrix(); +pMat = GetMatrix( nParamCount, nRefInList); if (!pMat) { PushIllegalParameter(); commit 8b55956d6a07d1d6b62ffdf58277e6752513f4c0 Author: Eike Rathke Date: Mon May 22 20:39:37 2017 +0200 Introduce GetMatrix() from svRefList, tdf#58874 Change-Id: Id3a2500c475835c54fbf02505f852bb33e1403cc diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx index 29cb26c05220..9e5de664d0dc 100644 --- a/sc/source/core/inc/interpre.hxx +++ b/sc/source/core/inc/interpre.hxx @@ -435,6 +435,7 @@ ScMatrixRef CreateMatrixFromDoubleRef( const formula::FormulaToken* pToken, inline ScTokenMatrixMap& GetTokenMatrixMap(); static ScTokenMatrixMap* CreateTokenMatrixMap(); ScMatrixRef GetMatrix(); +ScMatrixRef GetMatrix( short & rParam, size_t & rInRefList ); sc::RangeMatrix GetRangeMatrix(); void ScTableOp(); // repeated operations diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index 2b8e65bb8752..4e0ee214897c 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -323,7 +323,7 @@ ScMatrixRef ScInterpreter::CreateMatrixFromDoubleRef( const FormulaToken* pToken } ScTokenMatrixMap::const_iterator aIter; -if (pTokenMatrixMap && ((aIter = pTokenMatrixMap->find( pToken)) != pTokenMatrixMap->end())) +if (pToken && pTokenMatrixMap && ((aIter = pTokenMatrixMap->find( pToken)) != pTokenMatrixMap->end())) { /* XXX casting const away here is ugly; ScMatrixToken (to which the * result of this function usually is assigned) should not be forced to @@ -340,7 +340,7 @@ ScMatrixRef ScInterpreter::CreateMatrixFromDoubleRef( const FormulaToken* pToken pDok->FillMatrix(*pMat, nTab1, nCol1, nRow1, nCol2, nRow2); -if (pTokenMatrixMap) +if (pToken && pTokenMatrixMap) pTokenMatrixMap->insert( ScTokenMatrixMap::value_type( pToken, new ScMatrixToken( pMat))); return pMat; @@ -463,6 +463,29 @@ ScMatrixRef ScInterpreter::GetMatrix() return pMat; } +ScMatrixRef ScInterpreter::GetMatrix( short & rParam, size_t & rRefInList ) +{ +switch (GetRawStackType()) +{ +case svRefList: +{ +ScRange aRange( ScAddress::INITIALIZE_INVALID ); +PopDoubleRef( aRange, rParam, rRefInList); +if (nGlobalError != FormulaError::NONE) +return nullptr; + +SCCO
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/filter/excel/excdoc.cxx |3 ++- sc/source/filter/excel/xestyle.cxx |2 ++ sc/source/filter/inc/xltable.hxx |2 +- 3 files changed, 5 insertions(+), 2 deletions(-) New commits: commit 4a332d54b80bbc502ccc98bf924a269e00c10070 Author: Tor Lillqvist Date: Mon Mar 6 20:42:46 2017 +0200 The 'fLockObj' field of an 'ObjProtect' MUST be 0x0001 says the spec So generate such a record only when the protection state is on. See https://msdn.microsoft.com/en-us/library/dd922139(v=office.12).aspx Change-Id: I710395527cd53dc47018806e51fcc699e11fb461 diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index 67e2ae4..1788f8f 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -490,7 +490,8 @@ void ExcTable::FillAsTableBinary( SCTAB nCodeNameIdx ) { Add( new XclExpProtection(true) ); Add( new XclExpBoolRecord(0x00DD, pTabProtect->isOptionEnabled(ScTableProtection::SCENARIOS)) ); -Add( new XclExpBoolRecord(0x0063, pTabProtect->isOptionEnabled(ScTableProtection::OBJECTS)) ); +if (pTabProtect->isOptionEnabled(ScTableProtection::OBJECTS)) +Add( new XclExpBoolRecord(0x0063, true )); Add( new XclExpPassHash(pTabProtect->getPasswordHash(PASSHASH_XL)) ); } commit 727ee3f92a8882914ac3f68eaf53ac519ace5f38 Author: Tor Lillqvist Date: Mon Mar 6 20:28:02 2017 +0200 The 'reserved1' bit of a 'Formula' MUST be zero according to current spec See https://msdn.microsoft.com/en-us/library/dd908919(v=office.12).aspx . This means we will never set the EXC_FORMULA_RECALC_ONLOAD flag, hmm? Change-Id: Ic081caa7f98426394cbc7b0b320fa1a5a9a34f6c diff --git a/sc/source/filter/inc/xltable.hxx b/sc/source/filter/inc/xltable.hxx index 4d06dd2..44aea94 100644 --- a/sc/source/filter/inc/xltable.hxx +++ b/sc/source/filter/inc/xltable.hxx @@ -65,7 +65,7 @@ const sal_uInt16 EXC_ID4_FORMULA= 0x0406; const sal_uInt16 EXC_FORMULA_RECALC_ALWAYS = 0x0001; const sal_uInt16 EXC_FORMULA_RECALC_ONLOAD = 0x0002; const sal_uInt16 EXC_FORMULA_SHARED = 0x0008; -const sal_uInt16 EXC_FORMULA_DEFAULTFLAGS = EXC_FORMULA_RECALC_ONLOAD; +const sal_uInt16 EXC_FORMULA_DEFAULTFLAGS = 0x; const sal_uInt8 EXC_FORMULA_RES_STRING = 0x00; /// Result is a string. const sal_uInt8 EXC_FORMULA_RES_BOOL= 0x01; /// Result is Boolean value. commit 970f8dc7847967719652590f71f0f19e46ba7268 Author: Tor Lillqvist Date: Mon Mar 6 20:11:24 2017 +0200 Set the 'unused2' bit of 'Font' to 1 iff 'uls' is greater than 0 per spec See https://msdn.microsoft.com/en-us/library/dd906117(v=office.12).aspx . Change-Id: I4ff278f4cdd388947bbe81b88b6c39ff2b208b1a diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index 529b086..19e7463 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -993,6 +993,8 @@ void XclExpFont::WriteBody( XclExpStream& rStrm ) { sal_uInt16 nAttr = EXC_FONTATTR_NONE; ::set_flag( nAttr, EXC_FONTATTR_ITALIC, maData.mbItalic ); +if( maData.mnUnderline > 0 ) +::set_flag( nAttr, EXC_FONTATTR_UNDERLINE, true ); ::set_flag( nAttr, EXC_FONTATTR_STRIKEOUT, maData.mbStrikeout ); ::set_flag( nAttr, EXC_FONTATTR_OUTLINE, maData.mbOutline ); ::set_flag( nAttr, EXC_FONTATTR_SHADOW, maData.mbShadow ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source vcl/unx
sc/source/ui/unoobj/styleuno.cxx| 11 ++- vcl/unx/generic/fontmanager/fontmanager.cxx |9 ++--- vcl/unx/generic/print/genpspgraphics.cxx|9 ++--- 3 files changed, 14 insertions(+), 15 deletions(-) New commits: commit 040407e267d2ae129e8527f74e3df51a2c7733fc Author: Caolán McNamara Date: Fri Dec 2 08:57:50 2016 + coverity#1396675 Dereference null return value Change-Id: I5280ae6021b1a1d905c8e4af69b1342df4a69aa8 diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx index cd414f7..612aa97 100644 --- a/vcl/unx/generic/fontmanager/fontmanager.cxx +++ b/vcl/unx/generic/fontmanager/fontmanager.cxx @@ -902,9 +902,12 @@ int PrintFontManager::getFontFaceNumber( fontID nFontID ) const { int nRet = 0; PrintFont* pFont = getFont( nFontID ); -nRet = pFont->m_nCollectionEntry; -if (nRet < 0) -nRet = 0; +if (pFont) +{ +nRet = pFont->m_nCollectionEntry; +if (nRet < 0) +nRet = 0; +} return nRet; } commit 6a80d33bab27a14d35b72adc9d9869ba3f388dd9 Author: Caolán McNamara Date: Fri Dec 2 08:56:24 2016 + coverity#1396674 'Constant' variable guards dead code Change-Id: I9163b1663d2e2976fe6ca7983e94ed07af663f82 diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx index f658435..dabd564 100644 --- a/vcl/unx/generic/print/genpspgraphics.cxx +++ b/vcl/unx/generic/print/genpspgraphics.cxx @@ -596,16 +596,14 @@ void GenPspGraphics::DrawTextLayout(const CommonSalLayout& rLayout) DeviceCoordinate aWidthAry[ nMaxGlyphs ]; sal_Int32 aIdxAry [ nMaxGlyphs ]; sal_Unicode aUnicodes[ nMaxGlyphs ]; -int aCharPosAry [ nMaxGlyphs ]; Point aPos; long nUnitsPerPixel = rLayout.GetUnitsPerPixel(); -const sal_Unicode* pText = nullptr; int nMinCharPos = 0; int nMaxCharPos = 0; for( int nStart = 0;; ) { -int nGlyphCount = rLayout.GetNextGlyphs( nMaxGlyphs, aGlyphAry, aPos, nStart, aWidthAry, pText ? aCharPosAry : nullptr ); +int nGlyphCount = rLayout.GetNextGlyphs( nMaxGlyphs, aGlyphAry, aPos, nStart, aWidthAry, nullptr ); if( !nGlyphCount ) break; @@ -615,10 +613,7 @@ void GenPspGraphics::DrawTextLayout(const CommonSalLayout& rLayout) nXOffset += aWidthAry[ i ]; aIdxAry[ i ] = nXOffset / nUnitsPerPixel; sal_GlyphId aGlyphId = aGlyphAry[i] & (GF_IDXMASK | GF_ROTMASK); -if( pText ) -aUnicodes[i] = (aCharPosAry[i] >= nMinCharPos && aCharPosAry[i] <= nMaxCharPos) ? pText[ aCharPosAry[i] ] : 0; -else -aUnicodes[i] = 0; +aUnicodes[i] = 0; aGlyphAry[i] = aGlyphId; } commit 211925e144849ad14469a1a6c6451f61fcf369cf Author: Caolán McNamara Date: Fri Dec 2 08:53:34 2016 + coverity#1396676 Uninitialized pointer field Change-Id: I7d7557485fe603f49ae176378ef41539ebe4970c diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index d123734..1a6e8e9 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -943,11 +943,12 @@ void SAL_CALL ScStyleFamilyObj::removeVetoableChangeListener( const OUString&, c // Default-ctor wird fuer die Reflection gebraucht -ScStyleObj::ScStyleObj(ScDocShell* pDocSh, SfxStyleFamily eFam, const OUString& rName) : -pPropSet( (eFam == SfxStyleFamily::Para) ? lcl_GetCellStyleSet() : lcl_GetPageStyleSet() ), -pDocShell( pDocSh ), -eFamily( eFam ), -aStyleName( rName ) +ScStyleObj::ScStyleObj(ScDocShell* pDocSh, SfxStyleFamily eFam, const OUString& rName) +: pPropSet( (eFam == SfxStyleFamily::Para) ? lcl_GetCellStyleSet() : lcl_GetPageStyleSet() ) +, pDocShell(pDocSh) +, eFamily(eFam) +, aStyleName(rName) +, pStyle_cached(nullptr) { // pDocShell ist Null, wenn per ServiceProvider erzeugt ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/ui/collab/sendfunc.cxx |2 +- sc/source/ui/inc/docsh.hxx |3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) New commits: commit 9a02de1e828b963f8130faed506e2dd01f5d190f Author: David Tardon Date: Mon Oct 24 17:56:06 2016 +0200 fix build Change-Id: I0ebad3c6ac5714514a5135d4006586d88c50e555 diff --git a/sc/source/ui/collab/sendfunc.cxx b/sc/source/ui/collab/sendfunc.cxx index ddcd9ef..6831cb8 100644 --- a/sc/source/ui/collab/sendfunc.cxx +++ b/sc/source/ui/collab/sendfunc.cxx @@ -120,7 +120,7 @@ public: if (n > 0 && (size_t)n < getArgCount() ) { OUString aUStr( maArgs[ n ] ); -ScGlobal::EraseQuotes( aUStr ); +ScGlobal::EraseQuotes( aUStr, '\'' ); return aUStr; } else return OUString(); commit 2dc528d85bf534af7921218ef822bb64ee0896d9 Author: David Tardon Date: Mon Oct 24 17:56:58 2016 +0200 make this cond. to avoid another removal Change-Id: I33793a1c82d7a3a8679964470057f2c3011fb145 diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index c41aaa4..2fde362 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -226,7 +226,9 @@ public: ScDocument& GetDocument() { return aDocument; } ScDocFunc& GetDocFunc(){ return *pDocFunc; } +#if ENABLE_TELEPATHY voidSetDocFunc( ScDocFunc *pDF ) { pDocFunc = pDF; } +#endif SfxPrinter* GetPrinter( bool bCreateIfNotExist = true ); sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL ); commit 0c3642e8e8c018bcc2ee57d4ccda0449df84364b Author: David Tardon Date: Wed Dec 23 12:02:53 2015 +0100 restore removed function for umpteenth time It is used by the tubes collaboration stuff. Change-Id: I9e31f0588f6c400716fba29806c1dab462c32a43 diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index d5b2c92..c41aaa4 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -226,6 +226,7 @@ public: ScDocument& GetDocument() { return aDocument; } ScDocFunc& GetDocFunc(){ return *pDocFunc; } +voidSetDocFunc( ScDocFunc *pDF ) { pDocFunc = pDF; } SfxPrinter* GetPrinter( bool bCreateIfNotExist = true ); sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/core/data/dpcache.cxx | 25 + sc/source/core/data/dptabdat.cxx |1 + sc/source/ui/unoobj/dapiuno.cxx |1 - 3 files changed, 6 insertions(+), 21 deletions(-) New commits: commit 7125de1cdb4d29cc3763147571808033ee20 Author: Tamás Zolnai Date: Fri Oct 14 21:05:45 2016 + PivotTable: No reason to call GetSource here GetSource generates internal members related to source data, but when this constructor is called we don't have valid source data yet. Change-Id: Ia813740fc425d70e7b294fca287f7afe784201a5 diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index 834c3d6..102c020 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -1385,7 +1385,6 @@ ScDataPilotDescriptor::ScDataPilotDescriptor(ScDocShell* pDocSh) : mpDPObject->SetSaveData(aSaveData); ScSheetSourceDesc aSheetDesc(pDocSh ? &pDocSh->GetDocument() : nullptr); mpDPObject->SetSheetDesc(aSheetDesc); -mpDPObject->GetSource(); } ScDataPilotDescriptor::~ScDataPilotDescriptor() commit 6520c8f2f3271c2f36429084a6b0f737f2ad4b88 Author: Tamás Zolnai Date: Fri Oct 14 21:02:32 2016 + PivotTable cache: Remove useless mnValueSortIndex We can use mnOrderIndex to get the same result. Change-Id: I71f68ebefe08c3664954ecdf6345cca4ed5ccafc diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx index 25a500c..49b1d61 100644 --- a/sc/source/core/data/dpcache.cxx +++ b/sc/source/core/data/dpcache.cxx @@ -153,9 +153,8 @@ struct Bucket ScDPItemData maValue; SCROW mnOrderIndex; SCROW mnDataIndex; -SCROW mnValueSortIndex; Bucket(const ScDPItemData& rValue, SCROW nData) : -maValue(rValue), mnOrderIndex(0), mnDataIndex(nData), mnValueSortIndex(0) {} +maValue(rValue), mnOrderIndex(0), mnDataIndex(nData) {} }; #if DEBUG_PIVOT_TABLE @@ -167,7 +166,7 @@ struct PrintBucket : std::unary_function { void operator() (const Bucket& v) const { -cout << "value: " << v.maValue.GetValue() << " order index: " << v.mnOrderIndex << " data index: " << v.mnDataIndex << " value sort index: " << v.mnValueSortIndex << endl; +cout << "value: " << v.maValue.GetValue() << " order index: " << v.mnOrderIndex << " data index: " << v.mnDataIndex << endl; } }; @@ -181,11 +180,11 @@ struct LessByValue : std::binary_function } }; -struct LessByValueSortIndex : std::binary_function +struct LessByOrderIndex : std::binary_function { bool operator() (const Bucket& left, const Bucket& right) const { -return left.mnValueSortIndex < right.mnValueSortIndex; +return left.mnOrderIndex < right.mnOrderIndex; } }; @@ -227,17 +226,6 @@ public: } }; -class TagValueSortOrder : public std::unary_function -{ -SCROW mnCurIndex; -public: -TagValueSortOrder() : mnCurIndex(0) {} -void operator() (Bucket& v) -{ -v.mnValueSortIndex = mnCurIndex++; -} -}; - void processBuckets(std::vector& aBuckets, ScDPCache::Field& rField) { if (aBuckets.empty()) @@ -246,9 +234,6 @@ void processBuckets(std::vector& aBuckets, ScDPCache::Field& rField) // Sort by the value. std::sort(aBuckets.begin(), aBuckets.end(), LessByValue()); -// Remember this sort order. -std::for_each(aBuckets.begin(), aBuckets.end(), TagValueSortOrder()); - { // Set order index such that unique values have identical index value. SCROW nCurIndex = 0; @@ -273,7 +258,7 @@ void processBuckets(std::vector& aBuckets, ScDPCache::Field& rField) std::for_each(aBuckets.begin(), aBuckets.end(), PushBackOrderIndex(rField.maData)); // Sort by the value again. -std::sort(aBuckets.begin(), aBuckets.end(), LessByValueSortIndex()); +std::sort(aBuckets.begin(), aBuckets.end(), LessByOrderIndex()); // Unique by value. std::vector::iterator itUniqueEnd = commit 57185b9c32b003212c8129480c388f584adc3ca3 Author: Tamás Zolnai Date: Fri Oct 14 21:00:45 2016 + Small pivot table performance improvement Change-Id: Ic57082aaadc4e2ed516c9875a421278e1ce4564a diff --git a/sc/source/core/data/dptabdat.cxx b/sc/source/core/data/dptabdat.cxx index 8061f25..d25a08f 100644 --- a/sc/source/core/data/dptabdat.cxx +++ b/sc/source/core/data/dptabdat.cxx @@ -225,6 +225,7 @@ void ScDPTableData::GetItemData(const ScDPFilteredCache& rCacheTable, sal_Int32 const vector& rDims, vector& rItemData) { sal_Int32 nDimSize = rDims.size(); +rItemData.reserve(rItemData.size() + nDimSize); for (sal_Int32 i = 0; i < nDimSize; ++i) { long nDim = rDims[i]; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/core/inc/interpre.hxx | 21 - sc/source/core/tool/interpr1.cxx | 749 +++ 2 files changed, 395 insertions(+), 375 deletions(-) New commits: commit 92874f2f134d28b77163a21ff5d04c5234ca65b2 Author: Kohei Yoshida Date: Fri Oct 14 18:38:57 2016 -0400 This is no longer used. Change-Id: I625a418c582b41ca324874e27900670151a9d2b2 diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx index f9e91e1..fe860eb 100644 --- a/sc/source/core/inc/interpre.hxx +++ b/sc/source/core/inc/interpre.hxx @@ -106,15 +106,6 @@ enum ScIterFuncIf ifAVERAGEIF // Conditional average }; -enum ScIterFuncIfs -{ -ifSUMIFS, // Multi-Conditional sum -ifAVERAGEIFS, // Multi-Conditional average -ifCOUNTIFS, // Multi-Conditional count -ifMINIFS, // Multi-Conditional minimum -ifMAXIFS // Multi-Conditional maximum -}; - enum ScETSType { etsAdd, commit 3bd025ec76ba305ce5892acefc57385599dd12e1 Author: Kohei Yoshida Date: Wed Oct 12 20:29:34 2016 -0400 Remove the branching at the end of IterateParametersIfs(). For (hopefully) better performance. Change-Id: I59ed454aa9ace2f945facceee14f4e25610feebf diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx index 47d5afd..f9e91e1 100644 --- a/sc/source/core/inc/interpre.hxx +++ b/sc/source/core/inc/interpre.hxx @@ -39,6 +39,7 @@ #include #include #include +#include class ScDocument; class SbxVariable; @@ -62,6 +63,15 @@ struct RangeMatrix; struct Compare; struct CompareOptions; +struct ParamIfsResult +{ +double mfSum = 0.0; +double mfMem = 0.0; +double mfCount = 0.0; +double mfMin = std::numeric_limits::max(); +double mfMax = std::numeric_limits::min(); +}; + } namespace svl { @@ -590,7 +600,7 @@ double IterateParametersIf( ScIterFuncIf ); void ScCountIf(); void ScSumIf(); void ScAverageIf(); -double IterateParametersIfs( ScIterFuncIfs ); +void IterateParametersIfs( sc::ParamIfsResult& rRes ); void ScSumIfs(); void ScAverageIfs(); void ScCountIfs(); diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 838484e..465b04b 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -5312,7 +5312,7 @@ void ScInterpreter::ScCountIf() } } -double ScInterpreter::IterateParametersIfs( ScIterFuncIfs eFunc ) +void ScInterpreter::IterateParametersIfs( sc::ParamIfsResult& rRes ) { sal_uInt8 nParamCount = GetByte(); sal_uInt8 nQueryCount = nParamCount / 2; @@ -5321,12 +5321,6 @@ double ScInterpreter::IterateParametersIfs( ScIterFuncIfs eFunc ) size_t nRowSize = 0; size_t nColSize = 0; double fVal = 0.0; -double fSum = 0.0; -double fMem = 0.0; -double fRes = 0.0; -double fCount = 0.0; -double fMin = std::numeric_limits::max(); -double fMax = std::numeric_limits::min(); short nParam = 1; size_t nRefInList = 0; SCCOL nDimensionCols = 0; @@ -5345,7 +5339,7 @@ double ScInterpreter::IterateParametersIfs( ScIterFuncIfs eFunc ) { ScAddress aAdr; if ( !PopDoubleRefOrSingleRef( aAdr ) ) -return 0; +return; ScRefCellValue aCell(*pDok, aAdr); switch (aCell.meType) @@ -5407,7 +5401,7 @@ double ScInterpreter::IterateParametersIfs( ScIterFuncIfs eFunc ) } if (nGlobalError != FormulaError::NONE) -return 0; // and bail out, no need to evaluate other arguments +return; // and bail out, no need to evaluate other arguments // take range nParam = 1; @@ -5445,7 +5439,7 @@ double ScInterpreter::IterateParametersIfs( ScIterFuncIfs eFunc ) if (!pQueryMatrix) { SetError( FormulaError::IllegalParameter); -return 0; +return; } nCol1 = 0; nRow1 = 0; @@ -5459,12 +5453,12 @@ double ScInterpreter::IterateParametersIfs( ScIterFuncIfs eFunc ) break; default: SetError( FormulaError::IllegalParameter); -return 0; +return; } if ( nTab1 != nTab2 ) { SetError( FormulaError::IllegalArgument); -return 0; +return; } // All reference ranges must be of same dimension and size. @@ -5475,12 +5469,12 @@ double ScInterpreter::IterateParametersIfs( ScIterFuncIfs eFunc ) if ((nDimensionCols != (nCol2 - nCol1 + 1)) || (nDimensionRows != (nRow2 - nRow1 + 1))) { SetError ( FormulaError::IllegalArgument); -return 0; +return; } // recalculate matrix valu
[Libreoffice-commits] core.git: 3 commits - sc/source svl/source
sc/source/core/data/poolhelp.cxx |2 +- svl/source/numbers/numfmuno.cxx |6 +- 2 files changed, 2 insertions(+), 6 deletions(-) New commits: commit 4ff1318860ae664b066409354d37e040713b493a Author: Eike Rathke Date: Tue Aug 9 12:47:12 2016 +0200 create SvNumberFormatter with LANGUAGE_SYSTEM instead of ScGlobal::eLnge They both end up as the same locale, but with LANGUAGE_SYSTEM the LanguageTag still has the mbSystemLocale=true "this is the system locale" context. Change-Id: I7ff8a368e4dc9c6c471dd78be744c842b188478b diff --git a/sc/source/core/data/poolhelp.cxx b/sc/source/core/data/poolhelp.cxx index b469155..72360c6 100644 --- a/sc/source/core/data/poolhelp.cxx +++ b/sc/source/core/data/poolhelp.cxx @@ -98,7 +98,7 @@ SvNumberFormatter* ScPoolHelper::CreateNumberFormatter() const SvNumberFormatter* p = nullptr; { osl::MutexGuard aGuard(&maMtxCreateNumFormatter); -p = new SvNumberFormatter(comphelper::getProcessComponentContext(), ScGlobal::eLnge); +p = new SvNumberFormatter(comphelper::getProcessComponentContext(), LANGUAGE_SYSTEM); } p->SetColorLink( LINK(m_pSourceDoc, ScDocument, GetUserDefinedColor) ); p->SetEvalDateFormat(NF_EVALDATEFORMAT_INTL_FORMAT); commit 7c7df2afa93f706cc72b8154b816d3edee1e7eff Author: Eike Rathke Date: Tue Aug 9 12:44:12 2016 +0200 remove the duplicated system locale check ... which is handled by LanguageTag::convertToLanguageType() anyway. Change-Id: I26656d64fdccf9c06d24c53e1e473e355732e00f diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index ed122b5..cd78804 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.cxx @@ -94,10 +94,6 @@ static const SfxItemPropertyMapEntry* lcl_GetNumberSettingsPropertyMap() static LanguageType lcl_GetLanguage( const lang::Locale& rLocale ) { -// empty language -> LANGUAGE_SYSTEM -if ( rLocale.Language.isEmpty() ) -return LANGUAGE_SYSTEM; - LanguageType eRet = LanguageTag::convertToLanguageType( rLocale, false); if ( eRet == LANGUAGE_NONE ) eRet = LANGUAGE_SYSTEM; //! or throw an exception? commit 0d386267458b881f15e555186b52f7e2517ceca1 Author: Eike Rathke Date: Tue Aug 9 12:36:58 2016 +0200 do not resolve system locale when queried, rhbz#1364406 related When loading older documents that calculated a number format on the fly an inherited but default format of a type could had been applied using the fixed resolved locale instead of the default system locale, which then was stored upon save and remained sticky. This because a format the formula depends on already was applied using the resolved system locale. http://bugs.documentfoundation.org/attachment.cgi?id=78559 of tdf#63267 exhibits the behavior on the hidden sheet 'Festwerte' when unprotected and inspecting number formats in column A under Datum. Change-Id: If23908f259458e988c5164cc5e268bfc9a6a6bcd diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index 3e9436f..ed122b5 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.cxx @@ -717,7 +717,7 @@ uno::Any SAL_CALL SvNumberFormatObj::getPropertyValue( const OUString& aProperty } else if (aPropertyName == PROPERTYNAME_LOCALE) { -lang::Locale aLocale( LanguageTag( pFormat->GetLanguage()).getLocale()); +lang::Locale aLocale( LanguageTag( pFormat->GetLanguage()).getLocale( false)); aRet <<= aLocale; } else if (aPropertyName == PROPERTYNAME_TYPE) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source sc/uiconfig
sc/source/ui/optdlg/calcoptionsdlg.cxx| 674 -- sc/source/ui/optdlg/calcoptionsdlg.hxx| 20 sc/uiconfig/scalc/ui/formulacalculationoptions.ui | 299 - sc/uiconfig/scalc/ui/optformula.ui|2 4 files changed, 1 insertion(+), 994 deletions(-) New commits: commit 70258bb2d637319d8ff1d19bf304f813c5b2e948 Author: Tor Lillqvist Date: Wed Jul 27 11:59:32 2016 +0300 Drop OpenCL details from the 'Detailed Calculation Settings' dialog There is really no need for end-users to have access to these settings. We don't want end-users to shoot themselves in the foot. If power users really think they need to modify these settings, they can poke the LibreOffice registry. Change-Id: I567506f2d2adf3c3b1817ca82be808af4e9698f7 diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx index a3aac8f..20a7788 100644 --- a/sc/source/ui/optdlg/calcoptionsdlg.cxx +++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx @@ -99,20 +99,6 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi get(mpCurrentDocOnly,"current_doc"); mpCurrentDocOnly->Check(!mbWriteConfig); mpCurrentDocOnly->SetClickHdl(LINK(this, ScCalcOptionsDialog, CurrentDocOnlyHdl)); - -get(mpUseOpenCL,"CBUseOpenCL"); -mpUseOpenCL->Check(rConfig.mbOpenCLSubsetOnly); -mpUseOpenCL->SetClickHdl(LINK(this, ScCalcOptionsDialog, CBUseOpenCLHdl)); - -get(mpSpinButton,"spinOpenCLSize"); -mpSpinButton->SetValue(rConfig.mnOpenCLMinimumFormulaGroupSize); -mpSpinButton->SetModifyHdl(LINK(this, ScCalcOptionsDialog, SpinOpenCLMinSizeHdl)); - -get(mpEditField, "entry"); - mpEditField->SetText(ScOpCodeSetToSymbolicString(maConfig.mpOpenCLSubsetOpCodes)); -mpEditField->set_height_request(4 * mpEditField->GetTextHeight()); - -mpEditField->SetModifyHdl(LINK(this, ScCalcOptionsDialog, EditModifiedHdl)); } ScCalcOptionsDialog::~ScCalcOptionsDialog() @@ -126,9 +112,6 @@ void ScCalcOptionsDialog::dispose() mpConversion.clear(); mpSyntax.clear(); mpCurrentDocOnly.clear(); -mpUseOpenCL.clear(); -mpSpinButton.clear(); -mpEditField.clear(); ModalDialog::dispose(); } @@ -177,19 +160,4 @@ IMPL_LINK_TYPED(ScCalcOptionsDialog, CurrentDocOnlyHdl, Button*, pCheckBox, void mbWriteConfig = !(static_cast(pCheckBox)->IsChecked()); } -IMPL_LINK_TYPED(ScCalcOptionsDialog, CBUseOpenCLHdl, Button*, pCheckBox, void) -{ -maConfig.mbOpenCLSubsetOnly = static_cast(pCheckBox)->IsChecked(); -} - -IMPL_LINK_TYPED(ScCalcOptionsDialog, SpinOpenCLMinSizeHdl, Edit&, rEdit, void) -{ -maConfig.mnOpenCLMinimumFormulaGroupSize = static_cast(rEdit).GetValue(); -} - -IMPL_LINK_TYPED(ScCalcOptionsDialog, EditModifiedHdl, Edit&, rCtrl, void) -{ -maConfig.mpOpenCLSubsetOpCodes = ScStringToOpCodeSet(rCtrl.GetText()); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx index 317f793..a2bf8c2 100644 --- a/sc/source/ui/optdlg/calcoptionsdlg.hxx +++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx @@ -39,13 +39,10 @@ public: virtual void dispose() override; DECL_LINK_TYPED( BtnAutomaticSelectHdl, RadioButton&, void ); -DECL_LINK_TYPED( EditModifiedHdl, Edit&, void ); DECL_LINK_TYPED( AsZeroModifiedHdl, Button*, void); DECL_LINK_TYPED( ConversionModifiedHdl, ListBox&, void); DECL_LINK_TYPED( SyntaxModifiedHdl, ListBox&, void); DECL_LINK_TYPED( CurrentDocOnlyHdl, Button*, void); -DECL_LINK_TYPED( CBUseOpenCLHdl, Button*, void); -DECL_LINK_TYPED( SpinOpenCLMinSizeHdl, Edit&, void); const ScCalcConfig& GetConfig() const { return maConfig;} bool GetWriteCalcConfig() const { return mbWriteConfig;} @@ -61,10 +58,6 @@ private: VclPtr mpSyntax; VclPtr mpCurrentDocOnly; -VclPtr mpUseOpenCL; -VclPtr mpSpinButton; -VclPtr mpEditField; - ScCalcConfig maConfig; bool mbSelectedEmptyStringAsZero; diff --git a/sc/uiconfig/scalc/ui/formulacalculationoptions.ui b/sc/uiconfig/scalc/ui/formulacalculationoptions.ui index d748f7d..ffeda70 100644 --- a/sc/uiconfig/scalc/ui/formulacalculationoptions.ui +++ b/sc/uiconfig/scalc/ui/formulacalculationoptions.ui @@ -203,121 +203,6 @@ 0 - - -True -False -0 -none - - -True -False -6 -12 - - -True -False -True -True -6 -12 - - -Use Open_CL only for a subset of operations -True -True -
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/filter/excel/xlformula.cxx |4 ++-- sc/source/filter/oox/formulabase.cxx | 16 +++- 2 files changed, 17 insertions(+), 3 deletions(-) New commits: commit 3d70765218986abba8b6d7c8e3cadd83a62ee035 Author: Eike Rathke Date: Fri Jul 15 13:43:09 2016 +0200 mapping ERROR.TYPE to ORG.OPENOFFICE.ERRORTYPE was always wrong Change-Id: I02b941a1a884a984b39632cad36579130cd71d6c diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx index 63372e6..232d569 100644 --- a/sc/source/filter/oox/formulabase.cxx +++ b/sc/source/filter/oox/formulabase.cxx @@ -488,7 +488,7 @@ static const FunctionData saFuncTableBiff4[] = { "RANK", "RANK", 216,216,2, 3, V, { VR, RO, VR }, 0 }, { "DB", "DB", 247,247,4, 5, V, { VR }, 0 }, { "FREQUENCY", "FREQUENCY",252,252,2, 2, A, { RA }, 0 }, -{ "ORG.OPENOFFICE.ERRORTYPE","ERROR.TYPE", 261,261,1, 1, V, { VR }, 0 }, +{ "ERROR.TYPE", "ERROR.TYPE", 261,261,1, 1, V, { VR }, 0 }, { "AVEDEV", "AVEDEV", 269,269,1, MX, V, { RX }, 0 }, { "BETADIST", "BETADIST", 270,270,3, 5, V, { VR }, 0 }, { "GAMMALN","GAMMALN", 271,271,1, 1, V, { VR }, 0 }, commit 89c4a69103b6e15e7f52401c51110b926c3ccf36 Author: Eike Rathke Date: Fri Jul 15 13:20:19 2016 +0200 add missing functions to FunctionData saFuncTableOOoLO Change-Id: I9cd23fcbeabaf29b4ea9b85691e2871b32666cdd diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx index e9242f6..63372e6 100644 --- a/sc/source/filter/oox/formulabase.cxx +++ b/sc/source/filter/oox/formulabase.cxx @@ -948,6 +948,20 @@ static const FunctionData saFuncTableOOoLO[] = { "ORG.OPENOFFICE.DAYSINYEAR", "COM.SUN.STAR.SHEET.ADDIN.DATEFUNCTIONS.GETDAYSINYEAR", NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_IMPORTONLY | FUNCFLAG_EXTERNAL }, { "ORG.OPENOFFICE.WEEKSINYEAR", "COM.SUN.STAR.SHEET.ADDIN.DATEFUNCTIONS.GETWEEKSINYEAR", NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_IMPORTONLY | FUNCFLAG_EXTERNAL }, { "ORG.OPENOFFICE.ROT13", "COM.SUN.STAR.SHEET.ADDIN.DATEFUNCTIONS.GETROT13", NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_IMPORTONLY | FUNCFLAG_EXTERNAL }, +// More functions written wrongly in the past. +{ "ORG.OPENOFFICE.ERRORTYPE", "ORG.OPENOFFICE.ERRORTYPE", NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALL_NEW }, +{ "ORG.OPENOFFICE.MULTIRANGE", "ORG.OPENOFFICE.MULTIRANGE",NOID, NOID, 1, MX, V, { RX }, FUNCFLAG_MACROCALL_NEW }, +{ "ORG.OPENOFFICE.GOALSEEK","ORG.OPENOFFICE.GOALSEEK", NOID, NOID, 3, 3, V, { VR }, FUNCFLAG_MACROCALL_NEW }, +{ "ORG.OPENOFFICE.EASTERSUNDAY","ORG.OPENOFFICE.EASTERSUNDAY", NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_MACROCALL_NEW }, +{ "ORG.OPENOFFICE.CURRENT", "ORG.OPENOFFICE.CURRENT", NOID, NOID, 0, 0, V, { VR }, FUNCFLAG_MACROCALL_NEW }, +{ "ORG.OPENOFFICE.STYLE", "ORG.OPENOFFICE.STYLE", NOID, NOID, 1, 3, V, { VR }, FUNCFLAG_MACROCALL_NEW }, +// And the import for the wrongly written functions even without _xlfn. +{ "ORG.OPENOFFICE.ERRORTYPE", "ERRORTYPE",NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_IMPORTONLY }, +{ "ORG.OPENOFFICE.MULTIRANGE", "MULTIRANGE", NOID, NOID, 1, MX, V, { RX }, FUNCFLAG_IMPORTONLY }, +{ "ORG.OPENOFFICE.GOALSEEK","GOALSEEK", NOID, NOID, 3, 3, V, { VR }, FUNCFLAG_IMPORTONLY }, +{ "ORG.OPENOFFICE.EASTERSUNDAY","EASTERSUNDAY", NOID, NOID, 1, 1, V, { VR }, FUNCFLAG_IMPORTONLY }, +{ "ORG.OPENOFFICE.CURRENT", "CURRENT", NOID, NOID, 0, 0, V, { VR }, FUNCFLAG_IMPORTONLY }, +{ "ORG.OPENOFFICE.STYLE", "STYLE",NOID, NOID, 1, 3, V, { VR }, FUNCFLAG_IMPORTONLY }, // Other functions. { "ORG.OPENOFFICE.CONVERT", "ORG.OPENOFFICE.CONVERT", NOID, NOID, 3, 3, V, { VR }, FUNCFLAG_MACROCALL_NEW }, { "ORG.LIBREOFFICE.COLOR", "ORG.LIBREOFFICE.COLOR",NOID, NOID, 3, 4, V, { VR }, FUNCFLAG_MACROCALL_NEW }, commit 24fe9e30d5b9c85da55c8f2ba85d0c3a50fa180a Author: Eike Rathke Date: Fri Jul 15 13:16:07 2016 +0200 STYLE only one parameter required, two optional Change-Id: Ifb0fa665a6ae3af03c307052a45bba5cf77b9208 diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx index 3ab4656..665dd94 100644 --- a/sc/source/filter/excel/xlformula.cxx +++ b/sc/source/filter/excel/xlformula.cxx @@ -622,8 +622,8 @@ static const XclFunctionInfo saFuncTable_OOoLO[] = EXC_FUNCENTRY_OOO_IBR( ocEasterSunday,1,1, 0, "EASTERSUNDAY" ), // was written wrongly, read it EXC_FUNCENT
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/core/tool/interpr4.cxx | 84 ++- 1 file changed, 57 insertions(+), 27 deletions(-) New commits: commit 835fa9bd687518f44465cb22348a13984cdf779d Author: Eike Rathke Date: Fri Jul 1 11:39:19 2016 +0200 no need to check twice Change-Id: Iad2942851fced632c0c662bf754b1d687740105c diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index f57a970..9245ff7 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -2097,13 +2097,22 @@ sal_Int32 ScInterpreter::GetInt32() { double fVal = GetDouble(); if (fVal > 0.0) +{ fVal = rtl::math::approxFloor( fVal); +if (fVal > SAL_MAX_INT32) +{ +SetError( errIllegalArgument); +return SAL_MAX_INT32; +} +} else if (fVal < 0.0) -fVal = rtl::math::approxCeil( fVal); -if (fVal < SAL_MIN_INT32 || fVal > SAL_MAX_INT32) { -SetError( errIllegalArgument); -return SAL_MAX_INT32; +fVal = rtl::math::approxCeil( fVal); +if (fVal < SAL_MIN_INT32) +{ +SetError( errIllegalArgument); +return SAL_MAX_INT32; +} } return static_cast(fVal); } @@ -2112,13 +2121,22 @@ sal_Int32 ScInterpreter::GetInt32WithDefault( sal_Int32 nDefault ) { double fVal = GetDoubleWithDefault( nDefault); if (fVal > 0.0) +{ fVal = rtl::math::approxFloor( fVal); +if (fVal > SAL_MAX_INT32) +{ +SetError( errIllegalArgument); +return SAL_MAX_INT32; +} +} else if (fVal < 0.0) -fVal = rtl::math::approxCeil( fVal); -if (fVal < SAL_MIN_INT32 || fVal > SAL_MAX_INT32) { -SetError( errIllegalArgument); -return SAL_MAX_INT32; +fVal = rtl::math::approxCeil( fVal); +if (fVal < SAL_MIN_INT32) +{ +SetError( errIllegalArgument); +return SAL_MAX_INT32; +} } return static_cast(fVal); } @@ -2127,13 +2145,22 @@ sal_Int16 ScInterpreter::GetInt16() { double fVal = GetDouble(); if (fVal > 0.0) +{ fVal = rtl::math::approxFloor( fVal); +if (fVal > SAL_MAX_INT16) +{ +SetError( errIllegalArgument); +return SAL_MAX_INT16; +} +} else if (fVal < 0.0) -fVal = rtl::math::approxCeil( fVal); -if (fVal < SAL_MIN_INT16 || fVal > SAL_MAX_INT16) { -SetError( errIllegalArgument); -return SAL_MAX_INT16; +fVal = rtl::math::approxCeil( fVal); +if (fVal < SAL_MIN_INT16) +{ +SetError( errIllegalArgument); +return SAL_MAX_INT16; +} } return static_cast(fVal); } commit f45a78ac585b847c64c4bb78436f895b243ca2f6 Author: Eike Rathke Date: Fri Jul 1 11:27:24 2016 +0200 use GetInt32() for integer Add-In parameters Change-Id: Id62acb1800b3a302d62900699a01d1a5cdf1ab56 diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index dd05982..f57a970 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -2639,13 +2639,9 @@ void ScInterpreter::ScExternal() { case SC_ADDINARG_INTEGER: { -double fVal = GetDouble(); -double fInt = (fVal >= 0.0) ? ::rtl::math::approxFloor( fVal ) : - ::rtl::math::approxCeil( fVal ); -if ( fInt >= LONG_MIN && fInt <= LONG_MAX ) -aParam <<= (sal_Int32)fInt; -else -SetError(errIllegalArgument); +sal_Int32 nVal = GetInt32(); +if (!nGlobalError) +aParam <<= nVal; } break; @@ -2664,18 +2660,13 @@ void ScInterpreter::ScExternal() case svString: case svSingleRef: { -double fVal = GetDouble(); -double fInt = (fVal >= 0.0) ? ::rtl::math::approxFloor( fVal ) : - ::rtl::math::approxCeil( fVal ); -if ( fInt >= LONG_MIN && fInt <= LONG_MAX ) +sal_Int32 nVal = GetInt32(); +if (!nGlobalError) { -sal_Int32 nIntVal = (long)fInt; -uno::Sequence aInner( &nIntVal, 1 ); +uno::Sequence aInner( &nVal, 1 ); uno::Sequence< uno::Sequence > aOuter( &aInner, 1 ); aPar
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/core/tool/interpr1.cxx |8 sc/source/core/tool/interpr4.cxx |8 sc/source/core/tool/interpr5.cxx | 33 +++-- 3 files changed, 39 insertions(+), 10 deletions(-) New commits: commit 824cf015683383b553c744a746ac8e8ea65495cf Author: Eike Rathke Date: Fri May 20 12:06:34 2016 +0200 tdf#93101 handle svExternalSingleRef in ISERROR() Change-Id: I9e2a4aeb16d6777153d2f47a1c1af68fe2e97780 diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 9ee004d..fcbb2d0 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -2771,6 +2771,14 @@ void ScInterpreter::ScIsError() } } break; +case svExternalSingleRef: +{ +ScExternalRefCache::TokenRef pToken; +PopExternalSingleRef(pToken); +if (nGlobalError || !pToken || pToken->GetType() == svError) +bRes = true; +} +break; default: PopError(); if ( nGlobalError ) commit 2f94ff566f7827792175daedb92f12a7e61ad95d Author: Eike Rathke Date: Fri May 20 12:02:58 2016 +0200 tdf#93101 correctly resolve svExternalSingleRef token in GetMatrix() ... including error propagation, and use GetNewMat() instead of a plain ScFullMatrix so the interpreter error handling is set up. Change-Id: I862c46f9afc2afd0bb2a23aa767158e0945583a5 diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index 66b20f6..e1ff66e 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -455,25 +455,38 @@ ScMatrixRef ScInterpreter::GetMatrix() { ScExternalRefCache::TokenRef pToken; PopExternalSingleRef(pToken); -if (!pToken) +pMat = GetNewMat( 1, 1, true); +if (!pMat) { -PopError(); SetError( errIllegalArgument); break; } -if (pToken->GetType() == svDouble) +if (!pToken) { -pMat = new ScFullMatrix(1, 1, 0.0); -pMat->PutDouble(pToken->GetDouble(), 0, 0); +SetError( errIllegalArgument); +pMat->PutError( nGlobalError, 0, 0); +nGlobalError = 0; +break; } -else if (pToken->GetType() == svString) +if (nGlobalError) { -pMat = new ScFullMatrix(1, 1, 0.0); -pMat->PutString(pToken->GetString(), 0, 0); +pMat->PutError( nGlobalError, 0, 0); +nGlobalError = 0; +break; } -else +switch (pToken->GetType()) { -pMat = new ScFullMatrix(1, 1); +case svError: +pMat->PutError( pToken->GetError(), 0, 0); +break; +case svDouble: +pMat->PutDouble( pToken->GetDouble(), 0, 0); +break; +case svString: +pMat->PutString( pToken->GetString(), 0, 0); +break; +default: +; // nothing, empty element matrix } } break; commit 7de92ad48d8c4fe7a1f9fb24ef8afc7d8907788e Author: Eike Rathke Date: Fri May 20 11:51:33 2016 +0200 tdf#93101 propagate external reference error from refcache token Change-Id: I90491a7b18fddaddb3bbb4d7a3f8b9555b9b1198 diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index e6985dc..fb17217 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -1200,6 +1200,9 @@ void ScInterpreter::PopExternalSingleRef( return; } +if (xNew->GetType() == svError) +SetError( xNew->GetError()); + rToken = xNew; if (pFmt) *pFmt = aFmt; @@ -1298,6 +1301,11 @@ void ScInterpreter::GetExternalDoubleRef( } formula::FormulaToken* pToken = pArray->First(); +if (pToken->GetType() == svError) +{ +SetError( pToken->GetError()); +return; +} if (pToken->GetType() != svMatrix) { SetError(errIllegalArgument); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/ui/unoobj/textuno.cxx |7 +++ sc/source/ui/view/output2.cxx |8 2 files changed, 7 insertions(+), 8 deletions(-) New commits: commit e74de117e5b2fd944ac3e0dd5368315331a0d351 Author: Eike Rathke Date: Thu May 12 17:57:50 2016 +0200 if we can't use assert() as intended then use SAL_WARN() Change-Id: I5b8d4a8054fb2cfbab2b762371e52fac73cf5e55 diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 2cc4f5a..1c42dec 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -2633,8 +2633,8 @@ void ScOutputData::DrawEditParam::setAlignmentToEngine() { case SVX_HOR_JUSTIFY_REPEAT:// repeat is not yet implemented case SVX_HOR_JUSTIFY_STANDARD: -assert(!"meHorJustResult does not match getAlignmentFromContext()"); -// fallthru +SAL_WARN("sc.ui","meHorJustResult does not match getAlignmentFromContext()"); +SAL_FALLTHROUGH; case SVX_HOR_JUSTIFY_LEFT: eSvxAdjust = SVX_ADJUST_LEFT; break; commit c0977216d79a15dadbcf1c6805e7d50f83e0265f Author: Eike Rathke Date: Thu May 12 17:54:30 2016 +0200 Revert "Silence -Werror,-Wimplicit-fallthrough under NDEBUG" This reverts commit 1d54b93670ac2c40661e3890ecea987d334cba31. Calling abort() here was not the intention. diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index c4df00b..2cc4f5a 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -67,7 +67,6 @@ #include #include -#include #include #include @@ -2632,6 +2631,10 @@ void ScOutputData::DrawEditParam::setAlignmentToEngine() if (meOrient == SVX_ORIENTATION_STANDARD) switch (meHorJustResult) { +case SVX_HOR_JUSTIFY_REPEAT:// repeat is not yet implemented +case SVX_HOR_JUSTIFY_STANDARD: +assert(!"meHorJustResult does not match getAlignmentFromContext()"); +// fallthru case SVX_HOR_JUSTIFY_LEFT: eSvxAdjust = SVX_ADJUST_LEFT; break; @@ -2644,9 +2647,6 @@ void ScOutputData::DrawEditParam::setAlignmentToEngine() case SVX_HOR_JUSTIFY_BLOCK: eSvxAdjust = SVX_ADJUST_BLOCK; break; -case SVX_HOR_JUSTIFY_REPEAT: // repeat is not yet implemented -case SVX_HOR_JUSTIFY_STANDARD: -for (;;) std::abort(); // meHorJustResult does not match getAlignmentFromContext() } else switch (meVerJust) commit c19e7cf433133929c38a58f1addb1fd544ebe02d Author: Eike Rathke Date: Thu May 12 17:52:22 2016 +0200 use SAL_WARN() Change-Id: Ic57614054a7552d778b7bcb36ba3a52865291b5c diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index f2a9ee9..d5c73d9 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -19,8 +19,6 @@ #include -#include - #include "scitems.hxx" #include #include @@ -344,8 +342,9 @@ OUString SAL_CALL ScHeaderFooterTextObj::getString() throw(uno::RuntimeException case ScHeaderFooterPart::RIGHT: pData = rContentObj->GetRightEditObject(); break; -default: //needed for compiler warning: possible uninitialized pointer -for (;;) std::abort(); +default: +SAL_WARN("sc.ui","unexpected enum value of ScHeaderFooterPart"); +pData = nullptr; } if (pData) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/core/tool/compiler.cxx |6 -- sc/source/ui/view/viewfun6.cxx | 13 - 2 files changed, 12 insertions(+), 7 deletions(-) New commits: commit d7d1ce3cd89fb08b07ec87ecafba39da4751abc0 Author: Eike Rathke Date: Thu May 12 17:31:18 2016 +0200 if we can't use assert() as intended then use SAL_WARN() ... even if we lose the "hit me on the head" feature. Change-Id: I7a8ea4ef25a4aa21b06fae8751e7037ff27bad8b diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx index 51e0e8b..37e2cfa 100644 --- a/sc/source/ui/view/viewfun6.cxx +++ b/sc/source/ui/view/viewfun6.cxx @@ -293,9 +293,9 @@ void ScViewFunc::InsertCurrentTime(short nReqFmt, const OUString& rUndoStr) } break; default: -assert(!"unhandled current date/time request"); +SAL_WARN("sc.ui","unhandled current date/time request"); nReqFmt = css::util::NumberFormat::DATETIME; -// fallthru +SAL_FALLTHROUGH; case css::util::NumberFormat::DATETIME: { DateTime aActDateTime( DateTime::SYSTEM ); @@ -387,9 +387,9 @@ void ScViewFunc::InsertCurrentTime(short nReqFmt, const OUString& rUndoStr) } break; default: -assert(!"unhandled current date/time request"); +SAL_WARN("sc.ui","unhandled current date/time request"); nReqFmt = css::util::NumberFormat::DATETIME; -// fallthru +SAL_FALLTHROUGH; case css::util::NumberFormat::DATETIME: break; } commit 64fa77675d9522988827fc4c263637dd6ffa9822 Author: Eike Rathke Date: Thu May 12 17:25:03 2016 +0200 Revert "Silence -Werror,-Wimplicit-fallthrough under NDEBUG" This reverts commit 544d2408e7d8c89ee9e6c802b5487b5a8fb6e0fd. Unconditionally calling abort() here was not the intention. diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx index 99b53a5..51e0e8b 100644 --- a/sc/source/ui/view/viewfun6.cxx +++ b/sc/source/ui/view/viewfun6.cxx @@ -46,7 +46,6 @@ #include "globalnames.hxx" #include "inputhdl.hxx" -#include #include using ::std::vector; @@ -293,6 +292,10 @@ void ScViewFunc::InsertCurrentTime(short nReqFmt, const OUString& rUndoStr) nFormat = nCurNumFormat; } break; +default: +assert(!"unhandled current date/time request"); +nReqFmt = css::util::NumberFormat::DATETIME; +// fallthru case css::util::NumberFormat::DATETIME: { DateTime aActDateTime( DateTime::SYSTEM ); @@ -301,8 +304,6 @@ void ScViewFunc::InsertCurrentTime(short nReqFmt, const OUString& rUndoStr) nFormat = nCurNumFormat; } break; -default: -for (;;) std::abort(); } if (!nFormat) @@ -385,10 +386,12 @@ void ScViewFunc::InsertCurrentTime(short nReqFmt, const OUString& rUndoStr) break; } break; +default: +assert(!"unhandled current date/time request"); +nReqFmt = css::util::NumberFormat::DATETIME; +// fallthru case css::util::NumberFormat::DATETIME: break; -default: -for (;;) std::abort(); } double fVal = 0.0; switch (nReqFmt) commit 0c991c5dbf1f33372e9c6a405fd2a8a49edb93fd Author: Eike Rathke Date: Tue May 10 17:20:21 2016 +0200 comment the outdated documentation Change-Id: I6ee52d2d61ebb1763f2f86c467021fc80467601f diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 2a6c3db..7340de6 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -1922,8 +1922,10 @@ static sal_Unicode* lcl_UnicodeStrNCpy( sal_Unicode* pDst, const sal_Unicode* pS // NextSymbol -// Parses the formula into separate symbols for further -// processing (Turing-Machine). +// Parses the formula into separate symbols for further processing. +// XXX NOTE: this is a rough sketch of the original idea, there are other +// states that were added and didn't make it into this table and things are +// more complicated. Use the source, Luke. // initial state = GetChar ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/core/tool/compiler.cxx | 12 ++-- sc/source/core/tool/tokenstringcontext.cxx |6 ++ 2 files changed, 12 insertions(+), 6 deletions(-) New commits: commit 8898a2359504c0c1e80c39468b8be10065597182 Author: Eike Rathke Date: Tue May 10 13:15:09 2016 +0200 assert OpCodeMap and fallback-init maErrRef Change-Id: I1e289c6891f3d0273104a909428a4aa0daeb738f diff --git a/sc/source/core/tool/tokenstringcontext.cxx b/sc/source/core/tool/tokenstringcontext.cxx index 46f6a8e..1e40afe 100644 --- a/sc/source/core/tool/tokenstringcontext.cxx +++ b/sc/source/core/tool/tokenstringcontext.cxx @@ -12,6 +12,7 @@ #include "document.hxx" #include "dbdata.hxx" #include "externalrefmgr.hxx" +#include "globstr.hrc" using namespace com::sun::star; @@ -39,6 +40,11 @@ TokenStringContext::TokenStringContext( const ScDocument* pDoc, formula::Formula mxOpCodeMap = aComp.GetOpCodeMap(formula::FormulaGrammar::extractFormulaLanguage(eGram)); if (mxOpCodeMap) maErrRef = mxOpCodeMap->getSymbol(ocErrRef); +else +{ +assert(!"TokenStringContext - no OpCodeMap?!?"); +maErrRef = ScGlobal::GetRscString(STR_NO_REF_TABLE); +} if (!pDoc) return; commit f92a6153ad9d8469fd8d6ae03e31fac993da091a Author: Eike Rathke Date: Tue May 10 13:06:40 2016 +0200 use passed rErrRef instead of obtaining resource string Change-Id: I96ae74d8d82468bebcc79cebebf86731685c446f diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 1a9cd57..c7014ac 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -1260,7 +1260,7 @@ struct ConventionXL_A1 : public Convention_A1, public ConventionXL virtual void makeRefStr( OUStringBuffer& rBuf, formula::FormulaGrammar::Grammar /*eGram*/, const ScAddress& rPos, - const OUString& /*rErrRef*/, const std::vector& rTabNames, + const OUString& rErrRef, const std::vector& rTabNames, const ScComplexRefData& rRef, bool bSingleRef, bool /*bFromRangeName*/ ) const override @@ -1275,7 +1275,7 @@ struct ConventionXL_A1 : public Convention_A1, public ConventionXL if (!ValidAddress(aAbs1)) { -rBuf.append(ScGlobal::GetRscString(STR_NO_REF_TABLE)); +rBuf.append(rErrRef); return; } @@ -1284,7 +1284,7 @@ struct ConventionXL_A1 : public Convention_A1, public ConventionXL aAbs2 = aRef.Ref2.toAbs(rPos); if (!ValidAddress(aAbs2)) { -rBuf.append(ScGlobal::GetRscString(STR_NO_REF_TABLE)); +rBuf.append(rErrRef); return; } commit e17b76954cac42d9dec214eb7efb4d2c3d0274b7 Author: Eike Rathke Date: Tue May 10 13:02:21 2016 +0200 use passed rErrRef instead of obtaining resource string Change-Id: I3041b0a4f4427bbcbaf07e7a0694e9cfe5d10014 diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 10ec0ca..1a9cd57 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -1541,7 +1541,7 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL virtual void makeRefStr( OUStringBuffer& rBuf, formula::FormulaGrammar::Grammar /*eGram*/, const ScAddress& rPos, - const OUString& /*rErrRef*/, const std::vector& rTabNames, + const OUString& rErrRef, const std::vector& rTabNames, const ScComplexRefData& rRef, bool bSingleRef, bool /*bFromRangeName*/ ) const override @@ -1555,7 +1555,7 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL // Foo!A1:#REF! versus #REF! at this point if (!ValidCol(aAbsRef.aStart.Col()) || !ValidRow(aAbsRef.aStart.Row())) { -rBuf.append(ScGlobal::GetRscString(STR_NO_REF_TABLE)); +rBuf.append(rErrRef); return; } @@ -1563,7 +1563,7 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL { if (!ValidCol(aAbsRef.aEnd.Col()) || !ValidRow(aAbsRef.aEnd.Row())) { -rBuf.append(ScGlobal::GetRscString(STR_NO_REF_TABLE)); +rBuf.append(rErrRef); return; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/core/tool/interpr8.cxx | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) New commits: commit 2844f3114c2a7b122fe299ed21ed06ca57866e47 Author: Eike Rathke Date: Fri May 6 22:01:46 2016 +0200 actually propagate a match expression error, tdf#97831 follow-up Change-Id: Iaeecf371af8dd5f6c2cbdea2f114566e8bf7cf47 diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx index 36304d8..7d1349f 100644 --- a/sc/source/core/tool/interpr8.cxx +++ b/sc/source/core/tool/interpr8.cxx @@ -1952,6 +1952,7 @@ void ScInterpreter::ScSwitch_MS() isValue = ScMatrix::IsValueType( GetDoubleOrStringFromMatrix( fRefVal, aRefStr ) ); break; default : +PopError(); PushIllegalArgument(); return; } commit c54f6161480fc3721bf8e208cd12a7446ab608b7 Author: Eike Rathke Date: Fri May 6 21:52:28 2016 +0200 coverity#1359230 DEADCODE, detect missing parameter, tdf#97831 follow-up ... so SWITCH with less than 3 parameters returns the proper error code instead of #N/A. Change-Id: Ib5d696a640f7084ca46c3cf8f378ea6e659e3f11 diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx index 1b7bf6d..36304d8 100644 --- a/sc/source/core/tool/interpr8.cxx +++ b/sc/source/core/tool/interpr8.cxx @@ -1913,6 +1913,9 @@ void ScInterpreter::ScSwitch_MS() { short nParamCount = GetByte(); +if (!MustHaveParamCountMin( nParamCount, 3)) +return; + ReverseStack( nParamCount ); nGlobalError = 0; // propagate only for match or active result path @@ -1970,13 +1973,6 @@ void ScInterpreter::ScSwitch_MS() ( !isValue && aRefStr.getDataIgnoreCase() == aStr.getDataIgnoreCase() )) ) { // TRUE -if ( nParamCount < 1 ) -{ -// no parameter given for THEN -nGlobalError = nFirstMatchError; -PushParameterExpected(); -return; -} bFinished = true; } else commit 0ed8a6a5bbe31c9713d017594fbbcf38618e8c1d Author: Eike Rathke Date: Fri May 6 21:29:57 2016 +0200 coverity#1359229 handle PopDoubleRefOrSingleRef() as usual Change-Id: Ib74f00725f2e8b78cbbb92ef9760da74401c1984 diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx index 5cb33f0..1b7bf6d 100644 --- a/sc/source/core/tool/interpr8.cxx +++ b/sc/source/core/tool/interpr8.cxx @@ -1933,8 +1933,7 @@ void ScInterpreter::ScSwitch_MS() case svDoubleRef : { ScAddress aAdr; -PopDoubleRefOrSingleRef( aAdr ); -if ( nGlobalError ) +if (!PopDoubleRefOrSingleRef( aAdr )) break; ScRefCellValue aCell( *pDok, aAdr ); isValue = !( aCell.hasString() || aCell.hasEmptyValue() || aCell.isEmpty() ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/core/tool/cellform.cxx | 87 +- sc/source/filter/xml/xmlexprt.cxx | 18 +-- 2 files changed, 16 insertions(+), 89 deletions(-) New commits: commit d9c1921c5031e5b372ee9d8db1e00fe7211cdd31 Author: Markus Mohrhard Date: Fri Mar 25 01:48:21 2016 +0100 use the ScRefCellValue that is already available, tdf#93405 Change-Id: I68a2ddbe5049d10b5c11c2d77b26dce8dc55ab28 diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index e4e45c7..bf19552 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -213,20 +213,28 @@ OUString lcl_RangeSequenceToString( return aResult.makeStringAndClear(); } -OUString lcl_GetFormattedString( ScDocument* pDoc, const ScAddress& rPos ) +OUString lcl_GetFormattedString(ScDocument* pDoc, ScRefCellValue& rCell, const ScAddress& rAddr) { // return text/edit cell string content, with line feeds in edit cells if (!pDoc) return EMPTY_OUSTRING; -switch (pDoc->GetCellType(rPos)) +switch (rCell.meType) { case CELLTYPE_STRING: -return pDoc->GetString(rPos); +{ +OUString aStr; +Color* pColor; +SvNumberFormatter* pFormatter = pDoc->GetFormatTable(); + +sal_uLong nFormat = pDoc->GetNumberFormat(rAddr); +ScCellFormat::GetString(rCell, nFormat, aStr, &pColor, *pFormatter, pDoc); +return aStr; +} case CELLTYPE_EDIT: { -const EditTextObject* pData = pDoc->GetEditText(rPos); +const EditTextObject* pData = rCell.mpEditText; if (!pData) return EMPTY_OUSTRING; @@ -3095,7 +3103,7 @@ void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 nEqualCellCount) break; case table::CellContentType_TEXT : { -OUString sFormattedString(lcl_GetFormattedString(pDoc, aCell.maCellAddress)); +OUString sFormattedString(lcl_GetFormattedString(pDoc, aCell.maBaseCell, aCell.maCellAddress)); OUString sCellString = aCell.maBaseCell.getString(pDoc); GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes( sCellString, sFormattedString); commit 4518faa31dec03ffabee30437e6960558a940957 Author: Markus Mohrhard Date: Fri Mar 25 01:47:34 2016 +0100 we already pass the ScRefCellValue as parameter, tdf#93405 Change-Id: I27f7e8ffe93545fe872a0c5b64f26dc90cb70e6f diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx index 758d3f4..a9877ce 100644 --- a/sc/source/core/tool/cellform.cxx +++ b/sc/source/core/tool/cellform.cxx @@ -199,7 +199,7 @@ OUString ScCellFormat::GetOutputString( ScDocument& rDoc, const ScAddress& rPos, // like in GetString for document (column) Color* pColor; sal_uLong nNumFmt = rDoc.GetNumberFormat(rPos); -aVal = GetString(rDoc, rPos, nNumFmt, &pColor, *rDoc.GetFormatTable()); +GetString(rCell, nNumFmt, aVal, &pColor, *rDoc.GetFormatTable(), &rDoc); } return aVal; } commit ee98f0e691e3cf945725a9f1daa90542407e3358 Author: Markus Mohrhard Date: Fri Mar 25 01:22:32 2016 +0100 these two methods are identical copies, related tdf#93405 This already gives a 15% improvement as we now only query the cell twice instead of three times. Change-Id: I2e0533f05ace6773ad0710b2c586ca325aeae91b diff --git a/sc/source/core/tool/cellform.cxx b/sc/source/core/tool/cellform.cxx index c588676..758d3f4 100644 --- a/sc/source/core/tool/cellform.cxx +++ b/sc/source/core/tool/cellform.cxx @@ -133,89 +133,8 @@ OUString ScCellFormat::GetString( OUString aString; *ppColor = nullptr; -CellType eType = rDoc.GetCellType(rPos); -switch (eType) -{ -case CELLTYPE_STRING: -{ -ScRefCellValue aCell(rDoc, rPos); -rFormatter.GetOutputString(aCell.mpString->getString(), nFormat, aString, ppColor); -} -break; -case CELLTYPE_EDIT: -{ -ScRefCellValue aCell(rDoc, rPos); -rFormatter.GetOutputString(aCell.getString(&rDoc), nFormat, aString, ppColor); -} -break; -case CELLTYPE_VALUE: -{ -double nValue = rDoc.GetValue(rPos); -if (!bNullVals && nValue == 0.0) aString.clear(); -else -{ -if (eForceTextFmt == ftCheck) -{ -if (nFormat && rFormatter.IsTextFormat(nFormat)) eForceTextFmt = ftForce; -} -if (eForceTextFmt == ftForce) -{ -OUString aTemp; -rFormatter.GetOutputString(nValue, 0, aTemp, ppColor); -rFormatter.GetOutputString(aTemp, nFormat, aString, ppColor); -} -
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/ui/collab/sendfunc.cxx |5 ++--- sc/source/ui/collab/sendfunc.hxx |2 +- sc/source/ui/inc/docsh.hxx |1 + 3 files changed, 4 insertions(+), 4 deletions(-) New commits: commit 2adf4ae59a0d92e289bbd63c8ed3490a58c4cbbf Author: David Tardon Date: Tue Mar 15 06:54:13 2016 +0100 update return type Change-Id: I34b53e660263a1ff89de9c468f197ecc5e7fe9dd diff --git a/sc/source/ui/collab/sendfunc.cxx b/sc/source/ui/collab/sendfunc.cxx index 1c8a387..fca719e 100644 --- a/sc/source/ui/collab/sendfunc.cxx +++ b/sc/source/ui/collab/sendfunc.cxx @@ -387,10 +387,10 @@ bool ScDocFuncSend::SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell, return true; // needs some code auditing action } -bool ScDocFuncSend::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine, bool bApi ) +void ScDocFuncSend::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine, bool bApi ) { SAL_INFO( "sc.tubes", "PutData not implemented!" ); -return ScDocFunc::PutData( rPos, rEngine, bApi ); +ScDocFunc::PutData( rPos, rEngine, bApi ); } bool ScDocFuncSend::SetCellText( diff --git a/sc/source/ui/collab/sendfunc.hxx b/sc/source/ui/collab/sendfunc.hxx index d5b605d..3601e68 100644 --- a/sc/source/ui/collab/sendfunc.hxx +++ b/sc/source/ui/collab/sendfunc.hxx @@ -39,7 +39,7 @@ public: virtual bool SetStringCell( const ScAddress& rPos, const OUString& rStr, bool bInteraction ); virtual bool SetEditCell( const ScAddress& rPos, const EditTextObject& rStr, bool bInteraction ); virtual bool SetFormulaCell( const ScAddress& rPos, ScFormulaCell* pCell, bool bInteraction ); -virtual bool PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine, bool bApi ); +virtual void PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine, bool bApi ); virtual bool SetCellText( const ScAddress& rPos, const OUString& rText, bool bInterpret, bool bEnglish, bool bApi, const formula::FormulaGrammar::Grammar eGrammar ); commit 18d357807496603a53300bfcdfaf4f5a3f1a6f0c Author: David Tardon Date: Wed Dec 23 12:02:53 2015 +0100 restore removed function It is used by the tubes collaboration stuff. Change-Id: I9e31f0588f6c400716fba29806c1dab462c32a43 diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index d0f93d4..23755ba 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -226,6 +226,7 @@ public: ScDocument& GetDocument() { return aDocument; } ScDocFunc& GetDocFunc(){ return *pDocFunc; } +voidSetDocFunc( ScDocFunc *pDF ) { pDocFunc = pDF; } SfxPrinter* GetPrinter( bool bCreateIfNotExist = true ); sal_uInt16 SetPrinter( SfxPrinter* pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL ); commit d41c44f9048e1877c129704842a0c59e90dce3d8 Author: David Tardon Date: Mon Mar 14 15:28:17 2016 +0100 WaE: unused variable Change-Id: I6e4f2043118cf0946628f50f51c3d5635b1ce682 diff --git a/sc/source/ui/collab/sendfunc.cxx b/sc/source/ui/collab/sendfunc.cxx index 7edda7a..1c8a387 100644 --- a/sc/source/ui/collab/sendfunc.cxx +++ b/sc/source/ui/collab/sendfunc.cxx @@ -309,7 +309,6 @@ ScDocFuncSend::~ScDocFuncSend() void ScDocFuncSend::EnterListAction( sal_uInt16 nNameResId ) { // Want to group these operations for the other side ... -OUString aUndo( ScGlobal::GetRscString( nNameResId ) ); ScChangeOpWriter aOp( "enterListAction" ); aOp.appendInt( nNameResId ); // nasty but translate-able ... SendMessage( aOp ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/core/data/document.cxx |6 ++ sc/source/ui/view/tabvwshf.cxx | 18 +- 2 files changed, 19 insertions(+), 5 deletions(-) New commits: commit ba3dd2fe5e74337c538205e5be0daf399ee51943 Author: Jan Holesovsky Date: Wed Jan 13 15:03:37 2016 +0100 sc: Fix the unit tests. Change-Id: I1d5ea5835115bca3c8d24dc1f2e43c14d5d7b47a diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index e878815..b8206422 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -105,6 +105,7 @@ #include #include +#include #include #include "mtvelements.hxx" @@ -569,7 +570,7 @@ bool ScDocument::InsertTab( aCxt.mnTabDeletedEnd = nPos; SetAllFormulasDirty(aCxt); -if (GetDrawLayer()->isTiledRendering()) +if (comphelper::LibreOfficeKit::isActive() && GetDrawLayer()) GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, ""); } commit 19ef189f3bebe46a412d22fb6205b0e4c1aa377f Author: Jan Holesovsky Date: Wed Jan 13 11:56:34 2016 +0100 sc: Further .uno:Insert (inserting a new sheet) tweak. Change-Id: I5437e173009be2b21594abfa133c1b48e53a2ff3 diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index 2b838bf..8ed4937 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -192,8 +192,10 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) else --nTabNr; -if ( nTabNr <= nTabCount ) -bOk = InsertTable( aName, nTabNr ); +if (nTabNr > nTabCount) +nTabNr = nTabCount; + +bOk = InsertTable(aName, nTabNr); } if (bOk) commit b70b579b7cc27a6bd2a348acf474b2c2e3fd7e9a Author: Jan Holesovsky Date: Wed Jan 13 11:12:12 2016 +0100 sc: Make .uno:Insert (inserting a new sheet) always succeed. Also, when provided with '0' as the sheet number, treat it as adding at the end - which I think is the usual use case one wants to target. Change-Id: I9e1a1733c2310b8c6bb7ff239351e88bbef09ac7 diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index deaddf4..e878815 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -105,6 +105,8 @@ #include #include +#include + #include "mtvelements.hxx" using ::editeng::SvxBorderLine; @@ -566,6 +568,9 @@ bool ScDocument::InsertTab( aCxt.mnTabDeletedStart = nPos; aCxt.mnTabDeletedEnd = nPos; SetAllFormulasDirty(aCxt); + +if (GetDrawLayer()->isTiledRendering()) + GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_DOCUMENT_SIZE_CHANGED, ""); } return bValid; diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index 0f31469..2b838bf 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -177,15 +177,21 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) bool bOk = false; const SfxPoolItem* pTabItem; const SfxPoolItem* pNameItem; -OUStringaName; if ( pReqArgs->HasItem( FN_PARAM_1, &pTabItem ) && pReqArgs->HasItem( nSlot, &pNameItem ) ) { +OUString aName = static_cast(pNameItem)->GetValue(); +pDoc->CreateValidTabName(aName); + // sheet number from basic: 1-based +// 0 is special, means adding at the end +nTabNr = static_cast(pTabItem)->GetValue(); +if (nTabNr == 0) +nTabNr = nTabCount; +else +--nTabNr; -aName = static_cast(pNameItem)->GetValue(); -nTabNr = static_cast(pTabItem)->GetValue() - 1; if ( nTabNr <= nTabCount ) bOk = InsertTable( aName, nTabNr ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source sw/source
sc/source/filter/excel/xiescher.cxx |3 ++- sw/source/core/ole/ndole.cxx|5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) New commits: commit 7c76db3c88d5fa27776c7c5efa04249a6a7ed559 Author: Caolán McNamara Date: Sat Jan 9 16:57:32 2016 + crashtesting: ooo104626-3.odt assert on reexport to odt try setting DefaultParentBaseURL based on the parent BaseURL for objects created this way Change-Id: I8cb1e9692cc4255c0a0b11b6df4bacee737ae184 diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx index d508654..608e792 100644 --- a/sw/source/core/ole/ndole.cxx +++ b/sw/source/core/ole/ndole.cxx @@ -774,7 +774,8 @@ const uno::Reference < embed::XEmbeddedObject > SwOLEObj::GetOleRef() SfxObjectShell* p = pOLENd->GetDoc()->GetPersist(); assert(p && "No SvPersist present"); -uno::Reference < embed::XEmbeddedObject > xObj = p->GetEmbeddedObjectContainer().GetEmbeddedObject( aName ); +OUString sDocumentBaseURL = p->getDocumentBaseURL(); +uno::Reference < embed::XEmbeddedObject > xObj = p->GetEmbeddedObjectContainer().GetEmbeddedObject(aName, &sDocumentBaseURL); OSL_ENSURE( !xOLERef.is(), "Calling GetOleRef() recursively is not permitted" ); if ( !xObj.is() ) commit 77846edf44512d48f21300bec0b75b94362774b2 Author: Caolán McNamara Date: Sat Jan 9 16:55:13 2016 + OSL_ENSURE on p followed by deref -> assert Change-Id: I4021053efbdaf1c04a9eb4c8fa52ef3da7b98b67 diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx index f17714c..d508654 100644 --- a/sw/source/core/ole/ndole.cxx +++ b/sw/source/core/ole/ndole.cxx @@ -772,7 +772,7 @@ const uno::Reference < embed::XEmbeddedObject > SwOLEObj::GetOleRef() if( !xOLERef.is() ) { SfxObjectShell* p = pOLENd->GetDoc()->GetPersist(); -OSL_ENSURE( p, "No SvPersist present" ); +assert(p && "No SvPersist present"); uno::Reference < embed::XEmbeddedObject > xObj = p->GetEmbeddedObjectContainer().GetEmbeddedObject( aName ); OSL_ENSURE( !xOLERef.is(), "Calling GetOleRef() recursively is not permitted" ); commit 91cbc10f380e752b95c5b71f596d68848533b132 Author: Caolán McNamara Date: Sat Jan 9 15:27:53 2016 + crashtesting: ooo29815-1.doc assert on reexport to doc try setting DefaultParentBaseURL based on the parent BaseURL for objects created this way Change-Id: Id9294e03c9c586a9445257ac9139f26f2b1a6a46 diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index d592213..22265ca 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -1700,8 +1700,9 @@ SdrObjectPtr XclImpChartObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const { // create embedded chart object OUString aEmbObjName; +OUString sBaseURL(GetRoot().GetMedium().GetBaseURL()); Reference< XEmbeddedObject > xEmbObj = pDocShell->GetEmbeddedObjectContainer(). -CreateEmbeddedObject( SvGlobalName( SO3_SCH_CLASSID ).GetByteSequence(), aEmbObjName ); +CreateEmbeddedObject( SvGlobalName( SO3_SCH_CLASSID ).GetByteSequence(), aEmbObjName, &sBaseURL ); /* Set the size to the embedded object, this prevents that font sizes of text objects are changed in the chart when the object is ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source vcl/headless vcl/unx
sc/source/core/tool/scmatrix.cxx|1 + vcl/headless/svpgdi.cxx | 10 +- vcl/unx/generic/window/salframe.cxx |1 + vcl/unx/gtk/gtksalframe.cxx |1 + 4 files changed, 8 insertions(+), 5 deletions(-) New commits: commit 431420b66fd2fc7c76a4a702653fe6baf3985fd5 Author: Caolán McNamara Date: Wed Dec 2 15:08:11 2015 + coverity#1341505 silence Uninitialized scalar variable Change-Id: I7048d69816d09392ce3b974dc2820a0935591c4c diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 622c3d2..ada 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -251,7 +251,7 @@ bool SvpSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, const SalBitmap& rS clipRegion(cr); -cairo_rectangle_int_t extents; +cairo_rectangle_int_t extents = {0, 0, 0, 0}; basebmp::IBitmapDeviceDamageTrackerSharedPtr xDamageTracker(m_aDevice->getDamageTracker()); cairo_rectangle(cr, rTR.mnDestX, rTR.mnDestY, rTR.mnDestWidth, rTR.mnDestHeight); @@ -343,7 +343,7 @@ bool SvpSalGraphics::drawAlphaRect(long nX, long nY, long nWidth, long nHeight, const double fTransparency = (100 - nTransparency) * (1.0/100); -cairo_rectangle_int_t extents; +cairo_rectangle_int_t extents = {0, 0, 0, 0}; basebmp::IBitmapDeviceDamageTrackerSharedPtr xDamageTracker(m_aDevice->getDamageTracker()); cairo_rectangle(cr, nX, nY, nWidth, nHeight); @@ -935,7 +935,7 @@ bool SvpSalGraphics::drawPolyLine( AddPolygonToPath(cr, rPolyLine, rPolyLine.isClosed()); -cairo_rectangle_int_t extents; +cairo_rectangle_int_t extents = {0, 0, 0, 0}; basebmp::IBitmapDeviceDamageTrackerSharedPtr xDamageTracker(m_aDevice->getDamageTracker()); cairo_set_source_rgba(cr, m_aLineColor.getRed()/255.0, @@ -999,7 +999,7 @@ bool SvpSalGraphics::drawPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPoly, d for (const basegfx::B2DPolygon* pPoly = rPolyPoly.begin(); pPoly != rPolyPoly.end(); ++pPoly) AddPolygonToPath(cr, *pPoly, true); -cairo_rectangle_int_t extents; +cairo_rectangle_int_t extents = {0, 0, 0, 0}; basebmp::IBitmapDeviceDamageTrackerSharedPtr xDamageTracker(m_aDevice->getDamageTracker()); if (m_bUseFillColor) @@ -1211,7 +1211,7 @@ void SvpSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalInv clipRegion(cr); -cairo_rectangle_int_t extents; +cairo_rectangle_int_t extents = {0, 0, 0, 0}; basebmp::IBitmapDeviceDamageTrackerSharedPtr xDamageTracker(m_aDevice->getDamageTracker()); cairo_rectangle(cr, nX, nY, nWidth, nHeight); commit 41990e42781ad63ee8cd33159618b5698df2b3d2 Author: Caolán McNamara Date: Wed Dec 2 15:06:43 2015 + coverity#1341504 Uninitialized scalar variable Change-Id: I0c517492d578f0291c823d56332006f6a433ba2e diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index c0e3e75..783bd31 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -2394,6 +2394,7 @@ void X11SalFrame::createNewWindow( ::Window aNewParent, SalX11Screen nXScreen ) nXScreen = m_nXScreen; SystemParentData aParentData; +aParentData.nSize = sizeof(SystemParentData); aParentData.aWindow = aNewParent; aParentData.bXEmbedSupport = (aNewParent != None && m_bXEmbed); // caution: this is guesswork if( aNewParent == None ) diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx index 9f70644..66b2d39 100644 --- a/vcl/unx/gtk/gtksalframe.cxx +++ b/vcl/unx/gtk/gtksalframe.cxx @@ -2889,6 +2889,7 @@ void GtkSalFrame::createNewWindow( ::Window aNewParent, bool bXEmbed, SalX11Scre nXScreen = m_nXScreen; SystemParentData aParentData; +aParentData.nSize = sizeof(SystemParentData); aParentData.aWindow = aNewParent; aParentData.bXEmbedSupport = bXEmbed; if( aNewParent == None ) commit 89956a0586401dfafea3e42dc491d8f6331328f1 Author: Caolán McNamara Date: Wed Dec 2 14:54:54 2015 + coverity#1341507 Uninitialized pointer field Change-Id: I77d59c91f09d2546468942263dbd71ac4665efb0 diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index 42d25ba..881cb81 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -3029,6 +3029,7 @@ void ScVectorRefMatrix::ensureFullMatrix() ScVectorRefMatrix::ScVectorRefMatrix(const formula::DoubleVectorRefToken* pToken, SCSIZE nRowStart, SCSIZE nRowSize) : ScMatrix() , mpToken(pToken) +, mpErrorInterpreter(nullptr) , mnRowStart(nRowStart) , mnRowSize(nRowSize) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source svl/source
sc/source/core/tool/interpr4.cxx |2 +- svl/source/numbers/zformat.cxx | 11 +-- 2 files changed, 6 insertions(+), 7 deletions(-) New commits: commit f9588062dd22771395ed8e076f009deb23a0092f Author: Eike Rathke Date: Tue Nov 24 18:34:20 2015 +0100 never push an error instead of the ScJumpMatrixToken Change-Id: I52854241a9ab87153635b27cb6a66ef4269b2e76 diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index d841422..d6b9694 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -1501,7 +1501,7 @@ bool ScInterpreter::ConvertMatrixParameters() GetTokenMatrixMap().insert( ScTokenMatrixMap::value_type( pCur, xNew)); } -PushTempToken( xNew.get()); +PushTempTokenWithoutError( xNew.get()); // set continuation point of path for main code line aCode.Jump( nNext, nNext); return true; commit d90142c9466a00e2638467d71fcc7d22e49814c3 Author: Eike Rathke Date: Tue Nov 24 18:09:40 2015 +0100 nitpick, use 'b' prefix Change-Id: I9a0d92dee7cebecfb7b204628738f716b901771a diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 19dd531..9c5bbf9 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -4785,7 +4785,7 @@ OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords, nSem++; } OUString aPrefix; -bool LCIDInserted = false; +bool bLCIDInserted = false; if ( !bDefaults ) { @@ -4907,7 +4907,7 @@ OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords, } j = j+2; } -LCIDInserted = true; +bLCIDInserted = true; break; default: aStr.append( pStr[j] ); @@ -4919,7 +4919,7 @@ OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords, if (rNum.IsSet() && rNum.GetNatNum() == 1 && rKeywords[NF_KEY_THAI_T] == "T" && MsLangId::getRealLanguage( rNum.GetLang()) == -LANGUAGE_THAI && !LCIDInserted ) +LANGUAGE_THAI && !bLCIDInserted ) { aStr.insert( 0, "[$-D00041E]" ); // number in Thai digit commit 59dddbc45a782e5119c21412c6e71cc2d8d0d326 Author: Eike Rathke Date: Tue Nov 24 18:08:15 2015 +0100 nitpick, reduce to one string insertion Change-Id: I546ae14d49bb64fb069a4a5d7dc7685e823ea3c3 diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 690e045..19dd531 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -4895,16 +4895,15 @@ OUString SvNumberformat::GetMappedFormatstring( const NfKeywordTable& rKeywords, case NF_SYMBOLTYPE_CALDEL : if ( pStr[j+1] == "buddhist" ) { -aStr.insert( 0, "[$-" ); if ( rNum.IsSet() && rNum.GetNatNum() == 1 && MsLangId::getRealLanguage( rNum.GetLang() ) == LANGUAGE_THAI ) { -aStr.insert( 3, "D07041E]" ); // date in Thai digit, Buddhist era +aStr.insert( 0, "[$-D07041E]" ); // date in Thai digit, Buddhist era } else { -aStr.insert( 3, "107041E]" ); // date in Arabic digit, Buddhist era +aStr.insert( 0, "[$-107041E]" ); // date in Arabic digit, Buddhist era } j = j+2; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/ui/Accessibility/AccessibleDocument.cxx| 33 +-- sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx | 29 +++-- sc/source/ui/Accessibility/AccessiblePreviewTable.cxx| 10 +-- sc/source/ui/inc/AccessibleDocument.hxx |2 sc/source/ui/inc/AccessibleDocumentPagePreview.hxx |6 +- 5 files changed, 36 insertions(+), 44 deletions(-) New commits: commit d7f2db4b9ce445afdcabf370497bc66db76efbbc Author: Stephan Bergmann Date: Tue Oct 6 10:02:52 2015 +0200 Hold some objects by rtl::Reference Change-Id: If42b0fea8417f5e8ce2cb68d79e92e628c77d9e5 diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx index aa2fa07..c63bf05 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx @@ -322,15 +322,15 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewTable::getAccessibleCe { const bool bRotatedColHeader = rRowInfo.bIsHeader; const bool bRotatedRowHeader = rColInfo.bIsHeader; -ScAccessiblePreviewHeaderCell* pHeaderCell = new ScAccessiblePreviewHeaderCell(this, mpViewShell, aCellPos, -bRotatedColHeader, bRotatedRowHeader, nNewIndex); -xRet = pHeaderCell; +rtl::Reference pHeaderCell(new ScAccessiblePreviewHeaderCell(this, mpViewShell, aCellPos, +bRotatedColHeader, bRotatedRowHeader, nNewIndex)); +xRet = pHeaderCell.get(); pHeaderCell->Init(); } else { -ScAccessiblePreviewCell* pCell = new ScAccessiblePreviewCell( this, mpViewShell, aCellPos, nNewIndex ); -xRet = pCell; +rtl::Reference pCell(new ScAccessiblePreviewCell( this, mpViewShell, aCellPos, nNewIndex )); +xRet = pCell.get(); pCell->Init(); } } commit 6b9b38fed94a8ebb13e5be0c4641de4e28f9345d Author: Stephan Bergmann Date: Tue Oct 6 10:02:17 2015 +0200 Hold ScAccessibleDocumentPagePreview::mpTable by rtl::Reference Change-Id: I808f406c6c6c46c0a72e6e02503899e78ba7f7e4 diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index 8816fd7..9ce4591 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -1194,7 +1194,6 @@ ScAccessibleDocumentPagePreview::ScAccessibleDocumentPagePreview( mpViewShell(pViewShell), mpNotesChildren(NULL), mpShapeChildren(NULL), -mpTable(NULL), mpHeader(NULL), mpFooter(NULL) { @@ -1217,11 +1216,7 @@ ScAccessibleDocumentPagePreview::~ScAccessibleDocumentPagePreview() void SAL_CALL ScAccessibleDocumentPagePreview::disposing() { SolarMutexGuard aGuard; -if (mpTable) -{ -mpTable->release(); -mpTable = NULL; -} +mpTable.clear(); if (mpHeader) { mpHeader->release(); @@ -1260,10 +1255,10 @@ void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint // only notify if child exist, otherwise it is not necessary if (pSimpleHint->GetId() == SC_HINT_DATACHANGED) { -if (mpTable) // if there is no table there is nothing to notify, because no one recongnizes the change +if (mpTable.is()) // if there is no table there is nothing to notify, because no one recongnizes the change { { -uno::Reference xAcc = mpTable; +uno::Reference xAcc = mpTable.get(); AccessibleEventObject aEvent; aEvent.EventId = AccessibleEventId::CHILD; aEvent.Source = uno::Reference< XAccessibleContext >(this); @@ -1272,8 +1267,7 @@ void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint } mpTable->dispose(); -mpTable->release(); -mpTable = NULL; +mpTable.clear(); } Size aOutputSize; @@ -1295,11 +1289,10 @@ void ScAccessibleDocumentPagePreview::Notify( SfxBroadcaster& rBC, const SfxHint sal_Int32 nIndex (aCount.nBackShapes + aCount.nHeaders); mpTable = new ScAccessiblePreviewTable( this, mpViewShell, nIndex ); -mpTable->acquire(); mpTable->Init(); { -uno::Reference xAcc = mpTable; +uno::Reference xAcc = mpTable.get(); AccessibleEventObject aEvent; aEvent.EventId = AccessibleEventId::CHILD; aEvent.Source = uno::Reference< XAccessibleContext >(this); @@
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/filter/inc/orcusinterface.hxx | 13 +++ sc/source/filter/orcus/interface.cxx| 105 +++- 2 files changed, 104 insertions(+), 14 deletions(-) New commits: commit c76a1ece89ce22d245367ccd79b6c6e7bc2f522b Author: Markus Mohrhard Date: Mon Aug 31 23:43:37 2015 +0200 orcus: don't leak old state into new style objects Change-Id: I744ff8be96bda2fff61c8fc23a067fdd9b2d4930 diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index d3edc4c..ee04869 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -974,6 +974,7 @@ size_t ScOrcusStyles::commit_font() { SAL_INFO("sc.orcus.style", "commit font"); maFonts.push_back(maCurrentFont); +maCurrentFont = ScOrcusStyles::font(); return maFonts.size() - 1; } @@ -1003,6 +1004,7 @@ size_t ScOrcusStyles::commit_fill() { SAL_INFO("sc.orcus.style", "commit fill"); maFills.push_back(maCurrentFill); +maCurrentFill = ScOrcusStyles::fill(); return maFills.size() - 1; } @@ -1051,6 +1053,7 @@ size_t ScOrcusStyles::commit_cell_protection() { SAL_INFO("sc.orcus.style", "commit cell protection"); maProtections.push_back(maCurrentProtection); +maCurrentProtection = ScOrcusStyles::protection(); return maProtections.size() - 1; } @@ -1072,6 +1075,7 @@ size_t ScOrcusStyles::commit_number_format() { SAL_INFO("sc.orcus.style", "commit number format"); maNumberFormats.push_back(maCurrentNumberFormat); +maCurrentNumberFormat = ScOrcusStyles::number_format(); return maNumberFormats.size() - 1; } commit 897b51239443430790babd507d63fd5d6fb4a727 Author: Markus Mohrhard Date: Mon Aug 31 23:43:15 2015 +0200 import borders from orcus Change-Id: Ieab07fcd9bc89d81829d636bb854db37ad2ba9e0 diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx index 5a08c80..d8a8056 100644 --- a/sc/source/filter/inc/orcusinterface.hxx +++ b/sc/source/filter/inc/orcusinterface.hxx @@ -285,6 +285,12 @@ private: struct border { +struct border_line +{ +Color maColor; +}; +std::map border_lines; + border(); void applyToItemSet(SfxItemSet& rSet) const; diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index 3609139..d3edc4c 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include #include @@ -791,9 +793,44 @@ ScOrcusStyles::border::border() { } -void ScOrcusStyles::border::applyToItemSet(SfxItemSet& /*rSet*/) const +namespace { + +SvxBoxItemLine getDirection(os::border_direction_t dir) { -(void)this; // loplugin:staticmethods +switch (dir) +{ +case os::border_right: +return SvxBoxItemLine::RIGHT; +break; +case os::border_left: +return SvxBoxItemLine::RIGHT; +break; +case os::border_top: +return SvxBoxItemLine::RIGHT; +break; +case os::border_bottom: +return SvxBoxItemLine::RIGHT; +break; +default: +break; +} +return SvxBoxItemLine::RIGHT; +} + +} + +void ScOrcusStyles::border::applyToItemSet(SfxItemSet& rSet) const +{ +SvxBoxItem aItem(ATTR_BORDER); + +for (auto& current_border_line : border_lines) +{ +SvxBoxItemLine eDir = getDirection(current_border_line.first); +editeng::SvxBorderLine aLine(¤t_border_line.second.maColor, 1); +aItem.SetLine(&aLine, eDir); +} + +rSet.Put(aItem); } void ScOrcusStyles::number_format::applyToItemSet(SfxItemSet& /*rSet*/) const @@ -981,19 +1018,22 @@ void ScOrcusStyles::set_border_style(orcus::spreadsheet::border_direction_t /*di // implement later } -void ScOrcusStyles::set_border_color(orcus::spreadsheet::border_direction_t /*dir*/, -orcus::spreadsheet::color_elem_t, -orcus::spreadsheet::color_elem_t, -orcus::spreadsheet::color_elem_t, -orcus::spreadsheet::color_elem_t) +void ScOrcusStyles::set_border_color(orcus::spreadsheet::border_direction_t dir, +orcus::spreadsheet::color_elem_t alpha, +orcus::spreadsheet::color_elem_t red, +orcus::spreadsheet::color_elem_t green, +orcus::spreadsheet::color_elem_t blue) { -// implement later +border::border_line& current_line = maCurrentBorder.border_lines[dir]; +current_line.maColor = Color(alpha, red, green, blue); } size_t ScOrcusStyles::commit_border() { SAL_INFO("sc.orcus.style", "commit border"); -return 0; +maBorders.push_back(maCurrentBorder); +maCurrentBorder = ScOrcusStyles::border(); +return maBorders.size() - 1; } // cell protection commit d4ac7380e5675e165950c40edb45e6d17ac25b33
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/core/tool/compiler.cxx | 16 sc/source/core/tool/dbdata.cxx| 21 - sc/source/filter/oox/workbookfragment.cxx |1 + sc/source/filter/oox/worksheethelper.cxx |1 - 4 files changed, 37 insertions(+), 2 deletions(-) New commits: commit 4fc13975ad83fd2e95d2383ab0e9af688c47710d Author: Eike Rathke Date: Thu Jun 25 14:46:55 2015 +0200 TableRef: ScCompiler::IsTableRefColumn() lookup column name in ScDBData ... as a fallback for named expressions during document import when cell content isn't available yet. Change-Id: I134ac2aaeb5f336703edbadfd6664d916d2c5885 diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 11aa239..3594f0e 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -3495,6 +3495,22 @@ bool ScCompiler::IsTableRefColumn( const OUString& rName ) const } } } + +// And now a fallback for named expressions during document load time when +// cell content isn't available yet. This could be the preferred method IF +// the ScDBData column names were maintained and refreshed on ALL sheet +// operations, including cell content changes. +sal_Int32 nOffset = pDBData->GetColumnNameOffset( aName); +if (nOffset >= 0) +{ +ScSingleRefData aRef; +ScAddress aAdr( aRange.aStart); +aAdr.IncCol( nOffset); +aRef.InitAddress( aAdr); +maRawToken.SetSingleReference( aRef ); +return true; +} + return false; } commit cd3486798496545271baa2cb5d7beb6f0a99dcca Author: Eike Rathke Date: Thu Jun 25 14:45:37 2015 +0200 TableRef: search table column names case insensitive Change-Id: I753a4511aa2c1e37b83094189902ce7031d68c04 diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index ef39e8b..113fa5f 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -603,10 +603,29 @@ void ScDBData::AdjustTableColumnNames( UpdateRefMode eUpdateRefMode, SCCOL nDx, aNewNames.swap( maTableColumnNames); } +namespace { +class TableColumnNameSearch : public unary_function +{ +public: +explicit TableColumnNameSearch( const OUString& rSearchName ) : +maSearchName( rSearchName ) +{ +} + +bool operator()( const OUString& rName ) const +{ +return ScGlobal::GetpTransliteration()->isEqual( maSearchName, rName); +} + +private: +OUString maSearchName; +}; +} + sal_Int32 ScDBData::GetColumnNameOffset( const OUString& rName ) const { ::std::vector::const_iterator it( -::std::find( maTableColumnNames.begin(), maTableColumnNames.end(), rName)); +::std::find_if( maTableColumnNames.begin(), maTableColumnNames.end(), TableColumnNameSearch( rName))); if (it != maTableColumnNames.end()) return it - maTableColumnNames.begin(); commit 58b0c0cf0c1429ec2f7f5ef8fc9ebc4840ace92d Author: Eike Rathke Date: Thu Jun 25 14:43:18 2015 +0200 TableRef: move getTables().applyTableColumns() to the correct position ... in import sequence. Change-Id: Ib5601af281f0378d283ecd61fa71c41e6c1be254 diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx index 342be2b..4b37d0f 100644 --- a/sc/source/filter/oox/workbookfragment.cxx +++ b/sc/source/filter/oox/workbookfragment.cxx @@ -461,6 +461,7 @@ void WorkbookFragment::finalizeImport() // create all database ranges and defined names, in that order getTables().finalizeImport(); +getTables().applyTableColumns(); getDefinedNames().finalizeImport(); // open the VBA project storage OUString aVbaFragmentPath = getFragmentPathFromFirstType( CREATE_MSOFFICE_RELATION_TYPE( "vbaProject" ) ); diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx index 9875f0e..d74f344 100644 --- a/sc/source/filter/oox/worksheethelper.cxx +++ b/sc/source/filter/oox/worksheethelper.cxx @@ -943,7 +943,6 @@ void WorksheetGlobals::finalizeWorksheetImport() // assumes getTables().finalizeImport ( which creates the DatabaseRanges ) // has been called already getTables().applyAutoFilters(); -getTables().applyTableColumns(); getCondFormats().finalizeImport(); lclUpdateProgressBar( mxFinalProgress, 0.25 ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/filter/html/htmlpars.cxx | 34 +- 1 file changed, 13 insertions(+), 21 deletions(-) New commits: commit 1af10d4012aa84a26568bac42bb47a267342afd5 Author: Miklos Vajna Date: Fri Jun 5 12:34:37 2015 +0200 sc: loplugin:staticmethods Change-Id: Ib9689c77cfc8c24b86db7fe6a13f66386d1b0eb8 diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index c343e3b..ae0ce82 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -3164,31 +3164,31 @@ public: } // new members -void simple_selector_type(const char* /*p*/, size_t /*n*/) {} +static void simple_selector_type(const char* /*p*/, size_t /*n*/) {} -void simple_selector_class(const char* /*p*/, size_t /*n*/) {} +static void simple_selector_class(const char* /*p*/, size_t /*n*/) {} -void simple_selector_pseudo_element(orcus::css::pseudo_element_t /*pe*/) {} +static void simple_selector_pseudo_element(orcus::css::pseudo_element_t /*pe*/) {} -void simple_selector_pseudo_class(orcus::css::pseudo_class_t /*pc*/) {} +static void simple_selector_pseudo_class(orcus::css::pseudo_class_t /*pc*/) {} -void simple_selector_id(const char* /*p*/, size_t /*n*/) {} +static void simple_selector_id(const char* /*p*/, size_t /*n*/) {} -void end_simple_selector() {} +static void end_simple_selector() {} -void end_selector() {} +static void end_selector() {} -void combinator(orcus::css::combinator_t /*combinator*/) {} +static void combinator(orcus::css::combinator_t /*combinator*/) {} -void rgb(uint8_t /*red*/ , uint8_t /*green*/ , uint8_t /*blue*/ ) {} +static void rgb(uint8_t /*red*/ , uint8_t /*green*/ , uint8_t /*blue*/ ) {} -void rgba(uint8_t /*red*/ , uint8_t /*green*/ , uint8_t /*blue*/ , double /*alpha*/ ) {} +static void rgba(uint8_t /*red*/ , uint8_t /*green*/ , uint8_t /*blue*/ , double /*alpha*/ ) {} -void hsl(uint8_t /*hue*/ , uint8_t /*sat*/ , uint8_t /*light*/ ) {} +static void hsl(uint8_t /*hue*/ , uint8_t /*sat*/ , uint8_t /*light*/ ) {} -void hsla(uint8_t /*hue*/ , uint8_t /*sat*/ , uint8_t /*light*/ , double /*alpha*/ ) {} +static void hsla(uint8_t /*hue*/ , uint8_t /*sat*/ , uint8_t /*light*/ , double /*alpha*/ ) {} -void url(const char* /*p*/, size_t /*n*/) {} +static void url(const char* /*p*/, size_t /*n*/) {} }; commit 9eeac5506bd726350b51cb0c36606646f04cbae9 Author: Miklos Vajna Date: Fri Jun 5 12:32:10 2015 +0200 sc: another loplugin:unreffun Change-Id: Ic60d05d64c7584b45d69148d29155b04524ab011 diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index c61271b..c343e3b 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -3100,7 +3100,6 @@ class CSSHandler MemStr() : mp(NULL), mn(0) {} MemStr(const char* p, size_t n) : mp(p), mn(n) {} -MemStr(const MemStr& r) : mp(r.mp), mn(r.mn) {} MemStr& operator=(const MemStr& r) { mp = r.mp; commit c76a8580c62299f310e7e43927afc133e2f02350 Author: Miklos Vajna Date: Fri Jun 5 12:29:36 2015 +0200 sc: loplugin:unreffun Change-Id: I6fce9c390aea3f8b2590bc2e1241e0b2b45af51c diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index e418ed8..c61271b 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -3124,13 +3124,6 @@ public: // TODO: For now, we ignore at-rule properties. } -void selector_name(const char* p_elem, size_t n_elem, const char* p_class, size_t n_class) -{ -MemStr aElem(p_elem, n_elem), aClass(p_class, n_class); -SelectorName aName(aElem, aClass); -maSelectorNames.push_back(aName); -} - void property_name(const char* p, size_t n) { maPropName = MemStr(p, n); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source svtools/source sw/source
sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx |5 + svtools/source/contnr/contentenumeration.cxx |5 + sw/source/core/fields/docufld.cxx |4 +--- 3 files changed, 3 insertions(+), 11 deletions(-) New commits: commit 1e2bf2e0bd0c8078870055d5a4fd0a81ffcc5029 Author: Eike Rathke Date: Tue Jan 13 17:16:56 2015 +0100 remove superfluous Date and Time temporaries Change-Id: I7a64027eb58c86ccf9d1b4968c287f0f861f2ec2 diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 4e0355f..f112a44 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -931,9 +931,7 @@ OUString SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat, { OUString aName( xDocProps->getAuthor() ); util::DateTime uDT( xDocProps->getCreationDate() ); -Date aD(uDT); -tools::Time aT(uDT); -DateTime aDate(aD,aT); +DateTime aDate(uDT); if( nSub == DI_CREATE ) ; // das wars schon!! else if( nSub == DI_CHANGE ) commit 35fa188305600fa950a07e4b6c4f6a77a42d32d6 Author: Eike Rathke Date: Tue Jan 13 16:59:30 2015 +0100 eliminate unnecessary macro Change-Id: I0dceccbe1275298b43f50296da075ae95694d39a diff --git a/svtools/source/contnr/contentenumeration.cxx b/svtools/source/contnr/contentenumeration.cxx index b601bf5..2c8e296 100644 --- a/svtools/source/contnr/contentenumeration.cxx +++ b/svtools/source/contnr/contentenumeration.cxx @@ -50,9 +50,6 @@ namespace svt #define ROW_IS_FLOPPY 11 #define ROW_IS_COMPACTDISC 12 -#define CONVERT_DATETIME( aUnoDT, aToolsDT ) \ -aToolsDT = ::DateTime( aUnoDT ); - using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Exception; @@ -260,7 +257,7 @@ namespace svt if ( bContainsDate ) { -CONVERT_DATETIME( aDT, pData->maModDate ); +pData->maModDate = ::DateTime( aDT ); } if ( pData->mbIsFolder ) commit a38e1be92c50ce6feba41402201f09605fedaa5a Author: Eike Rathke Date: Tue Jan 13 16:30:44 2015 +0100 use DateTime instead of separate Date and Time Change-Id: I82cccaabbcf481367e55c52682d0ff765b4a8671 diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx index a85ec22..3703f62 100644 --- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx +++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx @@ -433,10 +433,7 @@ void ScXMLChangeTrackingImportHelper::EndChangeAction() void ScXMLChangeTrackingImportHelper::ConvertInfo(const ScMyActionInfo& aInfo, OUString& rUser, DateTime& aDateTime) { -Date aDate(aInfo.aDateTime); -tools::Time aTime(aInfo.aDateTime); -aDateTime.SetDate( aDate.GetDate() ); -aDateTime.SetTime( aTime.GetTime() ); +aDateTime = DateTime( aInfo.aDateTime); // old files didn't store nanoseconds, enable again if ( aInfo.aDateTime.NanoSeconds ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/core/opencl/formulagroupcl.cxx | 382 --- 1 file changed, 356 insertions(+), 26 deletions(-) New commits: commit 226e367ff93542d82975d6ccd34448f68acf8035 Author: Tor Lillqvist Date: Mon Jan 12 13:03:02 2015 +0200 SAL_INFO the setting arguments to OpenCL kernels and enqueueing them Change-Id: Ia60194f9789324bc484bfa609c6eb92572b8554d diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index bf99b58..d407a79 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -156,6 +156,7 @@ size_t VectorRef::Marshal( cl_kernel k, int argno, int, cl_program ) pNanBuffer, 0, NULL, NULL); } +SAL_INFO("sc.opencl", "Kernel " << k << " arg " << argno << ": cl_mem: " << mpClmem); err = clSetKernelArg(k, argno, sizeof(cl_mem), (void*)&mpClmem); if (CL_SUCCESS != err) throw OpenCLError(err, __FILE__, __LINE__); @@ -214,6 +215,7 @@ public: } // Pass the scalar result back to the rest of the formula kernel +SAL_INFO("sc.opencl", "Kernel " << k << " arg " << argno << ": cl_uint: " << hashCode); cl_int err = clSetKernelArg(k, argno, sizeof(cl_uint), (void*)&hashCode); if (CL_SUCCESS != err) throw OpenCLError(err, __FILE__, __LINE__); @@ -263,6 +265,7 @@ public: { double tmp = GetDouble(); // Pass the scalar result back to the rest of the formula kernel +SAL_INFO("sc.opencl", "Kernel " << k << " arg " << argno << ": double: " << tmp); cl_int err = clSetKernelArg(k, argno, sizeof(double), (void*)&tmp); if (CL_SUCCESS != err) throw OpenCLError(err, __FILE__, __LINE__); @@ -303,6 +306,7 @@ public: { double tmp = 0.0; // Pass the scalar result back to the rest of the formula kernel +SAL_INFO("sc.opencl", "Kernel " << k << " arg " << argno << ": double: " << tmp); cl_int err = clSetKernelArg(k, argno, sizeof(double), (void*)&tmp); if (CL_SUCCESS != err) throw OpenCLError(err, __FILE__, __LINE__); @@ -662,6 +666,7 @@ threefry2x32 (threefry2x32_ctr_t in, threefry2x32_key_t k)\n\ { cl_int seed = comphelper::rng::uniform_int_distribution(0, SAL_MAX_INT32); // Pass the scalar result back to the rest of the formula kernel +SAL_INFO("sc.opencl", "Kernel " << k << " arg " << argno << ": cl_int: " << seed); cl_int err = clSetKernelArg(k, argno, sizeof(cl_int), (void*)&seed); if (CL_SUCCESS != err) throw OpenCLError(err, __FILE__, __LINE__); @@ -770,6 +775,7 @@ size_t DynamicKernelStringArgument::Marshal( cl_kernel k, int argno, int, cl_pro if (CL_SUCCESS != err) throw OpenCLError(err, __FILE__, __LINE__); +SAL_INFO("sc.opencl", "Kernel " << k << " arg " << argno << ": cl_mem: " << mpClmem); err = clSetKernelArg(k, argno, sizeof(cl_mem), (void*)&mpClmem); if (CL_SUCCESS != err) throw OpenCLError(err, __FILE__, __LINE__); @@ -1414,19 +1420,23 @@ public: // set kernel arg of reduction kernel // TODO(Wei Wei): use unique name for kernel cl_mem buf = Base::GetCLBuffer(); +SAL_INFO("sc.opencl", "Kernel " << redKernel << " arg " << 0 << ": cl_mem: " << buf); err = clSetKernelArg(redKernel, 0, sizeof(cl_mem), (void*)&buf); if (CL_SUCCESS != err) throw OpenCLError(err, __FILE__, __LINE__); +SAL_INFO("sc.opencl", "Kernel " << redKernel << " arg " << 1 << ": cl_mem: " << mpClmem2); err = clSetKernelArg(redKernel, 1, sizeof(cl_mem), (void*)&mpClmem2); if (CL_SUCCESS != err) throw OpenCLError(err, __FILE__, __LINE__); +SAL_INFO("sc.opencl", "Kernel " << redKernel << " arg " << 2 << ": cl_int: " << nInput); err = clSetKernelArg(redKernel, 2, sizeof(cl_int), (void*)&nInput); if (CL_SUCCESS != err) throw OpenCLError(err, __FILE__, __LINE__); +SAL_INFO("sc.opencl", "Kernel " << redKernel << " arg " << 3 << ": cl_int: " << nCurWindowSize); err = clSetKernelArg(redKernel, 3, sizeof(cl_int), (void*)&nCurWindowSize); if (CL_SUCCESS != err) throw OpenCLError(err, __FILE__, __LINE__); @@ -1434,6 +1444,7 @@ public: // set work group size and execute size_t global_work_size[] = { 256, (size_t)w }; size_t local_work_size[] = { 256, 1 }; +SAL_INFO("sc.opencl", "Enqueing kernel " << redKernel); err = clEnqueueNDRangeKernel(kEnv.mpkCmdQueue, redKernel, 2, NULL, global_work_size, local_work_size, 0, NULL, NULL); if (CL_SUCCESS != err) @@ -1465,19 +1476,23 @@ public: throw OpenCLError(err, __FILE__, __LINE__); // set kernel arg of reduction kernel buf = Base::GetCLBuffer(); +
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/core/tool/compiler.cxx | 39 +-- 1 file changed, 9 insertions(+), 30 deletions(-) New commits: commit 757ce63f7346aea132f11c3d9a328b0a1a776403 Author: Markus Mohrhard Date: Sat Dec 27 19:27:19 2014 +0100 remove copy&paste code Change-Id: I5710856fdb9fb91573de89eeb5a29d3d106ad7a6 diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 7419a37..f6c868d 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -986,6 +986,10 @@ struct ConventionOOO_A1_ODF : public ConventionOOO_A1 struct ConventionXL { +virtual ~ConventionXL() +{ +} + static void GetTab( const ScAddress& rPos, const std::vector& rTabNames, const ScSingleRefData& rRef, OUString& rTabName ) @@ -1100,7 +1104,7 @@ struct ConventionXL } } -static void parseExternalDocName( const OUString& rFormula, sal_Int32& rSrcPos ) +virtual void parseExternalDocName( const OUString& rFormula, sal_Int32& rSrcPos ) const { sal_Int32 nLen = rFormula.getLength(); const sal_Unicode* p = rFormula.getStr(); @@ -1236,7 +1240,7 @@ struct ConventionXL_A1 : public Convention_A1, public ConventionXL sal_Int32 nSrcPos, const CharClass* pCharClass) const SAL_OVERRIDE { -ConventionXL::parseExternalDocName(rFormula, nSrcPos); +parseExternalDocName(rFormula, nSrcPos); ParseResult aRet; if ( lcl_isValidQuotedText(rFormula, nSrcPos, aRet) ) @@ -1322,7 +1326,7 @@ struct ConventionXL_OOX : public ConventionXL_A1 * CellStr. */ } -static void parseExternalDocNameOOX(const OUString& rFormula, sal_Int32& rSrcPos) +virtual void parseExternalDocName(const OUString& rFormula, sal_Int32& rSrcPos) const SAL_OVERRIDE { sal_Int32 nLen = rFormula.getLength(); const sal_Unicode* p = rFormula.getStr(); @@ -1343,25 +1347,6 @@ struct ConventionXL_OOX : public ConventionXL_A1 } } -virtual ParseResult parseAnyToken( const OUString& rFormula, - sal_Int32 nSrcPos, - const CharClass* pCharClass) const SAL_OVERRIDE -{ -parseExternalDocNameOOX(rFormula, nSrcPos); - -ParseResult aRet; -if ( lcl_isValidQuotedText(rFormula, nSrcPos, aRet) ) -return aRet; - -static const sal_Int32 nStartFlags = KParseTokens::ANY_LETTER_OR_NUMBER | -KParseTokens::ASC_UNDERSCORE | KParseTokens::ASC_DOLLAR; -static const sal_Int32 nContFlags = nStartFlags | KParseTokens::ASC_DOT; -// '?' allowed in range names -const OUString aAddAllowed("?!"); -return pCharClass->parseAnyToken( rFormula, -nSrcPos, nStartFlags, aAddAllowed, nContFlags, aAddAllowed ); -} - virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScAddress& rPos, sal_uInt16 nFileId, const OUString& /*rFileName*/, const OUString& rTabName, const ScSingleRefData& rRef ) const SAL_OVERRIDE @@ -1501,7 +1486,7 @@ struct ConventionXL_R1C1 : public ScCompiler::Convention, public ConventionXL sal_Int32 nSrcPos, const CharClass* pCharClass) const SAL_OVERRIDE { -ConventionXL::parseExternalDocName(rFormula, nSrcPos); +parseExternalDocName(rFormula, nSrcPos); ParseResult aRet; if ( lcl_isValidQuotedText(rFormula, nSrcPos, aRet) ) commit 02caf8f2eef75d8b5acb6a4ec40277355c3c6c6e Author: Markus Mohrhard Date: Sat Dec 27 19:12:16 2014 +0100 that method is the same as in the base class Change-Id: I8cb6f59795d9461c0e02ab70d7edd60af1410c1f diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 2764648..7419a37 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -1362,13 +1362,6 @@ struct ConventionXL_OOX : public ConventionXL_A1 nSrcPos, nStartFlags, aAddAllowed, nContFlags, aAddAllowed ); } -virtual bool parseExternalName( const OUString& rSymbol, OUString& rFile, OUString& rName, -const ScDocument* pDoc, -const uno::Sequence* pExternalLinks ) const SAL_OVERRIDE -{ -return ConventionXL::parseExternalName( rSymbol, rFile, rName, pDoc, pExternalLinks); -} - virtual void makeExternalRefStr( OUStringBuffer& rBuffer, const ScAddress& rPos, sal_uInt16 nFileId, const OUString& /*rFileName*/, const OUString& rTabName, const ScSingleRefData& rRef ) const SAL_OVERRIDE commit cef36587674b6472471478524e87b1add4109507 Author: Markus Mohrhard Date: Sat Dec 27 19:11:22 2014 +0100 return after finding the reference Change-Id: Ia22b97b0a45d8d840095737638c2ccf68373e27a diff -
[Libreoffice-commits] core.git: 3 commits - sc/source sw/source
sc/source/core/opencl/formulagroupcl.cxx |6 -- sw/source/filter/html/css1atr.cxx|6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) New commits: commit ab431b632e1e329372b8058bebdb69e1815840c2 Author: Tor Lillqvist Date: Tue Dec 16 08:18:15 2014 +0200 WaE: replace '+' between string literals with juxtaposition Change-Id: I64690ce1d6960dea52bae6a5bc1d0f1de742cb63 diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 69f1ac7..72ab5c3 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -255,13 +255,13 @@ void SwHTMLWriter::OutCSS1_Property( const sal_Char *pProp, if (bCfgPrintLayout) { sOut.append( "p." + OString(sCSS2_P_CLASS_leaders) + "{max-width:" + OString::number(DOT_LEADERS_MAX_WIDTH) + -"cm;padding:0;overflow-x:hidden;line-height:120%}" + +"cm;padding:0;overflow-x:hidden;line-height:120%}" "p." + OString(sCSS2_P_CLASS_leaders) + ":after{float:left;width:0;white-space:nowrap;content:\""); for (int i = 0; i < 100; i++ ) sOut.append(". "); sOut.append( -"\"}p." + OString(sCSS2_P_CLASS_leaders) + " span:first-child{padding-right:0.33em;background:white}" + -"p." + OString(sCSS2_P_CLASS_leaders) + " span+span{float:right;padding-left:0.33em;" + +"\"}p." + OString(sCSS2_P_CLASS_leaders) + " span:first-child{padding-right:0.33em;background:white}" +"p." + OString(sCSS2_P_CLASS_leaders) + " span+span{float:right;padding-left:0.33em;" "background:white;position:relative;z-index:1}"); } Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() ); commit 7f3441467324e413974dcc9ceee4c3cb8dbda0ea Author: Tor Lillqvist Date: Tue Dec 16 08:16:46 2014 +0200 WaE: Unreferenced function definition Change-Id: I25bc6231f4efd76b33db028f6ffea19799519083 diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 10d9bcd..28519b5 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -3726,10 +3726,12 @@ public: mpKernel = pKernel; } +#if ENABLE_THREADED_OPENCL_KERNEL_COMPILATION void setUnmanagedKernel( DynamicKernel* pKernel ) { mpKernel = pKernel; } +#endif CLInterpreterResult launchKernel() { commit 634fdb75b5d087df769158063dde7c96c0d705f2 Author: Tor Lillqvist Date: Tue Dec 16 08:11:46 2014 +0200 SAL_WARN itself already prints __FILE__ and __LINE__ of its call site Change-Id: I214ee188793e7ef189417460ea32eeaf0a8b6a29 diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index a2c254c..10d9bcd 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -3687,7 +3687,7 @@ public: if (err != CL_SUCCESS) { -SAL_WARN("sc.opencl", "Dynamic formula compiler: OpenCL error: " << err << " at " << __FILE__ << ":" << __LINE__); +SAL_WARN("sc.opencl", "Dynamic formula compiler: OpenCL error: " << err); return false; } @@ -3696,7 +3696,7 @@ public: err = clEnqueueUnmapMemObject(kEnv.mpkCmdQueue, res, resbuf, 0, NULL, NULL); if (err != CL_SUCCESS) { -SAL_WARN("sc.opencl", "Dynamic formula compiler: OpenCL error: " << err << " at " << __FILE__ << ":" << __LINE__); +SAL_WARN("sc.opencl", "Dynamic formula compiler: OpenCL error: " << err); return false; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source vcl/unx
sc/source/filter/xml/xmlexprt.cxx |1 - vcl/unx/glxtest.cxx | 12 2 files changed, 13 deletions(-) New commits: commit eb38796f83f86e07ea0a0b7030eb86ef228a13f0 Author: Markus Mohrhard Date: Sat Dec 6 08:00:23 2014 +0100 that just looks wrong, related fdo#51935 And many more documents. Detected by the new asserts in the document export code. Change-Id: I207ab433b096c3cbaecf1b993595eb36e6553a5e diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index f82e0b4..724c030 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -1054,7 +1054,6 @@ void ScXMLExport::ExportExternalRefCacheStyles() uno::Any aVal; aVal <<= nNumFmt; vector aProps; -aProps.push_back(XMLPropertyState(nEntryIndex, aVal)); aVal <<= aDefaultStyle; aProps.push_back(XMLPropertyState(nEntryIndex, aVal)); commit c36e3eda553dd90630930c79b83a69587c152a55 Author: Markus Mohrhard Date: Fri Dec 5 09:16:10 2014 +0100 no need for extern C here Change-Id: I81a2af7aa5a52a0b19d05a64eacf89ed957a9ce8 diff --git a/vcl/unx/glxtest.cxx b/vcl/unx/glxtest.cxx index e3f16f0..8b9408d 100644 --- a/vcl/unx/glxtest.cxx +++ b/vcl/unx/glxtest.cxx @@ -93,13 +93,6 @@ x_error_handler(Display *, XErrorEvent *ev) return 0; } - -// glxtest is declared inside extern "C" so that the name is not mangled. -// The name is used in build/valgrind/x86_64-redhat-linux-gnu.sup to suppress -// memory leak errors because we run it inside a short lived fork and we don't -// care about leaking memory -extern "C" { - void glxtest() { // we want to redirect to /dev/null stdout, stderr, and while we're at it, @@ -243,8 +236,6 @@ void glxtest() write(write_end_of_the_pipe, buf, length); } -} - /** \returns true in the child glxtest process, false in the parent process */ bool fire_glxtest_process() { commit c1699eab389809407990cc8f1dabe46f7edf7a5b Author: Markus Mohrhard Date: Fri Dec 5 04:51:05 2014 +0100 remove some mozilla env variables Change-Id: Ic0884c2e6a051a7767ac965a7daadfe64537b13d diff --git a/vcl/unx/glxtest.cxx b/vcl/unx/glxtest.cxx index 9e2fba4..e3f16f0 100644 --- a/vcl/unx/glxtest.cxx +++ b/vcl/unx/glxtest.cxx @@ -112,9 +112,6 @@ void glxtest() dup2(fd, i); close(fd); - if (getenv("MOZ_AVOID_OPENGL_ALTOGETHER")) -fatal_error("The MOZ_AVOID_OPENGL_ALTOGETHER environment variable is defined"); - / Open libGL and load needed symbols / #ifdef __OpenBSD__ #define LIBGL_FILENAME "libGL.so" ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source sd/qa writerperfect/qa
sc/source/filter/xml/xmlcelli.cxx | 18 ++-- sd/qa/unit/data/pptx/fail/CVE-2014-6352-1.ppsx |1 writerperfect/qa/unit/data/draw/libcdr/fail/EDB-35217-1.cdr |binary writerperfect/qa/unit/data/draw/libcdr/pass/EDB-35217-2.cdr |binary 4 files changed, 11 insertions(+), 8 deletions(-) New commits: commit 3150ae30415c1253258829dd3d39c015e75c6171 Author: Caolán McNamara Date: Thu Nov 13 10:22:08 2014 + valgrind: check return of convertDateTime before using fDate lots of spew in VALGRIND=memcheck make CppunitTest_writerperfect_calc Change-Id: I8b95e95218beefe19e881c9d055323d0abec49c7 diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx index 7c2c190..68fb1fe 100644 --- a/sc/source/filter/xml/xmlcelli.cxx +++ b/sc/source/filter/xml/xmlcelli.cxx @@ -935,14 +935,16 @@ void ScXMLTableRowCellContext::SetAnnotation(const ScAddress& rPos) if( pNote ) { double fDate; -rXMLImport.GetMM100UnitConverter().convertDateTime( fDate, mxAnnotationData->maCreateDate ); -SvNumberFormatter* pNumForm = pDoc->GetFormatTable(); -sal_uInt32 nfIndex = pNumForm->GetFormatIndex( NF_DATE_SYS_DDMM, LANGUAGE_SYSTEM ); -OUString aDate; -Color* pColor = 0; -Color** ppColor = &pColor; -pNumForm->GetOutputString( fDate, nfIndex, aDate, ppColor ); -pNote->SetDate( aDate ); +if (rXMLImport.GetMM100UnitConverter().convertDateTime(fDate, mxAnnotationData->maCreateDate)) +{ +SvNumberFormatter* pNumForm = pDoc->GetFormatTable(); +sal_uInt32 nfIndex = pNumForm->GetFormatIndex( NF_DATE_SYS_DDMM, LANGUAGE_SYSTEM ); +OUString aDate; +Color* pColor = 0; +Color** ppColor = &pColor; +pNumForm->GetOutputString( fDate, nfIndex, aDate, ppColor ); +pNote->SetDate( aDate ); +} pNote->SetAuthor( mxAnnotationData->maAuthor ); } commit 78bc1be4a7f8b507eaddc6defe1cc3505edf2238 Author: Caolán McNamara Date: Thu Nov 13 09:35:34 2014 + add CVE-2014-6352 testcase Change-Id: I4f1ad13f73737a2c88d5b911f9df858a3427eac2 diff --git a/sd/qa/unit/data/pptx/fail/CVE-2014-6352-1.ppsx b/sd/qa/unit/data/pptx/fail/CVE-2014-6352-1.ppsx new file mode 100644 index 000..f88506ff --- /dev/null +++ b/sd/qa/unit/data/pptx/fail/CVE-2014-6352-1.ppsx @@ -0,0 +1 @@ +ת.Gx©}Ø'[eë2Î~ \ No newline at end of file commit 58d5cbd978fdd7dd29e61e1aa99f8141581a6599 Author: Caolán McNamara Date: Thu Nov 13 09:20:56 2014 + add EDB-35217 tests Change-Id: Id37702123bd81a7102d101d3348dcf923c20a5d8 diff --git a/writerperfect/qa/unit/data/draw/libcdr/fail/EDB-35217-1.cdr b/writerperfect/qa/unit/data/draw/libcdr/fail/EDB-35217-1.cdr new file mode 100644 index 000..3745033 Binary files /dev/null and b/writerperfect/qa/unit/data/draw/libcdr/fail/EDB-35217-1.cdr differ diff --git a/writerperfect/qa/unit/data/draw/libcdr/pass/EDB-35217-2.cdr b/writerperfect/qa/unit/data/draw/libcdr/pass/EDB-35217-2.cdr new file mode 100644 index 000..7a15b4b Binary files /dev/null and b/writerperfect/qa/unit/data/draw/libcdr/pass/EDB-35217-2.cdr differ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/core/data/documen3.cxx |3 ++- sc/source/ui/docshell/docsh5.cxx |2 +- sc/source/ui/unoobj/nameuno.cxx |3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) New commits: commit 7067d930c8390203f49d989b502e4b4ba85f463d Author: Eike Rathke Date: Fri Oct 31 15:28:41 2014 +0100 coverity#735311 Unchecked return value assert if fouled Change-Id: Id3a160ff08907cc7792e93eea9f91997bcc0e2c3 diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 453c8d6..c5602d9 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -137,7 +137,8 @@ void ScDocument::SetAllRangeNames( const boost::ptr_map& { const ScRangeName* pName = itr->second; SCTAB nTab; -GetTable(itr->first, nTab); +bool bFound = GetTable(itr->first, nTab); +assert(bFound); (void)bFound; // fouled up? if (pName->empty()) SetRangeName( nTab, NULL ); else commit 016636450ca2fd0675c2f32f28a30b154705584b Author: Eike Rathke Date: Fri Oct 31 15:24:54 2014 +0100 coverity#735320 Unchecked return value assert if fouled Change-Id: I1bc38690c755b8bc6eab16c8aa33c8f568e0c854 diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx index 54b4d9f..6f8e648 100644 --- a/sc/source/ui/unoobj/nameuno.cxx +++ b/sc/source/ui/unoobj/nameuno.cxx @@ -139,7 +139,8 @@ SCTAB ScNamedRangeObj::GetTab_Impl() ScDocument& rDoc = pDocShell->GetDocument(); SCTAB nTab; OUString sName = mxSheet->getName(); -rDoc.GetTable(sName, nTab); +bool bFound = rDoc.GetTable(sName, nTab); +assert(bFound); (void)bFound; // fouled up? return nTab; } else commit 36705670efc894094f9f987661fa8022bea2e01b Author: Eike Rathke Date: Fri Oct 31 15:03:02 2014 +0100 coverity#735811 Dereference after null check We always have a DB collection. Change-Id: I8933be3a01b4c2e63b852361d5d2438e6fca4d05 diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx index c1ac703..dd6d9f2 100644 --- a/sc/source/ui/docshell/docsh5.cxx +++ b/sc/source/ui/docshell/docsh5.cxx @@ -122,7 +122,7 @@ ScDBData* ScDocShell::GetDBData( const ScRange& rMarked, ScGetDBMode eMode, ScGe // benannter DB-Bereich dort gesucht werden. ScDBCollection* pColl = aDocument.GetDBCollection(); ScDBData* pData = aDocument.GetDBAtArea( nTab, nStartCol, nStartRow, nEndCol, nEndRow ); -if (!pData && pColl) +if (!pData) pData = pColl->GetDBNearCursor(nCol, nRow, nTab ); bool bSelected = ( eSel == SC_DBSEL_FORCE_MARK || ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source sw/source
sc/source/core/data/attrib.cxx | 10 +++ sc/source/core/tool/defaultsoptions.cxx |2 - sc/source/core/tool/docoptio.cxx |2 - sc/source/core/tool/formulaopt.cxx |2 - sc/source/core/tool/printopt.cxx |2 - sc/source/core/tool/viewopti.cxx |2 - sc/source/ui/app/uiitems.cxx | 18 +++--- sw/source/core/attr/cellatr.cxx |6 ++-- sw/source/core/attr/fmtwrapinfluenceonobjpos.cxx |6 ++-- sw/source/core/layout/atrfrm.cxx | 28 +++--- sw/source/core/para/paratr.cxx |4 +-- sw/source/core/tox/tox.cxx |2 - sw/source/core/txtnode/atrfld.cxx|2 - sw/source/core/txtnode/atrflyin.cxx |2 - sw/source/core/txtnode/atrftn.cxx|2 - sw/source/core/txtnode/atrref.cxx|2 - sw/source/core/txtnode/fmtatr2.cxx | 10 +++ sw/source/core/txtnode/thints.cxx| 29 +++ sw/source/uibase/chrdlg/ccoll.cxx|2 - sw/source/uibase/config/cfgitems.cxx |8 +++--- sw/source/uibase/utlui/uiitems.cxx |6 ++-- 21 files changed, 73 insertions(+), 74 deletions(-) New commits: commit 8f7e364a5b6179fdc3b716a3b250e71341536220 Author: Michael Stahl Date: Mon Oct 27 13:55:21 2014 +0100 sw: deploy some asserts in SwpHints::TryInsertNesting() Change-Id: I584edadf13b34edf054e3405865c43bae74a7830 diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index a38fae5..c29f87e 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -164,8 +164,8 @@ bool isSelfNestable(const sal_uInt16 nWhich) (RES_TXTATR_CJK_RUBY == nWhich) || (RES_TXTATR_INPUTFIELD == nWhich)) return false; - OSL_ENSURE((RES_TXTATR_META == nWhich) || - (RES_TXTATR_METAFIELD == nWhich), "???"); +assert((RES_TXTATR_META == nWhich) || + (RES_TXTATR_METAFIELD == nWhich)); return true; } @@ -175,9 +175,9 @@ bool isSplittable(const sal_uInt16 nWhich) if ((RES_TXTATR_INETFMT == nWhich) || (RES_TXTATR_CJK_RUBY == nWhich)) return true; -OSL_ENSURE((RES_TXTATR_META == nWhich) || +assert((RES_TXTATR_META == nWhich) || (RES_TXTATR_METAFIELD == nWhich) || - (RES_TXTATR_INPUTFIELD == nWhich), "???"); + (RES_TXTATR_INPUTFIELD == nWhich)); return false; } @@ -246,7 +246,7 @@ MakeTxtAttrNesting(SwTxtNode & rNode, SwTxtAttrNesting & rNesting, break; } default: -OSL_FAIL("MakeTxtAttrNesting: what the hell is that?"); +assert(!"MakeTxtAttrNesting: what the hell is that?"); break; } return static_txtattr_cast(pNew); @@ -362,12 +362,11 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint ) const sal_Int32 nNewEnd ( *rNewHint.GetEnd() ); const bool bNewSelfNestable( isSelfNestable(nNewWhich) ); -OSL_ENSURE( (RES_TXTATR_INETFMT == nNewWhich) || +assert( (RES_TXTATR_INETFMT == nNewWhich) || (RES_TXTATR_CJK_RUBY == nNewWhich) || (RES_TXTATR_META == nNewWhich) || (RES_TXTATR_METAFIELD == nNewWhich) || -(RES_TXTATR_INPUTFIELD == nNewWhich), -"TryInsertNesting: Expecting INETFMT or RUBY or META or METAFIELD or INPUTFIELD" ); +(RES_TXTATR_INPUTFIELD == nNewWhich)); NestList_t OverlappingExisting; // existing hints to be split NestList_t OverwrittenExisting; // existing hints to be replaced @@ -403,7 +402,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint ) static_txtattr_cast(pOther)); break; default: -OSL_FAIL("bad code monkey"); +assert(!"bad code monkey"); break; } } @@ -419,7 +418,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint ) { if (rNewHint.HasDummyChar()) { -OSL_FAIL("ERROR: inserting duplicate CH_TXTATR hint"); +assert(!"ERROR: inserting duplicate CH_TXTATR hint"); return false; } else if (nNewEnd < nOtherEnd) { // other has dummy char, new is inside other, but @@ -428,7 +427,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint ) // in SwXMeta::createEnumeration // SplitNew is sorted, so this is the first split sal_Int32& rStart(Sp
[Libreoffice-commits] core.git: 3 commits - sc/source sw/qa sw/source xmloff/source
sc/source/filter/xml/XMLConsolidationContext.cxx |4 +- sw/qa/extras/odfimport/data/fdo79269.odt |binary sw/qa/extras/odfimport/odfimport.cxx | 18 +++ sw/source/core/unocore/unostyle.cxx | 34 ++ xmloff/source/text/XMLTextHeaderFooterContext.cxx |8 +++-- 5 files changed, 49 insertions(+), 15 deletions(-) New commits: commit 9ea9d4d7c5db4fa85be2e14d29fe631d58b9e60f Author: Michael Stahl Date: Mon Sep 29 23:41:22 2014 +0200 fdo#79269: sw: more cleanup of SwXStyle's FirstIsShared property Some of the checks for it can never be true given the preceding list of WhichIds, but there is one other case that needs the special handling. Change-Id: Iaf396960d064d0c9f2a950c2d02db1654a669d45 diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 81c14ac..3270a31 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -425,6 +425,23 @@ SwXStyleFamily::~SwXStyleFamily() } +static bool lcl_GetHeaderFooterItem( +SfxItemSet const& rSet, OUString const& rPropName, bool const bFooter, +SvxSetItem const*& o_rpItem) +{ +SfxItemState eState = rSet.GetItemState( +(bFooter) ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET, +false, reinterpret_cast(&o_rpItem)); +if (SfxItemState::SET != eState && +rPropName == UNO_NAME_FIRST_IS_SHARED) +{ // fdo#79269 header may not exist, check footer then +eState = rSet.GetItemState( +(!bFooter) ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET, +false, reinterpret_cast(&o_rpItem)); +} +return SfxItemState::SET == eState; +} + static sal_Int32 lcl_GetCountOrName(const SwDoc &rDoc, SfxStyleFamily eFamily, OUString *pString, sal_uInt16 nIndex = USHRT_MAX) { @@ -2867,10 +2884,7 @@ uno::Sequence< beans::PropertyState > SwXStyle::getPropertyStates( { const SvxSetItem* pSetItem; -if(SfxItemState::SET == rSet.GetItemState( -bFooter ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET, -false, -(const SfxPoolItem**)&pSetItem)) +if (lcl_GetHeaderFooterItem(rSet, sPropName, bFooter, pSetItem)) { // retarget the SfxItemSet to the HeaderFooter SfxSetItem's SfxItenSet pSourceSet = &pSetItem->GetItemSet(); @@ -3420,18 +3434,8 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl( { // it is a Header/Footer entry, access the SvxSetItem containing it's information const SvxSetItem* pSetItem = 0; - -SfxItemState eState = aBaseImpl.GetItemSet().GetItemState( -(bFooter) ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET, -false, reinterpret_cast(&pSetItem)); -if (SfxItemState::SET != eState && -rPropName == UNO_NAME_FIRST_IS_SHARED) -{ // fdo#79269 header may not exist, check footer then -eState = aBaseImpl.GetItemSet().GetItemState( -(!bFooter) ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET, -false, reinterpret_cast(&pSetItem)); -} -if (SfxItemState::SET == eState) +if (lcl_GetHeaderFooterItem(aBaseImpl.GetItemSet(), +rPropName, bFooter, pSetItem)) { lcl_putItemToSet(pSetItem, *pPropSet, *pEntry, pValues[nProp], aBaseImpl, GetBasePool(), GetDoc(), GetFamily()); @@ -3532,7 +3536,7 @@ void SAL_CALL SwXPageStyle::SetPropertyValues_Impl( const bool bHeader(rPropName.startsWith("Header")); const bool bFooter(rPropName.startsWith("Footer")); -if(bHeader || bFooter || rPropName == UNO_NAME_FIRST_IS_SHARED) +if (bHeader || bFooter) { const SvxSetItem* pSetItem = 0; @@ -3736,17 +3740,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl( const SfxItemSet& rSet = xStyle->GetItemSet(); const SvxSetItem* pSetItem; -SfxItemState eState = rSet.GetItemState( -(bFooter) ? SID_ATTR_PAGE_FOOTERSET : SID_ATTR_PAGE_HEADERSET, -false, reinterpret_cast(&pSetItem)); -if (SfxItemState::SET != eState && -rPropName == UNO_NAME_FIRST_IS_SHARED) -
[Libreoffice-commits] core.git: 3 commits - sc/source sd/source sfx2/sdi svx/sdi sw/source
sc/source/ui/drawfunc/drtxtob1.cxx |2 +- sc/source/ui/view/editsh.cxx |2 +- sd/source/ui/func/fuchar.cxx |2 +- sfx2/sdi/sfx.sdi | 20 ++-- svx/sdi/svx.sdi | 20 ++-- sw/source/uibase/shells/annotsh.cxx |4 +--- sw/source/uibase/shells/drwtxtex.cxx |4 +--- 7 files changed, 25 insertions(+), 29 deletions(-) New commits: commit 342c8c9da8f0eb36d2aaeb810e3946e8a09b8a0a Author: Maxim Monastirsky Date: Wed Sep 3 17:50:56 2014 +0300 These slots not meant to be added to a toolbar or recorded Change-Id: Iaf847c02265fcc7d75c1cd54bc836ec85cb830ec diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index d72d23d..f893324 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -6167,15 +6167,15 @@ SfxVoidItem StyleEndPreview SID_STYLE_END_PREVIEW Toggle = FALSE, Container = FALSE, RecordAbsolute = FALSE, -RecordPerSet; +NoRecord; Synchron; /* config: */ -AccelConfig = TRUE, -MenuConfig = TRUE, +AccelConfig = FALSE, +MenuConfig = FALSE, StatusBarConfig = FALSE, -ToolBoxConfig = TRUE, -GroupId = GID_TEMPLATE; +ToolBoxConfig = FALSE, +GroupId = ; ] SfxVoidItem StylePreview SID_STYLE_PREVIEW @@ -6191,15 +6191,15 @@ SfxVoidItem StylePreview SID_STYLE_PREVIEW Toggle = FALSE, Container = FALSE, RecordAbsolute = FALSE, -RecordPerSet; +NoRecord; Synchron; /* config: */ -AccelConfig = TRUE, -MenuConfig = TRUE, +AccelConfig = FALSE, +MenuConfig = FALSE, StatusBarConfig = FALSE, -ToolBoxConfig = TRUE, -GroupId = GID_TEMPLATE; +ToolBoxConfig = FALSE, +GroupId = ; ] diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 10b254f..839b243 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -1691,17 +1691,17 @@ SvxFontItem CharPreviewFontName SID_ATTR_CHAR_PREVIEW_FONT Toggle = FALSE, Container = FALSE, RecordAbsolute = FALSE, -RecordPerSet; +NoRecord; Synchron; Readonly = FALSE, /* config: */ -AccelConfig = TRUE, -MenuConfig = TRUE, +AccelConfig = FALSE, +MenuConfig = FALSE, StatusBarConfig = FALSE, -ToolBoxConfig = TRUE, -GroupId = GID_FORMAT; +ToolBoxConfig = FALSE, +GroupId = ; ] SvxFontItem CharEndPreviewFontName SID_ATTR_CHAR_ENDPREVIEW_FONT @@ -1717,17 +1717,17 @@ SvxFontItem CharEndPreviewFontName SID_ATTR_CHAR_ENDPREVIEW_FONT Toggle = FALSE, Container = FALSE, RecordAbsolute = FALSE, -RecordPerSet; +NoRecord; Synchron; Readonly = FALSE, /* config: */ -AccelConfig = TRUE, -MenuConfig = TRUE, +AccelConfig = FALSE, +MenuConfig = FALSE, StatusBarConfig = FALSE, -ToolBoxConfig = TRUE, -GroupId = GID_FORMAT; +ToolBoxConfig = FALSE, +GroupId = ; ] commit e201506a4cc7e1cac2d04ef3169ef37e34de379a Author: Maxim Monastirsky Date: Sun Aug 31 01:52:52 2014 +0300 Show the right tab for SID_CHAR_DLG_EFFECT Change-Id: I3a8b7a9e973d20f06d423ec55cf689478ca98e0a diff --git a/sc/source/ui/drawfunc/drtxtob1.cxx b/sc/source/ui/drawfunc/drtxtob1.cxx index d364ef2..6c12b0d 100644 --- a/sc/source/ui/drawfunc/drtxtob1.cxx +++ b/sc/source/ui/drawfunc/drtxtob1.cxx @@ -53,7 +53,7 @@ bool ScDrawTextObjectBar::ExecuteCharDlg( const SfxItemSet& rArgs, assert(pDlg && "Dialog create fail!"); if (nSlot == SID_CHAR_DLG_EFFECT) { -pDlg->SetCurPageId(RID_SVXPAGE_CHAR_EFFECTS); +pDlg->SetCurPageId("fonteffects"); } bool bRet = ( pDlg->Execute() == RET_OK ); diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index f0ffb70..5ab8b2b 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -460,7 +460,7 @@ void ScEditShell::Execute( SfxRequest& rReq ) OSL_ENSURE(pDlg, "Dialog create fail!"); if (nSlot == SID_CHAR_DLG_EFFECT) { -pDlg->SetCurPageId(RID_SVXPAGE_CHAR_EFFECTS); +pDlg->SetCurPageId("fonteffects"); } short nRet = pDlg->Execute(); // pDlg is needed below diff --git a/sd/source/ui/func/fuchar.cxx b/sd/source/ui/func/fuchar.cxx index 222634c..8b929c3 100644 --- a/sd/source/ui/func/fuchar.cxx +++ b/sd/source/ui/func/fuchar.cxx @@ -77,7 +77,7 @@ void FuChar::DoExecute( SfxRequest& rReq ) { if (rReq.GetSlot() == SID_CHAR_DLG_EFFECT) { -pDlg->SetCurPageId(RID_SVXPAGE_CHAR_EFFECTS); +pDlg->SetCurPageId("RID_SVXPAGE_CHAR_EFFECTS"); } nResult = pDlg->Execute(); commit f3cec45a2e240fcf4ab84e77d51e2b700492f830 Author: Maxim Monastirsky Date: Sun Aug 31 01:01:21 2014 +0300 Simplify this No other SIDs here have any args anyway. Change-Id: I8444a40d1d428f671f6
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/filter/excel/excdoc.cxx | 263 ++ sc/source/filter/inc/excdoc.hxx | 10 - 2 files changed, 164 insertions(+), 109 deletions(-) New commits: commit 10851dff98846c94ccc14ee58d993362c82734c9 Author: Kohei Yoshida Date: Fri Aug 22 18:58:51 2014 -0400 Split FillAsTable into Binary and Xml variants in the same manner. And remove BIFF-only records from the Xml variant. Change-Id: Ia18cc079d9a9249fbbe0c328b14b719fba8d6bbf diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index 5fff7c8..490d7d4 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -453,7 +453,7 @@ void ExcTable::FillAsHeaderXml( ExcBoundsheetList& rBoundsheetList ) aRecList.AppendRecord( CreateRecord( EXC_ID_SST ) ); } -void ExcTable::FillAsTable( SCTAB nCodeNameIdx ) +void ExcTable::FillAsTableBinary( SCTAB nCodeNameIdx ) { InitializeTable( mnScTab ); @@ -482,12 +482,6 @@ void ExcTable::FillAsTable( SCTAB nCodeNameIdx ) mxNoteList->AppendNewRecord(new XclExpNote(GetRoot(), it->maPos, it->mpNote, OUString())); } -if( GetOutput() != EXC_OUTPUT_BINARY ) -{ -FillAsXmlTable( nCodeNameIdx ); -return; -} - // WSBOOL needs data from page settings, create it here, add it later boost::shared_ptr< XclExpPageSettings > xPageSett( new XclExpPageSettings( GetRoot() ) ); bool bFitToPages = xPageSett->GetPageData().mbFitToPages; @@ -603,17 +597,37 @@ void ExcTable::FillAsTable( SCTAB nCodeNameIdx ) Add( new ExcEof ); } -void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx ) +void ExcTable::FillAsTableXml() { -RootData& rR = GetOldRoot(); +InitializeTable( mnScTab ); + +ScDocument& rDoc = GetDoc(); + +OSL_ENSURE( (mnScTab >= 0L) && (mnScTab <= MAXTAB), "-ExcTable::Table(): mnScTab - no ordinary table!" ); +OSL_ENSURE( nExcTab <= static_cast(MAXTAB), "-ExcTable::Table(): nExcTab - no ordinary table!" ); + +// create a new OBJ list for this sheet (may be used by notes, autofilter, data validation) +GetObjectManager().StartSheet(); + +// cell table: DEFROWHEIGHT, DEFCOLWIDTH, COLINFO, DIMENSIONS, ROW, cell records +mxCellTable.reset( new XclExpCellTable( GetRoot() ) ); + +//export cell notes +std::vector aNotes; +rDoc.GetAllNoteEntries(aNotes); +for (std::vector::const_iterator it = aNotes.begin(), itEnd = aNotes.end(); it != itEnd; ++it) +{ +if (it->maPos.Tab() != mnScTab) +continue; + +mxNoteList->AppendNewRecord(new XclExpNote(GetRoot(), it->maPos, it->mpNote, OUString())); +} // WSBOOL needs data from page settings, create it here, add it later boost::shared_ptr< XclExpPageSettings > xPageSett( new XclExpPageSettings( GetRoot() ) ); XclExtLstRef xExtLst( new XclExtLst( GetRoot() ) ); bool bFitToPages = xPageSett->GetPageData().mbFitToPages; -Add( new ExcBof8 ); - Color aTabColor = GetRoot().GetDoc().GetTabBgColor(mnScTab); Add(new XclExpXmlSheetPr(bFitToPages, mnScTab, aTabColor, &GetFilterManager())); @@ -630,18 +644,6 @@ void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx ) // cell table: DEFCOLWIDTH, COLINFO, DIMENSIONS, ROW, cell records aRecList.AppendRecord( mxCellTable ); -// label ranges -// missing SaveXML -Add( new XclExpLabelranges( GetRoot() ) ); - -// DFF not needed in MSOOXML export -//GetObjectManager().AddSdrPage(); -////! close Escher group shape and ESCHER_DgContainer -////! opened by XclExpObjList ctor MSODRAWING -//rR.pObjRecs->EndSheet(); -//// all MSODRAWING and OBJ stuff of this sheet goes here -//Add( rR.pObjRecs ); - // pivot tables // not in the worksheet file aRecList.AppendRecord( GetPivotTableManager().CreatePivotTablesRecord( mnScTab ) ); @@ -651,11 +653,6 @@ void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx ) if( mxNoteList != 0 && !mxNoteList->IsEmpty() ) aRecList.AppendNewRecord( new XclExpComments( mnScTab, *mxNoteList ) ); -// web queries -// missing SaveXML implementation -Add( new XclExpWebQueryBuffer( GetRoot() ) ); - -ScDocument& rDoc = GetDoc(); const ScTableProtection* pTabProtect = rDoc.GetTabProtection(mnScTab); if (pTabProtect && pTabProtect->isProtected()) Add( new XclExpSheetProtection(true, mnScTab) ); @@ -668,10 +665,6 @@ void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx ) // conditional formats Add( new XclExpCondFormatBuffer( GetRoot(), xExtLst ) ); -if( HasVbaStorage() ) -if( nCodeNameIdx < GetExtDocOptions().GetCodeNameCount() ) -Add( new XclCodename( GetExtDocOptions().GetCodeName( nCodeNameIdx ) ) ); - // data validation (DVAL and list of DV records), generated by the cell table aRecList.AppendRecord( mxCellTable->CreateRecord( EXC_ID_DVAL ) ); @@ -687,24 +680,10 @@ void ExcTable::Fi
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/ui/view/viewfun6.cxx | 279 + 1 file changed, 171 insertions(+), 108 deletions(-) New commits: commit d40700d58e3a418fa54d8f1e424a1bccbd2f188e Author: Eike Rathke Date: Fri Aug 22 23:40:58 2014 +0200 treat datetime as handled Change-Id: Idc94174662eee5a75a6b467e47cbf9027e3ba224 diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx index b6856d0..b2494c1 100644 --- a/sc/source/ui/view/viewfun6.cxx +++ b/sc/source/ui/view/viewfun6.cxx @@ -379,6 +379,9 @@ void ScViewFunc::InsertCurrentTime(short nReqFmt, const OUString& rUndoStr) default: assert(!"unhandled current date/time request"); nReqFmt = NUMBERFORMAT_DATETIME; +// fallthru +case NUMBERFORMAT_DATETIME: +break; } double fVal = 0.0; switch (nReqFmt) commit 0f4a999e02aff56043506e38dfa53ea3b349ce25 Author: Eike Rathke Date: Fri Aug 22 23:25:23 2014 +0200 current date/time hotkey inserts also if cell is in input or edit mode Change-Id: Ib3caed607a5ca1b5ce82de0472223c7bdc8f7f54 diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx index c688a54..b6856d0 100644 --- a/sc/source/ui/view/viewfun6.cxx +++ b/sc/source/ui/view/viewfun6.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include "viewfunc.hxx" #include "detfunc.hxx" @@ -239,6 +240,9 @@ void ScViewFunc::DetectiveMarkSucc() /** Insert date or time into current cell. +If cell is in input or edit mode, insert date/time at cursor position, else +create a date or time or date+time cell as follows: + - key date on time cell => current date + time of cell => date+time formatted cell - unless time cell was empty or 00:00 time => current date => date formatted cell - key date on date+time cell => current date + 00:00 time => date+time formatted cell @@ -255,138 +259,188 @@ void ScViewFunc::InsertCurrentTime(short nReqFmt, const OUString& rUndoStr) ScViewData& rViewData = GetViewData(); ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl( rViewData.GetViewShell()); -if (pInputHdl && pInputHdl->IsInputMode()) -return; // don't fiddle with the cell while editing +bool bInputMode = (pInputHdl && pInputHdl->IsInputMode()); -ScAddress aCurPos = rViewData.GetCurPos(); ScDocShell* pDocSh = rViewData.GetDocShell(); ScDocument& rDoc = pDocSh->GetDocument(); -::svl::IUndoManager* pUndoMgr = pDocSh->GetUndoManager(); -SvNumberFormatter* pFormatter = rDoc.GetFormatTable(); +ScAddress aCurPos = rViewData.GetCurPos(); const sal_uInt32 nCurNumFormat = rDoc.GetNumberFormat(aCurPos); +SvNumberFormatter* pFormatter = rDoc.GetFormatTable(); const SvNumberformat* pCurNumFormatEntry = pFormatter->GetEntry(nCurNumFormat); -const short nCurNumFormatType = (pCurNumFormatEntry ? -(pCurNumFormatEntry->GetType() & ~NUMBERFORMAT_DEFINED) : NUMBERFORMAT_UNDEFINED); -bool bForceReqFmt = false; -const double fCell = rDoc.GetValue( aCurPos); -// Combine requested date/time stamp with existing cell time/date, if any. -switch (nReqFmt) + +if (bInputMode) { -case NUMBERFORMAT_DATE: -switch (nCurNumFormatType) -{ -case NUMBERFORMAT_TIME: -// An empty cell formatted as time (or 00:00 time) shall -// not result in the current date with 00:00 time, but only -// in current date. -if (fCell != 0.0) -nReqFmt = NUMBERFORMAT_DATETIME; -break; -case NUMBERFORMAT_DATETIME: -{ -// Force to only date if the existing date+time is the -// current date. This way inserting current date twice -// on an existing date+time cell can be used to force -// date, which otherwise would only be possible by -// applying a date format. -double fDate = rtl::math::approxFloor( fCell); -if (fDate == (Date( Date::SYSTEM) - *pFormatter->GetNullDate())) -bForceReqFmt = true; -} -break; -} -break; -case NUMBERFORMAT_TIME: -switch (nCurNumFormatType) -{ -case NUMBERFORMAT_DATE: -// An empty cell formatted as date shall not result in the -// null date and current time, but only in current time. -if (fCell != 0.0) -nReqFmt = NUMBERFORMAT_DATETIME; -break; -case NUMBERFORMAT_DATETIME: -// Requesting current time
[Libreoffice-commits] core.git: 3 commits - sc/source starmath/source sw/source
sc/source/ui/docshell/impex.cxx|2 - starmath/source/cfgitem.cxx|2 - sw/source/core/access/acccontext.cxx |6 ++-- sw/source/core/crsr/crsrsh.cxx |4 +-- sw/source/core/crsr/crstrvl.cxx|4 +-- sw/source/core/crsr/unocrsr.cxx|2 - sw/source/core/doc/docdraw.cxx |2 - sw/source/core/doc/docfld.cxx |4 +-- sw/source/core/doc/docfly.cxx |2 - sw/source/core/doc/docfmt.cxx |2 - sw/source/core/doc/doclay.cxx |2 - sw/source/core/doc/docredln.cxx|4 +-- sw/source/core/doc/htmltbl.cxx |2 - sw/source/core/doc/poolfmt.cxx |8 +++--- sw/source/core/doc/tblafmt.cxx |2 - sw/source/core/docnode/ndtbl.cxx |4 +-- sw/source/core/docnode/node.cxx|2 - sw/source/core/docnode/nodes.cxx |2 - sw/source/core/docnode/section.cxx |2 - sw/source/core/docnode/swbaslnk.cxx|6 ++-- sw/source/core/fields/docufld.cxx |2 - sw/source/core/frmedt/fecopy.cxx |2 - sw/source/core/frmedt/fefly1.cxx | 10 +++ sw/source/core/frmedt/feshview.cxx |2 - sw/source/core/frmedt/fews.cxx |2 - sw/source/core/graphic/grfatr.cxx |4 +-- sw/source/core/layout/atrfrm.cxx | 38 ++--- sw/source/core/layout/ftnfrm.cxx |4 +-- sw/source/core/layout/paintfrm.cxx |4 +-- sw/source/core/layout/tabfrm.cxx |2 - sw/source/core/ole/ndole.cxx |4 +-- sw/source/core/swg/SwXMLTextBlocks.cxx |2 - sw/source/core/swg/swblocks.cxx|4 +-- sw/source/core/text/frmpaint.cxx |2 - sw/source/core/text/inftxt.cxx |2 - sw/source/core/text/itrform2.cxx |2 - sw/source/core/text/porlin.cxx |2 - sw/source/core/text/portxt.cxx |2 - sw/source/core/text/txtdrop.cxx|2 - sw/source/core/text/txttab.cxx |2 - sw/source/core/tox/tox.cxx |2 - sw/source/core/tox/txmsrt.cxx |4 +-- sw/source/core/txtnode/atrflyin.cxx|4 +-- sw/source/core/undo/untbl.cxx | 12 - sw/source/core/view/viewsh.cxx |2 - sw/source/filter/ascii/parasc.cxx |4 +-- sw/source/filter/html/htmlcss1.cxx |2 - sw/source/filter/html/htmlgrin.cxx |2 - sw/source/filter/html/htmlsect.cxx |2 - sw/source/filter/html/swhtml.cxx | 14 +-- sw/source/filter/writer/writer.cxx |6 ++-- sw/source/filter/ww8/writerhelper.cxx |4 +-- sw/source/filter/ww8/wrtw8esh.cxx |6 ++-- sw/source/filter/ww8/wrtw8nds.cxx |6 ++-- sw/source/filter/ww8/wrtw8sty.cxx |2 - sw/source/filter/ww8/wrtww8.cxx|8 +++--- sw/source/filter/ww8/wrtww8gr.cxx |2 - sw/source/filter/ww8/ww8atr.cxx|4 +-- sw/source/filter/ww8/ww8glsy.cxx |2 - sw/source/filter/ww8/ww8graf.cxx | 32 - sw/source/filter/ww8/ww8graf2.cxx |2 - sw/source/filter/ww8/ww8par.cxx| 18 +++--- sw/source/filter/ww8/ww8par2.cxx |4 +-- sw/source/filter/ww8/ww8par3.cxx |2 - sw/source/filter/ww8/ww8par5.cxx |8 +++--- sw/source/filter/ww8/ww8par6.cxx | 12 - sw/source/filter/ww8/ww8scan.cxx | 42 - sw/source/filter/xml/xmlfmt.cxx|2 - sw/source/filter/xml/xmltexte.cxx |2 - sw/source/ui/dbui/dbinsdlg.cxx |8 +++--- sw/source/ui/fmtui/tmpdlg.cxx |2 - sw/source/uibase/app/docsh.cxx |2 - sw/source/uibase/app/docshini.cxx |2 - sw/source/uibase/app/docstyle.cxx | 30 +++ sw/source/uibase/dochdl/swdtflvr.cxx |4 +-- sw/source/uibase/docvw/edtdd.cxx |2 - sw/source/uibase/docvw/edtwin.cxx |2 - sw/source/uibase/fldui/fldmgr.cxx |2 - sw/source/uibase/shells/annotsh.cxx|2 - sw/source/uibase/shells/drawsh.cxx |2 - sw/source/uibase/shells/drformsh.cxx |2 - sw/source/uibase/shells/drwbassh.cxx |2 - sw/source/uibase/shells/drwtxtex.cxx |2 - sw/source/uibase/shells/drwtxtsh.cxx |6 ++-- sw/source/uibase/shells/frmsh.cxx |2 - sw/source/uibase/shells/grfsh.cxx |4 +-- sw/source/uibase/shells/listsh.cxx |2 - sw/source/uibase/shells/tabsh.cxx |8 +++--- sw/source/uibase/shells/textidx.cxx|2 - sw/source/uibase/shells/textsh.cxx |6 ++-- sw/source/uibase/shells/textsh1.cxx|2 - sw/source/uibase/shells/textsh2.cxx|2 - sw/source/uibase/uiview/pview.cxx |2 - sw/source/uibase/uiview/view2.cxx |6 ++-- sw/source/uibase/uiview/viewcoll.cxx |2 - sw/source/uibase/uiview/viewdlg.cxx|2 - sw/source/uibase/uiview/viewling.cxx |6 ++-- sw/sou
[Libreoffice-commits] core.git: 3 commits - sc/source sw/source writerfilter/source
sc/source/core/data/documen9.cxx|3 ++- sw/source/uibase/app/docst.cxx |2 +- writerfilter/source/dmapper/StyleSheetTable.cxx | 18 +- 3 files changed, 4 insertions(+), 19 deletions(-) New commits: commit d4b96b45727314585d02394bb5a084393b647729 Author: Michael Stahl Date: Mon Aug 4 17:00:50 2014 +0200 fdo#81993: Revert "Resolves: #i119464# Update default alignment ... ... value for docx [Sub]Title" This reverts commit acc671ec74c874ffd22803bb2ee54a1f2c027155. The commit is clearly unnecessary: 1) commit 3f9e7e72c53ecbe8ee1ab060f811cb41eadfc7e1 appears to be a better fix for alignment 2) commit b95d203bc17c83ec0fe5139f519d53ed1d842d3a should have disabled the Center default in Writer already Change-Id: Ib0cc60af037f12be0a1ab94ab32c743f7fca2b1d diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index d7dc1fc..96e5686 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -1129,23 +1129,7 @@ void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable ) xState->setPropertyToDefault(rPropNameSupplier.GetName( PROP_CHAR_PROP_HEIGHT )); xState->setPropertyToDefault(rPropNameSupplier.GetName( PROP_CHAR_PROP_HEIGHT_ASIAN )); xState->setPropertyToDefault(rPropNameSupplier.GetName( PROP_CHAR_PROP_HEIGHT_COMPLEX)); -} -else if (sConvertedStyleName == "Title" || sConvertedStyleName == "Subtitle") -{ -//set the default adjust for ParaStyle Title and Subtitle to left -try -{ -uno::Reference< beans::XPropertySet > xProp( xStyle, uno::UNO_QUERY ); -if( xProp.is() ) -{ -uno::Any aMSDefaultVal = uno::makeAny( (sal_Int16)style::ParagraphAdjust_LEFT ); -xProp->setPropertyValue( rPropNameSupplier.GetName( PROP_PARA_ADJUST), aMSDefaultVal ); -} -} -catch(...) -{ -OSL_ENSURE( false, "Default ParaAdjust style property could not be set"); -} + } } commit be575f31ede7aea4b09174a131cb3b7e36dfdd4d Author: Michael Stahl Date: Mon Aug 4 15:29:53 2014 +0200 sw: ApplyStyle: remove highly suspicious conditional This contradicts the test in the next line. Change-Id: I8c762af8789cd5e116abef7be2a438fba74d669f diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index b9c27d8..cc03d2c 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -591,7 +591,7 @@ IMPL_LINK_NOARG(ApplyStyle, ApplyHdl) } // -if(m_bNew && SFX_STYLE_FAMILY_FRAME == m_nFamily) +if(m_bNew) { if(SFX_STYLE_FAMILY_FRAME == m_nFamily || SFX_STYLE_FAMILY_PARA == m_nFamily) { commit 8c2301bf7575b7afbacca6bac10f5db97c73d3d6 Author: Michael Stahl Date: Mon Aug 4 15:10:13 2014 +0200 sc: remove debugging printf Change-Id: I1b403d8ae081347d756145e52539445e067efa91 diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index a6fc287..e366955 100644 --- a/sc/source/core/data/documen9.cxx +++ b/sc/source/core/data/documen9.cxx @@ -147,6 +147,7 @@ void ScDocument::InitDrawLayer( SfxObjectShell* pDocShell ) { OSL_ENSURE(!pLocalPool->GetSecondaryPool(), "OOps, already a secondary pool set where the DrawingLayer ItemPool is to be placed (!)"); #if 0 +// FIXME apparently this is disabled because it breaks tests pLocalPool->SetSecondaryPool(&pDrawLayer->GetItemPool()); #endif } @@ -251,8 +252,8 @@ void ScDocument::DeleteDrawLayer() if(pLocalPool && pLocalPool->GetSecondaryPool()) { -fprintf(stderr, "RET is %p\n", pLocalPool->GetSecondaryPool()); #if 0 +// FIXME apparently this is disabled because it breaks tests pLocalPool->SetSecondaryPool(0); #endif } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source sw/inc sw/source
sc/source/core/data/dpgroup.cxx|2 +- sw/inc/unodraw.hxx |3 ++- sw/source/core/unocore/unodraw.cxx |3 ++- sw/source/ui/vba/vbaselection.cxx |3 ++- sw/source/ui/vba/vbaselection.hxx |3 ++- 5 files changed, 9 insertions(+), 5 deletions(-) New commits: commit 4e3e1420af51f7776dceb6b2800b761e57ddfe63 Author: Caolán McNamara Date: Wed May 28 16:19:36 2014 +0100 coverity#1078626 Missing break in switch Change-Id: I4b9b846049d9802a319b403e1f45734b7bd604f2 diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx index 6459b72..f2a68f5 100644 --- a/sc/source/core/data/dpgroup.cxx +++ b/sc/source/core/data/dpgroup.cxx @@ -283,7 +283,7 @@ bool isDateInGroup(const ScDPItemData& rGroupItem, const ScDPItemData& rChildIte if (nGroupPart == com::sun::star::sheet::DataPilotFieldGroupBy::QUARTERS) // months and quarters are both 1-based return (nGroupValue - 1 == (nChildValue - 1) / 3); - +break; case com::sun::star::sheet::DataPilotFieldGroupBy::DAYS: // a day is only contained in its quarter or month if (nGroupPart == com::sun::star::sheet::DataPilotFieldGroupBy::MONTHS || commit 1af37550cf48e270a6039eafc752d11da46415fc Author: Caolán McNamara Date: Wed May 28 16:08:34 2014 +0100 coverity#738461 Uncaught exception Change-Id: Iecc2653faae6bebd31909139392586fe66a17cb4 diff --git a/sw/source/ui/vba/vbaselection.cxx b/sw/source/ui/vba/vbaselection.cxx index ccbb4de..0360615 100644 --- a/sw/source/ui/vba/vbaselection.cxx +++ b/sw/source/ui/vba/vbaselection.cxx @@ -348,7 +348,8 @@ SwVbaSelection::Move( const uno::Any& _unit, const uno::Any& _count, const uno:: } } -void SwVbaSelection::NextCell( sal_Int32 nCount, word::E_DIRECTION eDirection ) throw ( uno::RuntimeException ) +void SwVbaSelection::NextCell(sal_Int32 nCount, word::E_DIRECTION eDirection) +throw (css::script::BasicErrorException, uno::RuntimeException) { uno::Reference< beans::XPropertySet > xCursorProps( mxTextViewCursor, uno::UNO_QUERY_THROW ); uno::Reference< text::XTextTable > xTextTable; diff --git a/sw/source/ui/vba/vbaselection.hxx b/sw/source/ui/vba/vbaselection.hxx index abe70b3..9d416a2 100644 --- a/sw/source/ui/vba/vbaselection.hxx +++ b/sw/source/ui/vba/vbaselection.hxx @@ -42,7 +42,8 @@ private: private: void Move( const css::uno::Any& _unit, const css::uno::Any& _count, const css::uno::Any& _extend, ooo::vba::word::E_DIRECTION eDirection ) throw (css::uno::RuntimeException); -void NextCell( sal_Int32 nCount, ooo::vba::word::E_DIRECTION eDirection ) throw ( css::uno::RuntimeException ); +void NextCell( sal_Int32 nCount, ooo::vba::word::E_DIRECTION eDirection ) +throw (css::script::BasicErrorException, css::uno::RuntimeException); css::uno::Reference< css::text::XTextRange > GetSelectedRange() throw ( css::uno::RuntimeException ); void GetSelectedCellRange( OUString& sTLName, OUString& sBRName ) throw ( css::uno::RuntimeException ); css::uno::Reference< css::text::XTextTable > GetXTextTable() throw ( css::uno::RuntimeException ); commit 444125a8aa7826f7357451bcd743afaf44b4cff7 Author: Caolán McNamara Date: Wed May 28 15:53:30 2014 +0100 coverity#707290 Uncaught exception Change-Id: Ia1d09b753270cca82cadf8779abec44c8a0180b1 diff --git a/sw/inc/unodraw.hxx b/sw/inc/unodraw.hxx index 0ef486d..04dceff 100644 --- a/sw/inc/unodraw.hxx +++ b/sw/inc/unodraw.hxx @@ -46,7 +46,8 @@ protected: // Create a SdrObject according to a description. Can be used by derived classes to // support own ::com::sun::star::drawing::Shapes (e.g. controls). -virtual SdrObject *_CreateSdrObject( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & xShape ) throw (std::exception) SAL_OVERRIDE; +virtual SdrObject *_CreateSdrObject( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & xShape ) +throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; public: SwFmDrawPage( SdrPage* pPage ); diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index c020b0f..7c49f44 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -291,7 +291,8 @@ uno::Reference< uno::XInterface > SwFmDrawPage::GetInterface( SdrObject* pObj return xShape; } -SdrObject* SwFmDrawPage::_CreateSdrObject( const uno::Reference< drawing::XShape > & xShape ) throw (std::exception) +SdrObject* SwFmDrawPage::_CreateSdrObject( const uno::Reference< drawing::XShape > & xShape ) +throw (uno::RuntimeException, std::exception) { //TODO: stimmt das so - kann die Methode weg? return SvxFmDrawPage::_CreateSdrObject( xShape ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org h
[Libreoffice-commits] core.git: 3 commits - sc/source sd/source sfx2/source sw/source
sc/source/filter/excel/expop2.cxx |3 --- sc/source/filter/xml/xmlwrap.cxx|2 -- sd/source/ui/docshell/docshel4.cxx | 11 --- sfx2/source/doc/objcont.cxx |4 +--- sfx2/source/doc/objstor.cxx |2 ++ sfx2/source/doc/objxtor.cxx |2 +- sw/source/core/uibase/app/docsh.cxx |1 - sw/source/filter/xml/xmlexp.cxx |4 8 files changed, 4 insertions(+), 25 deletions(-) New commits: commit 6e87f0bb75734e464bb0160dc00ab2fbe1a8fac3 Author: Matúš Kukan Date: Thu May 22 13:50:39 2014 +0200 Update also revision and editing time when setting 'modified' properties. Change-Id: Id756ef6dd62ca8df2e62265b9cc930f07d13f2e3 diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index bea59cd..7bba8d6 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -208,9 +208,7 @@ void SfxObjectShell::UpdateDocInfoForSave() now.GetHour(), now.GetDay(), now.GetMonth(), now.GetYear(), false) ); xDocProps->setModifiedBy( aUserName ); -if ( !HasName() || pImp->bIsSaving ) -// QUESTION: not in case of "real" SaveAs as this is meant to create a new document -UpdateTime_Impl( xDocProps ); +UpdateTime_Impl( xDocProps ); } } } commit fee87c6fda46923a564cd2574827a7beeffb1a1f Author: Matúš Kukan Date: Thu May 22 13:42:55 2014 +0200 Use proper constructor to fill with system time. Probably 86adb5cacb4fe3e7fb869299447da5876f0da30d did not mean to change the behaviour here. Change-Id: If39c150973c502323b3c785a9738cf65cdd74e5d diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 29fe983..b0b2347 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -209,7 +209,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) ,rDocShell( _rDocShell ) ,aMacroMode( *this ) ,pProgress( 0) -,nTime( DateTime::EMPTY ) +,nTime( DateTime::SYSTEM ) ,nVisualDocumentNumber( USHRT_MAX) ,nDocumentSignatureState( SIGNATURESTATE_UNKNOWN ) ,nScriptingSignatureState( SIGNATURESTATE_UNKNOWN ) commit 5c2ab70cc2dfb7cf0c2418433b3aa89d225742a4 Author: Matúš Kukan Date: Thu May 22 10:11:38 2014 +0200 cp#177: Set 'modified' document property more consistently. Update document info at one place, so that it works for other formats like .doc, .docx, ... too. Change-Id: If71799b491d2210f0d3bdbdb05f91f26c986a260 diff --git a/sc/source/filter/excel/expop2.cxx b/sc/source/filter/excel/expop2.cxx index 8f9ebf9..f1453e9 100644 --- a/sc/source/filter/excel/expop2.cxx +++ b/sc/source/filter/excel/expop2.cxx @@ -88,9 +88,6 @@ FltError ExportBiff5::Write() if( pDocShell && xRootStrg.Is() ) { -// #i88642# update doc info (revision etc) -pDocShell->UpdateDocInfoForSave(); - using namespace ::com::sun::star; uno::Reference xDPS( pDocShell->GetModel(), uno::UNO_QUERY_THROW); diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index 640890b..a9e8dd9 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -788,8 +788,6 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly) if ( pObjSh && xStorage.is() ) { -pObjSh->UpdateDocInfoForSave(); // update information - uno::Reference xModel(pObjSh->GetModel()); uno::Reference xStatusIndicator(GetStatusIndicator()); sal_Int32 nProgressRange(100); diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index b61aa45..654d6a8 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -506,12 +506,7 @@ bool DrawDocShell::Save() bool bRet = SfxObjectShell::Save(); if( bRet ) -{ -// Call UpdateDocInfoForSave() before export -UpdateDocInfoForSave(); - bRet = SdXMLFilter( *GetMedium(), *this, true, SDXMLMODE_Normal, SotStorage::GetVersion( GetMedium()->GetStorage() ) ).Export(); -} return bRet; } @@ -545,11 +540,7 @@ bool DrawDocShell::SaveAs( SfxMedium& rMedium ) boolbRet = SfxObjectShell::SaveAs( rMedium ); if( bRet ) -{ -// Call UpdateDocInfoForSave() before export -UpdateDocInfoForSave(); bRet = SdXMLFilter( rMedium, *this, true, SDXMLMODE_Normal, SotStorage::GetVersion( rMedium.GetStorage() ) ).Export(); -} if( GetError() == ERRCODE_NONE ) SetError( nVBWarning, OSL_LOG_PREFIX ); @@ -587,13 +578,11 @@ bool DrawDocShell::ConvertTo( SfxMedium& rMedium ) aTypeName.indexOf( "impress8" ) >= 0 ) { pFilter = new SdXMLFilter( rMedium, *this, true ); -UpdateDocInfoForSave(); } else if( aTypeName.indexOf( "StarOffice_XML_Impress"
[Libreoffice-commits] core.git: 3 commits - sc/source sfx2/source
sc/source/ui/drawfunc/fuins2.cxx | 546 +++ sfx2/source/doc/objmisc.cxx | 29 +- 2 files changed, 291 insertions(+), 284 deletions(-) New commits: commit ee5cae3da45dec3c17bbff849cbbfd5363984bd0 Author: Kohei Yoshida Date: Mon May 12 17:19:17 2014 -0400 Let's not forget to free the SdrOle2Obj instance here. When the chart creation wizard is cancelled. Change-Id: I5eb2b2719ce3ec1eaa180a8c7193df23794dc03d diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index ddc961b..9c7b192 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -746,7 +746,12 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* OSL_ASSERT( pPage ); OSL_ASSERT( pObj ); if( pPage ) -pPage->RemoveObject( pObj->GetOrdNum()); +{ +// Remove the OLE2 object from the sdr page. +SdrObject* pRemoved = pPage->RemoveObject(pObj->GetOrdNum()); +OSL_ASSERT(pRemoved == pObj); +SdrObject::Free(pRemoved); // Don't forget to free it. +} bAddUndo = false; // don't create the undo action for inserting commit 13c9628c2641a44267e6681995b3261e4ac6d809 Author: Kohei Yoshida Date: Mon May 12 17:16:30 2014 -0400 Bail out early if it's not a chart module. Change-Id: I2e487b79671153786f02f12b4aac2b32476585e4 diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index 1505b28..ddc961b 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -439,346 +439,345 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* if( ! rReq.IsAPI() ) rReq.Done(); -if( SvtModuleOptions().IsChart() ) -{ +if (!SvtModuleOptions().IsChart()) +return; -// BM/IHA -- +// BM/IHA -- -// get range -OUString aRangeString; -ScRange aPositionRange; // cell range for chart positioning -ScMarkData aMark = pViewSh->GetViewData()->GetMarkData(); -if( pReqArgs ) -{ -const SfxPoolItem* pItem; -if( pReqArgs->HasItem( FN_PARAM_5, &pItem ) ) -aRangeString = OUString( ((const SfxStringItem*)pItem)->GetValue()); +// get range +OUString aRangeString; +ScRange aPositionRange; // cell range for chart positioning +ScMarkData aMark = pViewSh->GetViewData()->GetMarkData(); +if( pReqArgs ) +{ +const SfxPoolItem* pItem; +if( pReqArgs->HasItem( FN_PARAM_5, &pItem ) ) +aRangeString = OUString( ((const SfxStringItem*)pItem)->GetValue()); -aPositionRange = pViewSh->GetViewData()->GetCurPos(); +aPositionRange = pViewSh->GetViewData()->GetCurPos(); +} +else +{ +bool bAutomaticMark = false; +if ( !aMark.IsMarked() && !aMark.IsMultiMarked() ) +{ +pViewSh->GetViewData()->GetView()->MarkDataArea( true ); +bAutomaticMark = true; } -else + +ScMarkData aMultiMark( aMark ); +aMultiMark.MarkToMulti(); + +ScRangeList aRanges; +aMultiMark.FillRangeListWithMarks( &aRanges, false ); +OUString aStr; +ScDocument* pDocument = pViewSh->GetViewData()->GetDocument(); +aRanges.Format( aStr, SCR_ABS_3D, pDocument, pDocument->GetAddressConvention() ); +aRangeString = aStr; + +// get "total" range for positioning +if ( !aRanges.empty() ) { -bool bAutomaticMark = false; -if ( !aMark.IsMarked() && !aMark.IsMultiMarked() ) +aPositionRange = *aRanges[ 0 ]; +for ( size_t i = 1, nCount = aRanges.size(); i < nCount; ++i ) { -pViewSh->GetViewData()->GetView()->MarkDataArea( true ); -bAutomaticMark = true; +aPositionRange.ExtendTo( *aRanges[ i ] ); } +} -ScMarkData aMultiMark( aMark ); -aMultiMark.MarkToMulti(); +if(bAutomaticMark) +pViewSh->GetViewData()->GetView()->Unmark(); +} -ScRangeList aRanges; -aMultiMark.FillRangeListWithMarks( &aRanges, false ); -OUString aStr; -ScDocument* pDocument = pViewSh->GetViewData()->GetDocument(); -aRanges.Format( aStr, SCR_ABS_3D, pDocument, pDocument->GetAddressConvention() ); -aRangeString = aStr; -// get "total" range for positioning -if ( !aRanges.empty() ) -{ -aPositionRange = *aRanges[ 0 ]; -for ( size_t i = 1, nCount = aRanges.si
[Libreoffice-commits] core.git: 3 commits - sc/source sw/source
sc/source/filter/excel/xeescher.cxx |1 sw/source/filter/ww8/wrtww8.cxx | 20 ++-- sw/source/filter/ww8/ww8par.cxx | 164 +--- 3 files changed, 114 insertions(+), 71 deletions(-) New commits: commit 9cce3ad91f9bcd784e570561ce4bf2155e06cbbc Author: Caolán McNamara Date: Sun May 11 17:23:21 2014 +0100 coverity#1130479 Uninitialized pointer field Change-Id: I2c8b640b29cd716b11c064efb93351d83f81c725 diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 1fc1105..b5ccf1b 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3538,13 +3538,19 @@ MSWordExportBase::~MSWordExportBase() WW8Export::WW8Export( SwWW8Writer *pWriter, SwDoc *pDocument, SwPaM *pCurrentPam, SwPaM *pOriginalPam, bool bIsWW8, bool bDot ) -: MSWordExportBase( pDocument, pCurrentPam, pOriginalPam ), - pO( NULL ), - pSepx( NULL ), - bWrtWW8( bIsWW8 ), - m_bDot(bDot), - m_pWriter( pWriter ), - m_pAttrOutput( new WW8AttributeOutput( *this ) ) +: MSWordExportBase( pDocument, pCurrentPam, pOriginalPam ) +, pO(NULL) +, pTableStrm(NULL) +, pDataStrm(NULL) +, pFib(NULL) +, pDop(NULL) +, pFtn(NULL) +, pEdn(NULL) +, pSepx(NULL) +, bWrtWW8(bIsWW8) +, m_bDot(bDot) +, m_pWriter(pWriter) +, m_pAttrOutput(new WW8AttributeOutput(*this)) { } commit 6d02764e3badf2dcedc5de4dc7ced7e2f4d8f35b Author: Caolán McNamara Date: Sun May 11 17:20:23 2014 +0100 coverity#708031 Uninitialized scalar field Change-Id: I1b70f7f84c0e357a1d5d1733c036fd4becf26fdf diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index c4c1abf..d91e15d 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -599,6 +599,7 @@ void XclExpOcxControlObj::WriteSubRecs( XclExpStream& rStrm ) XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference< XShape > xShape , const Rectangle* pChildAnchor ) : XclObj( rRoot, EXC_OBJTYPE_UNKNOWN, true ), XclMacroHelper( rRoot ), +meEventType( EXC_TBX_EVENT_ACTION ), mnHeight( 0 ), mnState( 0 ), mnLineCount( 0 ), commit 3c4230122311d661e789667fbcd0b93de31b1709 Author: Caolán McNamara Date: Sun May 11 17:14:50 2014 +0100 coverity#1130478 Uninitialized pointer field Change-Id: Icbfa6cdf299c0dc28583be16cf1ac73445ee4aaa diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 7e60a8f..41bfc4f 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4100,20 +4100,120 @@ SwWW8ImplReader::SwWW8ImplReader(sal_uInt8 nVersionPara, SvStorage* pStorage, , pTableStream(0) , pDataStream(0) , rDoc(rD) +, pPaM(0) +, pCtrlStck(0) +, mpRedlineStack(0) +, pReffedStck(0) +, pReffingStck(0) +, pAnchorStck(0) , maSectionManager(*this) , m_aExtraneousParas(rD) , maInsertedTables(rD) , maSectionNameGenerator(rD, OUString("WW")) +, mpSprmParser(NULL) , maGrfNameGenerator(bNewDoc, OUString('G')) , maParaStyleMapper(rD) , maCharStyleMapper(rD) +, mpChosenOutlineNumRule(0) +, pFormImpl(0) +, pFlyFmtOfJustInsertedGraphic(0) +, pFmtOfJustInsertedApo(0) +, pPreviousNumPaM(0) +, pPrevNumRule(0) +, mpPostProcessAttrsInfo(0) +, pWwFib(0) +, pFonts(0) +, pWDop(0) +, pLstManager(0) +, pSBase(0) +, pPlcxMan(0) , maTxtNodesHavingFirstLineOfstSet() , maTxtNodesHavingLeftIndentSet() +, pStyles(0) +, pAktColl(0) +, pAktItemSet(0) +, pDfltTxtFmtColl(0) +, pStandardFmtColl(0) +, pHdFt(0) +, pWFlyPara(0) +, pSFlyPara(0) +, pTableDesc(0) +, pNumOlst(0) +, pNode_FLY_AT_PARA(0) +, pDrawModel(0) +, pDrawPg(0) +, mpDrawEditEngine(0) +, pWWZOrder(0) +, pNumFldType(0) , pMSDffManager(0) , mpAtnNames(0) , sBaseURL(rBaseURL) +, nIniFlags(0) +, nIniFlags1(0) +, nFieldFlags(0) , m_bRegardHindiDigits( false ) +, nDrawCpO(0) +, nPicLocFc(0) +, nObjLocFc(0) +, nIniFlyDx(0) +, nIniFlyDy(0) +, eTextCharSet(RTL_TEXTENCODING_ASCII_US) +, eStructCharSet(RTL_TEXTENCODING_ASCII_US) +, eHardCharSet(RTL_TEXTENCODING_DONTKNOW) +, nProgress(0) +, nAktColl(0) +, nFldNum(0) +, nLFOPosition(USHRT_MAX) +, nCharFmt(0) +, nDrawXOfs(0) +, nDrawYOfs(0) +, nDrawXOfs2(0) +, nDrawYOfs2(0) +, cSymbol(0) +, nWantedVersion(nVersionPara) +, nSwNumLevel(0xff) +, nWwNumType(0xff) +, nListLevel(WW8ListManager::nMaxLevel) +, nPgChpDelim(0) +, nPgChpLevel(0) , mbNewDoc(bNewDoc) +, bReadNoTbl(false) +, bPgSecBreak(false) +, bSpec(false) +, bObj(false) +, bTxbxFlySection(false) +, bHasBorder(false) +, bSymbol(false) +, bIgnoreText(false
[Libreoffice-commits] core.git: 3 commits - sc/source sc/uiconfig vcl/source
sc/source/ui/dbgui/PivotLayoutDialog.cxx| 117 +--- sc/source/ui/dbgui/PivotLayoutTreeList.cxx | 41 +--- sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx | 18 --- sc/source/ui/dbgui/PivotLayoutTreeListData.cxx | 28 + sc/source/ui/dbgui/PivotLayoutTreeListLabel.cxx |2 sc/source/ui/inc/PivotLayoutDialog.hxx |5 - sc/source/ui/inc/PivotLayoutTreeListData.hxx|2 sc/source/ui/inc/PivotLayoutTreeListLabel.hxx |2 sc/uiconfig/scalc/ui/datafieldoptionsdialog.ui |6 - vcl/source/window/window2.cxx |7 + 10 files changed, 160 insertions(+), 68 deletions(-) New commits: commit 8302e1221ec4b023db319f5048195e45369b9848 Author: Tomaž Vajngerl Date: Thu Apr 3 11:35:20 2014 +0200 pivot: In "Data Field Options" dialog change Add -> Ok Change-Id: Ie6b1670445fd15e2ba791b13e4b6cd6803b2b9df diff --git a/sc/uiconfig/scalc/ui/datafieldoptionsdialog.ui b/sc/uiconfig/scalc/ui/datafieldoptionsdialog.ui index e71439a..9f532a2 100644 --- a/sc/uiconfig/scalc/ui/datafieldoptionsdialog.ui +++ b/sc/uiconfig/scalc/ui/datafieldoptionsdialog.ui @@ -25,8 +25,8 @@ False end - -gtk-add + +gtk-ok True True True @@ -552,7 +552,7 @@ - add + ok close help commit 19d71217aba8700dac913c278767d6e387ce65a1 Author: Tomaž Vajngerl Date: Thu Apr 3 11:33:04 2014 +0200 pivot: Apply changes made in "Data Field" and "Data Field Options" Change-Id: If8560d47c5b4e64367c441237c1e38f964cf6825 diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx index 48b4874..4acc758 100644 --- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx +++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx @@ -16,8 +16,12 @@ #include "rangeutl.hxx" #include "uiitems.hxx" +#include "dputil.hxx" + +#include #include +#include using namespace css::uno; using namespace css::sheet; @@ -156,6 +160,7 @@ ScPivotLayoutDialog::ScPivotLayoutDialog( FillValuesToListBoxes(); +// Initialize Options const ScDPSaveData* pSaveData = maPivotTableObject.GetSaveData(); if (pSaveData == NULL) { @@ -446,65 +451,108 @@ void ScPivotLayoutDialog::UpdateSourceRange() bool ScPivotLayoutDialog::ApplyChanges() { ScDPSaveData aSaveData; -aSaveData.SetIgnoreEmptyRows(mpCheckIgnoreEmptyRows->IsChecked()); -aSaveData.SetRepeatIfEmpty(mpCheckIdentifyCategories->IsChecked()); -aSaveData.SetColumnGrand(mpCheckTotalColumns->IsChecked()); -aSaveData.SetRowGrand(mpCheckTotalRows->IsChecked()); -aSaveData.SetFilterButton(mpCheckAddFilter->IsChecked()); -aSaveData.SetDrillDown(mpCheckDrillToDetail->IsChecked()); +ApplySaveData(aSaveData); +ApplyLabelData(aSaveData); + +ScRange aDestinationRange; +bool bToNewSheet = false; + +if (!GetDestination(aDestinationRange, bToNewSheet)) +return false; + +SetDispatcherLock(false); +SwitchToDocument(); + +sal_uInt16 nWhichPivot = SC_MOD()->GetPool().GetWhich(SID_PIVOT_TABLE); +ScPivotItem aPivotItem(nWhichPivot, &aSaveData, &aDestinationRange, bToNewSheet); +mpViewData->GetViewShell()->SetDialogDPObject(&maPivotTableObject); + +SfxDispatcher* pDispatcher = GetBindings().GetDispatcher(); +SfxCallMode nCallMode = SFX_CALLMODE_SLOT | SFX_CALLMODE_RECORD; +const SfxPoolItem* pResult = pDispatcher->Execute(SID_PIVOT_TABLE, nCallMode, &aPivotItem, NULL, 0); + +if (pResult != NULL) +{ +const SfxBoolItem* pItem = reinterpret_cast(pResult); +if (pItem) +{ +return pItem->GetValue(); +} +} + +SetDispatcherLock(true); +return true; +} + +void ScPivotLayoutDialog::ApplySaveData(ScDPSaveData& rSaveData) +{ +rSaveData.SetIgnoreEmptyRows(mpCheckIgnoreEmptyRows->IsChecked()); +rSaveData.SetRepeatIfEmpty(mpCheckIdentifyCategories->IsChecked()); +rSaveData.SetColumnGrand(mpCheckTotalColumns->IsChecked()); +rSaveData.SetRowGrand(mpCheckTotalRows->IsChecked()); +rSaveData.SetFilterButton(mpCheckAddFilter->IsChecked()); +rSaveData.SetDrillDown(mpCheckDrillToDetail->IsChecked()); Reference xSource = maPivotTableObject.GetSource(); ScPivotFieldVector aPageFieldVector; mpListBoxPage->PushEntriesToPivotFieldVector(aPageFieldVector); -ScDPObject::ConvertOrientation(aSaveData, aPageFieldVector, DataPilotFieldOrientation_PAGE, +ScDPObject::ConvertOrientation(rSaveData, aPageFieldVector, DataPilotFieldOrientation_PAGE, xSource, maPivotParameters.maLabelArray); ScPivotFieldVector aColFieldVector; mpListBoxColumn->PushEntriesToPivotFieldVector(aColFieldVector); -ScDPObject::ConvertOrientation(aSaveData, aColFieldVector, DataPilotFieldOrientatio
[Libreoffice-commits] core.git: 3 commits - sc/source svtools/source
sc/source/filter/oox/drawingmanager.cxx | 14 +++--- sc/source/ui/view/tabvwsh4.cxx |3 - svtools/source/svhtml/parhtml.cxx | 68 ++-- 3 files changed, 38 insertions(+), 47 deletions(-) New commits: commit 9a0e6204bba686945a1ab249b741d703ed3e84a6 Author: Caolán McNamara Date: Tue Apr 1 13:38:37 2014 +0100 coverity#735505 Logically dead code Change-Id: I7e7abf9192ee34c9f1c2080268751503aae90e55 diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx index f54c741..93e8c2d 100644 --- a/svtools/source/svhtml/parhtml.cxx +++ b/svtools/source/svhtml/parhtml.cxx @@ -562,59 +562,51 @@ int HTMLParser::ScanText( const sal_Unicode cBreak ) break; } +assert(cChar != 0); + // 1 == Non Breaking Space // 2 == SoftHyphen -if( cChar < 3U ) +if (cChar == 1 || cChar == 2) { if( '>' == cBreak ) { // When reading the content of a tag we have // to change it to ' ' or '-' -switch( cChar ) -{ -case 1U: cChar = ' '; break; -case 2U: cChar = '-'; break; -default: -DBG_ASSERT( cChar==1U, -"\0x00 should be handled already!" ); -break; -} +if( 1U == cChar ) +cChar = ' '; +else //2U +cChar = '-'; } else { // If not scanning a tag return token aToken += sTmpBuffer.makeStringAndClear(); -if( cChar ) + +if( !aToken.isEmpty() ) { -if( !aToken.isEmpty() ) -{ -// restart with character -nNextCh = '&'; -DBG_ASSERT( rInput.Tell()-nStreamPos == - (sal_uLong)(nPos+1)*GetCharSize(), -"Wrong stream position" ); -DBG_ASSERT( nlLinePos-nLinePos == -(sal_uLong)(nPos+1), -"Wrong line position" ); -rInput.Seek( nStreamPos ); -nlLinePos = nLinePos; -ClearTxtConvContext(); -return HTML_TEXTTOKEN; -} - -// Hack: _GetNextChar shall not read the -// next character -if( ';' != nNextCh ) -aToken += " "; -if( 1U == cChar ) -return HTML_NONBREAKSPACE; -if( 2U == cChar ) -return HTML_SOFTHYPH; +// restart with character +nNextCh = '&'; +DBG_ASSERT( rInput.Tell()-nStreamPos == + (sal_uLong)(nPos+1)*GetCharSize(), +"Wrong stream position" ); +DBG_ASSERT( nlLinePos-nLinePos == +(sal_uLong)(nPos+1), +"Wrong line position" ); +rInput.Seek( nStreamPos ); +nlLinePos = nLinePos; +ClearTxtConvContext(); +return HTML_TEXTTOKEN; } -aToken += "&"; -aToken += sEntityBuffer.makeStringAndClear(); -break; + +// Hack: _GetNextChar shall not read the +// next character +if( ';' != nNe
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/filter/excel/excimp8.cxx | 74 ++- sc/source/filter/excel/read.cxx |3 - sc/source/filter/excel/xicontent.cxx | 37 +++-- sc/source/filter/inc/excimp8.hxx |3 - sc/source/filter/inc/xicontent.hxx | 24 +++ sc/source/filter/inc/xlconst.hxx |6 ++ 6 files changed, 131 insertions(+), 16 deletions(-) New commits: commit 35494ca3b3b5ec69322a0ecc29b676c89766f608 Author: Eike Rathke Date: Tue Mar 18 23:36:39 2014 +0100 MS-XLS documentation uses big-endian bit diagrams ... so if it says leftmost bit 0 then test for high bit. Change-Id: I260ff09fff66918da887742b5d177715e59548c2 diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index 84174b1..c5008ef 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -367,7 +367,7 @@ void ImportExcel8::Feat( void ) aProt.mnAreserved = aIn.ReaduInt32(); aProt.mnPasswordVerifier = aIn.ReaduInt32(); aProt.maTitle = aIn.ReadUniString(); -if ((aProt.mnAreserved & 1) == 1) +if ((aProt.mnAreserved & 0x8000) == 0x8000) { sal_uInt32 nCbSD = aIn.ReaduInt32(); // TODO: could here be some sanity check applied to not allocate 4GB? commit 2864bcdf49e916bd532c7ba0c4e678df9dc52e8f Author: Eike Rathke Date: Tue Mar 18 23:06:39 2014 +0100 start reading 0x0868 FEAT enhanced protection feature Change-Id: Id38a7629ea5ed4bbb1a7d696926335ce0bdec6a6 diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index e806999..84174b1 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -187,6 +187,22 @@ public: } }; + +namespace { + +/** Future Record Type header. +@return whether read rt matches nRecordID + */ +bool readFrtHeader( XclImpStream& rStrm, sal_uInt16 nRecordID ) +{ +sal_uInt16 nRt = rStrm.ReaduInt16(); +rStrm.Ignore(10); // grbitFrt (2 bytes) and reserved (8 bytes) +return nRt == nRecordID; +} + +} + + ImportExcel8::ImportExcel8( XclImpRootData& rImpData, SvStream& rStrm ) : ImportExcel( rImpData, rStrm ) { @@ -304,12 +320,12 @@ void ImportExcel8::Labelsst( void ) void ImportExcel8::FeatHdr( void ) { -aIn.Ignore(12); +if (!readFrtHeader( aIn, 0x0867)) +return; // Feature type (isf) can be EXC_ISFPROTECTION, EXC_ISFFEC2 or // EXC_ISFFACTOID. -sal_uInt16 nFeatureType(0); -aIn >> nFeatureType; +sal_uInt16 nFeatureType = aIn.ReaduInt16(); if (nFeatureType != EXC_ISFPROTECTION) // We currently only support import of enhanced protection data. return; @@ -319,6 +335,50 @@ void ImportExcel8::FeatHdr( void ) GetSheetProtectBuffer().ReadOptions( aIn, GetCurrScTab() ); } + +void ImportExcel8::Feat( void ) +{ +if (!readFrtHeader( aIn, 0x0868)) +return; + +// Feature type (isf) can be EXC_ISFPROTECTION, EXC_ISFFEC2 or +// EXC_ISFFACTOID. +sal_uInt16 nFeatureType = aIn.ReaduInt16(); +if (nFeatureType != EXC_ISFPROTECTION) +// We currently only support import of enhanced protection data. +return; + +aIn.Ignore(5); // reserved1 (1 byte) and reserved2 (4 bytes) + +sal_uInt16 nCref = aIn.ReaduInt16();// number of ref elements +aIn.Ignore(4); // size if EXC_ISFFEC2, else 0 and to be ignored +aIn.Ignore(2); // reserved3 (2 bytes) + +XclEnhancedProtection aProt; +aProt.maRefs.reserve( nCref); +XclRef8U aRef; +for (sal_uInt16 i=0; i < nCref && aIn.IsValid(); ++i) +{ +aProt.maRefs.push_back( aRef.read( aIn)); +} + +// FeatProtection structure follows in record. + +aProt.mnAreserved = aIn.ReaduInt32(); +aProt.mnPasswordVerifier = aIn.ReaduInt32(); +aProt.maTitle = aIn.ReadUniString(); +if ((aProt.mnAreserved & 1) == 1) +{ +sal_uInt32 nCbSD = aIn.ReaduInt32(); +// TODO: could here be some sanity check applied to not allocate 4GB? +aProt.maSecurityDescriptor.reserve( nCbSD); +aIn.Read( &aProt.maSecurityDescriptor.front(), nCbSD); +} + +GetSheetProtectBuffer().AppendEnhancedProtection( aProt, GetCurrScTab() ); +} + + void ImportExcel8::ReadBasic( void ) { SfxObjectShell* pShell = GetDocShell(); diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx index d3a1e28..16cb97b 100644 --- a/sc/source/filter/excel/read.cxx +++ b/sc/source/filter/excel/read.cxx @@ -1143,6 +1143,7 @@ FltError ImportExcel8::Read( void ) case EXC_ID3_ARRAY: Array34(); break; // ARRAY [ 34] case 0x0225: Defrowheight345();break;//DEFAULTROWHEI[ 345 ] case 0x0867: FeatHdr(); break; // FEATHDR +case 0x0868: Feat(); break; // FEAT
[Libreoffice-commits] core.git: 3 commits - sc/source sw/qa writerfilter/source
sc/source/filter/excel/xestream.cxx |2 +- sc/source/filter/qpro/qpro.cxx |2 +- sw/qa/extras/ooxmlimport/data/large-twips.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx |8 writerfilter/source/dmapper/ConversionHelper.cxx |7 +-- 5 files changed, 15 insertions(+), 4 deletions(-) New commits: commit ff768da1117d63f7c6e8513ab76927e5cc7ec9a6 Author: LuboÅ¡ LuÅák Date: Wed Mar 12 13:46:26 2014 +0100 test for ignoring large twips values (cp#143) Change-Id: I366539b83c7a93a81fd72f3f2355b09c59f7ae58 diff --git a/sw/qa/extras/ooxmlimport/data/large-twips.docx b/sw/qa/extras/ooxmlimport/data/large-twips.docx new file mode 100644 index 000..6e9d82d Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/large-twips.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index e67796e..bff4e1e 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1963,6 +1963,14 @@ DECLARE_OOXMLIMPORT_TEST(testI124106, "i124106.docx") CPPUNIT_ASSERT_EQUAL(1, getPages()); } +DECLARE_OOXMLIMPORT_TEST(testLargeTwips, "large-twips.docx" ) +{ +// cp#143: MSO seems to ignore large twips values, we didn't, which resulted in different +// layout of broken documents (text not visible in this specific document). +OUString width = parseDump( "/root/page/body/tab/row[1]/cell[1]/txt/infos/bounds", "width" ); +CPPUNIT_ASSERT( width.toInt32() > 0 ); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); commit 10b4da63e3143108ba75891e9e98fdaa2f7953ab Author: LuboÅ¡ LuÅák Date: Wed Mar 12 13:45:36 2014 +0100 ignore large twips values like MSO does (cp#143) Change-Id: Ib304245b6ae64c15cfb6c999580f73e5e228c440 diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx index 7f5e760..cba58b7 100644 --- a/writerfilter/source/dmapper/ConversionHelper.cxx +++ b/writerfilter/source/dmapper/ConversionHelper.cxx @@ -36,8 +36,6 @@ namespace writerfilter { namespace dmapper{ namespace ConversionHelper{ -#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L)) - sal_Int32 MakeBorderLine( sal_Int32 nSprmValue, table::BorderLine2& rToFill ) { //TODO: Lines are always solid @@ -231,6 +229,11 @@ OUString ConvertMSFormatStringToSO( sal_Int32 convertTwipToMM100(sal_Int32 _t) { +// It appears that MSO handles large twip values specially, probably legacy 16bit handling, +// anything that's bigger than 32767 appears to be simply ignored. +if( _t >= 0x8000 ) +return 0; +#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L)) return TWIP_TO_MM100( _t ); } commit da9bd301c6f62e829daadb2af6a6b9633d4f1cb9 Author: LuboÅ¡ LuÅák Date: Wed Mar 12 13:44:29 2014 +0100 std::strlen requires cstring include to build Or, even simpler, don't bother with the needless namespacing. Change-Id: I4bbb115c1c2c89881a0bf88ccd54b0f5cb8b3518 diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index 6c3aa3b..289fc62 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -988,7 +988,7 @@ sax_fastparser::FSHelperPtr& XclExpXmlStream::WriteAttributesInternal( sal_Int32 rStream->write( " " ) ->writeId( nAttribute ) ->write( "=\"" ) -->writeEscaped( OUString(pValue, std::strlen(pValue), RTL_TEXTENCODING_UTF8) ) +->writeEscaped( OUString(pValue, strlen(pValue), RTL_TEXTENCODING_UTF8) ) ->write( "\"" ); } diff --git a/sc/source/filter/qpro/qpro.cxx b/sc/source/filter/qpro/qpro.cxx index 5767634..2e24dff 100644 --- a/sc/source/filter/qpro/qpro.cxx +++ b/sc/source/filter/qpro/qpro.cxx @@ -226,7 +226,7 @@ void ScQProReader::readString( OUString &rString, sal_uInt16 nLength ) sal_Char* pText = new sal_Char[ nLength + 1 ]; nLength = mpStream->Read(pText, nLength); pText[ nLength ] = 0; -rString = OUString( pText, std::strlen(pText), mpStream->GetStreamCharSet() ); +rString = OUString( pText, strlen(pText), mpStream->GetStreamCharSet() ); delete [] pText; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/core/data/table1.cxx | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) New commits: commit c782212abf4114b6dd366c38a44574be21c81eb1 Author: Eike Rathke Date: Mon Feb 10 20:52:07 2014 +0100 use GetLastDataRow() also in ShrinkToUsedDataArea() Change-Id: Ie9d729900d6096dc8f540b3bc52df749b15675e2 diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 1ba2c2c..45180cf 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -966,13 +966,10 @@ bool ScTable::ShrinkToUsedDataArea( bool& o_bShrunk, SCCOL& rStartCol, SCROW& rS if (rStartRow < rEndRow) { -bool bFound = false; -for (SCCOL i=rStartCol; i<=rEndCol && !bFound; i++) -if (aCol[i].HasDataAt( rEndRow)) -bFound = true; -if (!bFound) +SCROW nLastDataRow = GetLastDataRow( rStartCol, rEndCol, rEndRow); +if (0 <= nLastDataRow && nLastDataRow < rEndRow) { ---rEndRow; +rEndRow = std::max( rStartRow, nLastDataRow); bChanged = true; } } commit c32e93e561d234e289ce14b88a73368d7862ee47 Author: Eike Rathke Date: Mon Feb 10 20:00:52 2014 +0100 actually the extra check isn't needed The end row will be the maximum of the start row and the last data row up to the original end row. Change-Id: I906a5f44f31f333c814b6832767dc3bd0ecd8278 diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 8e6f276..1ba2c2c 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -899,8 +899,8 @@ void ScTable::GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, S if ( !bBottom && rEndRow > 0 && rStartRow < rEndRow ) { SCROW nLastDataRow = GetLastDataRow( rStartCol, rEndCol, rEndRow); -if (nLastDataRow >= 0 && rStartRow <= nLastDataRow && nLastDataRow < rEndRow) -rEndRow = nLastDataRow; +if (nLastDataRow < rEndRow) +rEndRow = std::max( rStartRow, nLastDataRow); } } } commit 840accea91da58a4532ff7cf7f5b1eaa501f0b6d Author: Eike Rathke Date: Mon Feb 10 19:45:16 2014 +0100 cosmetical adapt to style Change-Id: I210f74670631707b02b68150efac76b0985390ac diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 22da0ae..8e6f276 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -882,15 +882,15 @@ void ScTable::GetDataArea( SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, S if ( !bTop && rStartRow < MAXROW && rStartRow < rEndRow ) { -bool shrink = true; +bool bShrink = true; do { -for ( SCCOL i = rStartCol; i<=rEndCol && shrink; i++) +for ( SCCOL i = rStartCol; i<=rEndCol && bShrink; i++) if (aCol[i].HasDataAt(rStartRow)) -shrink = false; -if (shrink) +bShrink = false; +if (bShrink) ++rStartRow; -}while( shrink && rStartRow < MAXROW && rStartRow < rEndRow); +} while (bShrink && rStartRow < MAXROW && rStartRow < rEndRow); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/ui/view/tabvwshe.cxx | 46 +++-- 1 file changed, 26 insertions(+), 20 deletions(-) New commits: commit 71b491fd71f5ad1aa61f917992462009a6d1bb6b Author: Eike Rathke Date: Fri Dec 13 20:00:49 2013 +0100 const as const can Change-Id: I0610bdee35fb7a36a183a5617115f3277af8e6a8 diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx index 39ae828..5f08498 100644 --- a/sc/source/ui/view/tabvwshe.cxx +++ b/sc/source/ui/view/tabvwshe.cxx @@ -237,7 +237,7 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq ) ScGlobal::SetSearchItem( *pSearchItem ); sal_Bool bSuccess = SearchAndReplace( pSearchItem, sal_True, rReq.IsAPI() ); -SfxChildWindow* pChildWindow = SfxViewFrame::Current()->GetChildWindow( +const SfxChildWindow* pChildWindow = SfxViewFrame::Current()->GetChildWindow( SvxSearchDialogWrapper::GetChildWindowId()); if (pChildWindow) { @@ -307,7 +307,7 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq ) rReq.IsAPI() ? SFX_CALLMODE_API|SFX_CALLMODE_SYNCHRON : SFX_CALLMODE_STANDARD, &aSearchItem, 0L ); -SfxChildWindow* pChildWindow = SfxViewFrame::Current()->GetChildWindow( +const SfxChildWindow* pChildWindow = SfxViewFrame::Current()->GetChildWindow( SvxSearchDialogWrapper::GetChildWindowId()); if (pChildWindow) { commit 6c91431eef31e35e7beb3c1272221d04d60ec2a2 Author: Eike Rathke Date: Fri Dec 13 19:56:38 2013 +0100 maybe better guard against a NULL child window also here Change-Id: Iad65806894df2454e4341a49f473c308d47660eb diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx index 58e1159..39ae828 100644 --- a/sc/source/ui/view/tabvwshe.cxx +++ b/sc/source/ui/view/tabvwshe.cxx @@ -307,19 +307,22 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq ) rReq.IsAPI() ? SFX_CALLMODE_API|SFX_CALLMODE_SYNCHRON : SFX_CALLMODE_STANDARD, &aSearchItem, 0L ); -SvxSearchDialog* pSearchDlg = - ((SvxSearchDialog*)(SfxViewFrame::Current()->GetChildWindow( - SvxSearchDialogWrapper::GetChildWindowId())->GetWindow())); -if( pSearchDlg ) +SfxChildWindow* pChildWindow = SfxViewFrame::Current()->GetChildWindow( +SvxSearchDialogWrapper::GetChildWindowId()); +if (pChildWindow) { -ScTabView* pTabView = GetViewData()->GetView(); -if( pTabView ) +SvxSearchDialog* pSearchDlg = (SvxSearchDialog*)(pChildWindow->GetWindow()); +if( pSearchDlg ) { -Window* pWin = pTabView->GetActiveWin(); -if( pWin ) +ScTabView* pTabView = GetViewData()->GetView(); +if( pTabView ) { -pSearchDlg->SetDocWin( pWin ); -pSearchDlg->SetSrchFlag(); +Window* pWin = pTabView->GetActiveWin(); +if( pWin ) +{ +pSearchDlg->SetDocWin( pWin ); +pSearchDlg->SetSrchFlag(); +} } } } commit a0fb8a2eb12406b980537ca0190c6ddc33372947 Author: Eike Rathke Date: Fri Dec 13 19:47:59 2013 +0100 fixed crash when searching via Find Text bar Introduced with b41332475783c31136673fb44cf4c411bb0148f8 Integrate branch of IAccessible2 Find Text bar is not the search dialog, so there is no child window unless the Find & Replace dialog is also open. Change-Id: Ice230cb2c05534c754fefc55bb8d8b189724d328 diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx index 55f169b..58e1159 100644 --- a/sc/source/ui/view/tabvwshe.cxx +++ b/sc/source/ui/view/tabvwshe.cxx @@ -237,19 +237,22 @@ void ScTabViewShell::ExecSearch( SfxRequest& rReq ) ScGlobal::SetSearchItem( *pSearchItem ); sal_Bool bSuccess = SearchAndReplace( pSearchItem, sal_True, rReq.IsAPI() ); -SvxSearchDialog* pSearchDlg = - ((SvxSearchDialog*)(SfxViewFrame::Current()->GetChildWindow( - SvxSearchDialogWra
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/ui/docshell/datastream.cxx |6 ++ sc/source/ui/inc/gridwin.hxx |2 +- sc/source/ui/inc/tabview.hxx |1 + sc/source/ui/view/tabview3.cxx | 10 +++--- 4 files changed, 15 insertions(+), 4 deletions(-) New commits: commit dbbcdd877b1644d9a7b1bb013460681428a00855 Author: Matúš Kukan Date: Thu Dec 12 14:53:27 2013 +0100 CheckInverted() is not used anywhere. Change-Id: I5d22948314a16370d7ac75bfd25151cfa04a2491 diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 0a499c7..d5311da 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -376,7 +376,6 @@ public: voidStopMarking(); voidUpdateInputContext(); -voidCheckInverted() { if (nPaintCount) bNeedsRepaint = true; } boolNeedsRepaint() { return bNeedsRepaint; } voidDoInvertRect( const Rectangle& rPixel ); commit 29533e1871ea161bf6b919abed95d908c035c250 Author: Matúš Kukan Date: Thu Dec 12 14:46:34 2013 +0100 datastreams: Wait with import if we need to repaint. Change-Id: I31e8371999afafeeaad201496becf1f2f9d8d276 diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx index db974c7..7f529dd 100644 --- a/sc/source/ui/docshell/datastream.cxx +++ b/sc/source/ui/docshell/datastream.cxx @@ -390,6 +390,9 @@ void DataStream::Text2Doc() bool DataStream::ImportData() { +if (ScDocShell::GetViewData()->GetViewShell()->NeedsRepaint()) +return mbRunning; + MoveData(); if (mbValuesInLine) { diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 7818cc7..0a499c7 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -377,6 +377,7 @@ public: voidUpdateInputContext(); voidCheckInverted() { if (nPaintCount) bNeedsRepaint = true; } +boolNeedsRepaint() { return bNeedsRepaint; } voidDoInvertRect( const Rectangle& rPixel ); diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index 8832da4..0c1c7a1 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -437,6 +437,7 @@ public: voidUpdateFormulas(); voidInterpretVisible(); voidCheckNeedsRepaint(); +boolNeedsRepaint(); voidPaintRangeFinder( long nNumber = -1 ); voidAddHighlightRange( const ScRange& rRange, const Color& rColor ); diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index e258761..cedb9ba 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -2634,8 +2634,12 @@ void ScTabView::CheckNeedsRepaint() pGridWin[i]->CheckNeedsRepaint(); } - - - +bool ScTabView::NeedsRepaint() +{ +for (size_t i = 0; i < 4; i++) +if (pGridWin[i] && pGridWin[i]->IsVisible() && pGridWin[i]->NeedsRepaint()) +return true; +return false; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 78e4da913c12867ce6f2607a4a05bda66e73a213 Author: Matúš Kukan Date: Thu Dec 12 10:49:07 2013 +0100 datastreams: Broadcast data changes. Change-Id: Iedf07a9ef59a695cb56c2e160f269cd5d542735b diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx index 1d99af2..db974c7 100644 --- a/sc/source/ui/docshell/datastream.cxx +++ b/sc/source/ui/docshell/datastream.cxx @@ -378,6 +378,7 @@ void DataStream::Text2Doc() aDocImport.setNumericCell(aAddress, aCell.toDouble()); else aDocImport.setStringCell(aAddress, aCell); +mpScDocument->Broadcast(ScHint(SC_HINT_DATACHANGED, aAddress)); } ++nCol; } @@ -418,10 +419,12 @@ bool DataStream::ImportData() else aDocImport.setStringCell(aAddress, sValue); aRangeList.Join(aAddress); +mpScDocument->Broadcast(ScHint(SC_HINT_DATACHANGED, aAddress)); } aDocImport.finalize(); mpScDocShell->PostPaint( aRangeList, PAINT_GRID ); } +mpScDocShell->SetDocumentModified(); if (meMove == NO_MOVE) return mbRunning; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source vcl/source
sc/source/ui/Accessibility/AccessibleCellBase.cxx |3 +-- sc/source/ui/Accessibility/AccessibleTableBase.cxx |6 +- vcl/source/gdi/outdev3.cxx |6 -- 3 files changed, 6 insertions(+), 9 deletions(-) New commits: commit 2fbf95f5efb0e7e2781fa8546845a084721ee4e7 Author: Stephan Bergmann Date: Tue Dec 3 09:32:57 2013 +0100 warning C4702: unreachable code ...and simplification Change-Id: I652da35312522f452276116df11e548ba9231b53 diff --git a/sc/source/ui/Accessibility/AccessibleTableBase.cxx b/sc/source/ui/Accessibility/AccessibleTableBase.cxx index 5a74dcf..9ce33be 100644 --- a/sc/source/ui/Accessibility/AccessibleTableBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleTableBase.cxx @@ -65,19 +65,15 @@ void SAL_CALL ScAccessibleTableBase::disposing() uno::Any SAL_CALL ScAccessibleTableBase::queryInterface( uno::Type const & rType ) throw (uno::RuntimeException) { -uno::Any aRet; if ( rType == ::getCppuType((uno::Reference *)0) ) { -uno::Reference xThis( this ); -aRet <<= xThis; -return aRet; +return uno::Any(uno::Reference(this)); } else { uno::Any aAny (ScAccessibleTableBaseImpl::queryInterface(rType)); return aAny.hasValue() ? aAny : ScAccessibleContextBase::queryInterface(rType); } -return aRet; } void SAL_CALL ScAccessibleTableBase::acquire() commit e40bae2dc347ae6c7e3a9133fcdd78c62192a016 Author: Stephan Bergmann Date: Tue Dec 3 09:30:25 2013 +0100 Revert ScAccessibleCellBase::getCurrentValue to reutnr a numeric value again b41332475783c31136673fb44cf4c411bb0148f8 "Integrate branch of IAccessible2" had changed it to return a string, but that neither matched the documentation of css.accessibility.XAccessibleValue nor did it satisfy JunitTest_sc_unoapi. This is the same underlying issue as 1cb1dca1260da2cea5b6800483e86a6d6b251844 "Revert SwAccessibleCell::getCurrentValue to return a numeric value again" and needs further clarification apparently. Change-Id: Idb725724842ffa1aff811d66066912a22b2f2f6e diff --git a/sc/source/ui/Accessibility/AccessibleCellBase.cxx b/sc/source/ui/Accessibility/AccessibleCellBase.cxx index d021dbd..d1817b3 100644 --- a/sc/source/ui/Accessibility/AccessibleCellBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleCellBase.cxx @@ -233,8 +233,7 @@ uno::Any SAL_CALL uno::Any aAny; if (mpDoc) { -OUString valStr(mpDoc->GetString(maCellAddress.Col(),maCellAddress.Row(),maCellAddress.Tab())); -aAny <<= valStr; +aAny <<= mpDoc->GetValue(maCellAddress); } return aAny; } commit 44a6eee8e0b7c62685ebabea1fd9baee17cf62a6 Author: Stephan Bergmann Date: Tue Dec 3 09:23:43 2013 +0100 Call getLineBreak with null XHyphenator unless TEXT_DRAW_WORDBREAK_HYPHENATION So no longer instantiate XLinguServiceManager (which might e.g. bootstrap Python) unless explicitly requested, which e.g. removes a noticable delay when switching to the Options dialog's "Security" page (which causes size calculations of FixedText controls that use TEXT_DRAW_WORDBREAK but not TEXT_DRAW_WORDBREAK_HYPHENATION). Change-Id: Ib0a28d3d7d7718faf6df7a138f5a86b8b2fd7713 diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index afe06f7..0543eb5 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -4679,8 +4679,10 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, // get service provider uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() ); +bool bHyphenate = (nStyle & TEXT_DRAW_WORDBREAK_HYPHENATION) +== TEXT_DRAW_WORDBREAK_HYPHENATION; uno::Reference< linguistic2::XHyphenator > xHyph; -if ( nStyle & TEXT_DRAW_WORDBREAK ) +if ( bHyphenate ) { uno::Reference< linguistic2::XLinguServiceManager2> xLinguMgr = linguistic2::LinguServiceManager::create(xContext); xHyph = xLinguMgr->getHyphenator(); @@ -4712,7 +4714,7 @@ long OutputDevice::ImplGetTextLines( ImplMultiTextLineInfo& rLineInfo, nBreakPos = (xub_StrLen)aLBR.breakIndex; if ( nBreakPos <= nPos ) nBreakPos = nSoftBreak; -if ( (nStyle & TEXT_DRAW_WORDBREAK_HYPHENATION) == TEXT_DRAW_WORDBREAK_HYPHENATION ) +if ( bHyphenate ) { // Whether hyphen or not: Put the word after the hyphen through // word boundary. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/filter/excel/excdoc.cxx | 14 +- sc/source/filter/excel/excrecds.cxx |2 +- sc/source/filter/excel/xestyle.cxx | 12 ++-- 3 files changed, 16 insertions(+), 12 deletions(-) New commits: commit 9a339aedc84d75b7a5e0c2ec2ece0ba9bc344086 Author: Markus Mohrhard Date: Sat Nov 30 18:40:39 2013 +0100 make the validation tool happy This is just fucking awesome. The MSO implementers notes mention this attribute and point to some extended information that is either missing or does not mention this attribute. To make it more funny the MSO validation complains about invalid values in this attribute for our export. Change-Id: Iacf1af9f6124106952ae19ae5d5866bc8cf1 diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx index 01b2432a..9be9bfe 100644 --- a/sc/source/filter/excel/excrecds.cxx +++ b/sc/source/filter/excel/excrecds.cxx @@ -519,7 +519,7 @@ void XclExpSheetProtection::SaveXml( XclExpXmlStream& rStrm ) sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream(); rWorksheet->singleElement( XML_sheetProtection, XML_sheet, XclXmlUtils::ToPsz( true ), -XML_password, sHash.getStr(), +XML_password, sHash.isEmpty()? NULL : sHash.getStr(), XML_objects, pTabProtect->isOptionEnabled( ScTableProtection::OBJECTS ) ? NULL : XclXmlUtils::ToPsz( true ), XML_scenarios, pTabProtect->isOptionEnabled( ScTableProtection::SCENARIOS ) ? NULL : XclXmlUtils::ToPsz( true ), XML_formatCells, pTabProtect->isOptionEnabled( ScTableProtection::FORMAT_CELLS ) ? XclXmlUtils::ToPsz( false ) : NULL, commit e361f6b81b09919c77995a85250c70b099389915 Author: Markus Mohrhard Date: Sat Nov 30 18:19:40 2013 +0100 more OOXML export validation fixes, fdo#71971 Change-Id: Ic322d58817986887bbcd666ac3abc416609adf5c diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx index 574dcbb..a8bfbf7 100644 --- a/sc/source/filter/excel/excdoc.cxx +++ b/sc/source/filter/excel/excdoc.cxx @@ -561,6 +561,7 @@ void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx ) aRecList.AppendRecord( mxCellTable ); // label ranges +// missing SaveXML Add( new XclExpLabelranges( GetRoot() ) ); // DFF not needed in MSOOXML export @@ -572,15 +573,23 @@ void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx ) //Add( rR.pObjRecs ); // pivot tables +// not in the worksheet file aRecList.AppendRecord( GetPivotTableManager().CreatePivotTablesRecord( mnScTab ) ); // list of NOTE records, generated by the cell table +// not in the worksheet file if( mxNoteList != 0 && !mxNoteList->IsEmpty() ) aRecList.AppendNewRecord( new XclExpComments( mnScTab, *mxNoteList ) ); // web queries +// missing SaveXML implementation Add( new XclExpWebQueryBuffer( GetRoot() ) ); +ScDocument& rDoc = GetDoc(); +const ScTableProtection* pTabProtect = rDoc.GetTabProtection(mnScTab); +if (pTabProtect && pTabProtect->isProtected()) +Add( new XclExpSheetProtection(true, mnScTab) ); + lcl_AddScenariosAndFilters( aRecList, GetRoot(), mnScTab ); // MERGEDCELLS record, generated by the cell table @@ -589,11 +598,6 @@ void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx ) // conditional formats Add( new XclExpCondFormatBuffer( GetRoot(), xExtLst ) ); -ScDocument& rDoc = GetDoc(); -const ScTableProtection* pTabProtect = rDoc.GetTabProtection(mnScTab); -if (pTabProtect && pTabProtect->isProtected()) -Add( new XclExpSheetProtection(true, mnScTab) ); - if( HasVbaStorage() ) if( nCodeNameIdx < GetExtDocOptions().GetCodeNameCount() ) Add( new XclCodename( GetExtDocOptions().GetCodeName( nCodeNameIdx ) ) ); commit 7415fc31f5cdf7ff3f78dd304b9576b931a82aeb Author: Markus Mohrhard Date: Sat Nov 30 06:50:50 2013 +0100 write valid dxf record, related fdo#71971 Change-Id: I99f4dfca78cc0fd5d9b947000a99f8414c2a899b diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index 0769ea3..59603eb 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -3021,18 +3021,18 @@ void XclExpDxf::SaveXml( XclExpXmlStream& rStrm ) sax_fastparser::FSHelperPtr& rStyleSheet = rStrm.GetCurrentStream(); rStyleSheet->startElement( XML_dxf, FSEND ); -if (mpAlign) -mpAlign->SaveXml(rStrm); -if (mpBorder) -mpBorder->SaveXml(rStrm); if (mpFont) mpFont->SaveXml(rStrm); if (mpNumberFmt) mpNumberFmt->SaveXml(rStrm); -if (mpProt) -mpProt->SaveXml(rStrm); if (mpColor) mpColor->SaveXml(rStrm); +if (mpAlign) +mpAlign->SaveXml(rStrm); +if (mpBorder) +mpBorder->SaveXml(rStrm); +if (mpProt) +mpProt->SaveXml(rStrm); rStyleS
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/core/opencl/formulagroupcl.cxx | 79 +-- sc/source/core/opencl/opbase.hxx | 10 +++ 2 files changed, 74 insertions(+), 15 deletions(-) New commits: commit d78a19131950c087706a376f68b7066b44bf2f86 Author: I-Jui (Ray) Sung Date: Wed Nov 27 18:40:49 2013 -0600 GPU Calc: fix typo in NAN macro Change-Id: I34299e0fc692c2ab43fe0c1fffaada348742d19f diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 699b193..4e48e04 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -36,7 +36,7 @@ namespace { static const unsigned long __nan[2] = {0x, 0x7fff}; } -#define NAN (*(const float *) __nan) +#define NAN (*(const double*) __nan) #endif #endif commit 1de71419351019097074913815e5c049437c9419 Author: I-Jui (Ray) Sung Date: Wed Nov 27 18:36:47 2013 -0600 GPU Calc: fix compilation failure on Windows due to missing NAN macro Change-Id: I0d53dcf147a06f831120c5489b2975e42ea6120b diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index c02cef7..699b193 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -31,6 +31,14 @@ #define REDUCE_THRESHOLD 4 // set to 4 for correctness testing. priority 1 #define UNROLLING_FACTOR 16 // set to 4 for correctness testing (if no reduce) #include "formulagroupcl_public.hxx" +#ifdef WIN32 +#ifndef NAN +namespace { +static const unsigned long __nan[2] = {0x, 0x7fff}; +} +#define NAN (*(const float *) __nan) +#endif +#endif #include #include commit 4e88456720a94e5e812d6b81c841e6839dca5836 Author: I-Jui (Ray) Sung Date: Wed Nov 27 17:44:46 2013 -0600 GPU Calc: fix regression caused by recent isValid() change Change-Id: I885a222bf8a7ca4275867585ccf067a1ba7822c7 diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index c4290f4..c02cef7 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -72,8 +72,6 @@ size_t VectorRef::Marshal(cl_kernel k, int argno, int, cl_program) const formula::DoubleVectorRefToken* pDVR = dynamic_cast< const formula::DoubleVectorRefToken* >(ref); assert(pDVR); -if (pDVR->GetArrays()[mnIndex].mpNumericArray == NULL) -throw Unhandled(); pHostBuffer = const_cast( pDVR->GetArrays()[mnIndex].mpNumericArray); szHostBuffer = pDVR->GetArrayLength() * sizeof(double); @@ -84,12 +82,35 @@ size_t VectorRef::Marshal(cl_kernel k, int argno, int, cl_program) KernelEnv kEnv; OpenclDevice::setKernelEnv(&kEnv); cl_int err; -mpClmem = clCreateBuffer(kEnv.mpkContext, -(cl_mem_flags) CL_MEM_READ_ONLY|CL_MEM_USE_HOST_PTR, -szHostBuffer, -pHostBuffer, &err); -if (CL_SUCCESS != err) -throw OpenCLError(err); +if (pHostBuffer) +{ +mpClmem = clCreateBuffer(kEnv.mpkContext, +(cl_mem_flags) CL_MEM_READ_ONLY|CL_MEM_USE_HOST_PTR, +szHostBuffer, +pHostBuffer, &err); +if (CL_SUCCESS != err) +throw OpenCLError(err); +} +else +{ +if (szHostBuffer == 0) +szHostBuffer = sizeof(double); // a dummy small value +// Marshal as a buffer of NANs +mpClmem = clCreateBuffer(kEnv.mpkContext, +(cl_mem_flags) CL_MEM_READ_ONLY|CL_MEM_ALLOC_HOST_PTR, +szHostBuffer, NULL, &err); +if (CL_SUCCESS != err) +throw OpenCLError(err); +double *pNanBuffer = (double*)clEnqueueMapBuffer( +kEnv.mpkCmdQueue, mpClmem, CL_TRUE, CL_MAP_WRITE, 0, +szHostBuffer, 0, NULL, NULL, &err); +if (CL_SUCCESS != err) +throw OpenCLError(err); +for (size_t i = 0; i < szHostBuffer/sizeof(double); i++) +pNanBuffer[i] = NAN; +err = clEnqueueUnmapMemObject(kEnv.mpkCmdQueue, mpClmem, +pNanBuffer, 0, NULL, NULL); +} err = clSetKernelArg(k, argno, sizeof(cl_mem), (void*)&mpClmem); if (CL_SUCCESS != err) @@ -1414,9 +1435,9 @@ public: KernelEnv kEnv; OpenclDevice::setKernelEnv(&kEnv); cl_int err; +DynamicKernelArgument *Arg = mvSubArguments[0].get(); DynamicKernelSlidingArgument *slidingArgPtr = -dynamic_cast< DynamicKernelSlidingArgument *> -(mvSubArguments[0].get()); +dynamic_cast< DynamicKernelSlidingArgument *> (Arg); cl_mem mpClmem2; if (OpSumCodeGen->NeedReductionKernel()) @@ -1590,6 +1611,8 @@ DynamicKernelArgument *VectorRefFactory(const std::string &s, //Black lists ineligible classes here .. // SUMIFS does not perform parallel reductio
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/core/tool/interpr1.cxx | 48 +-- 1 file changed, 26 insertions(+), 22 deletions(-) New commits: commit ad36b0b9553f3903bddff0355dd878459bea8fae Author: Markus Mohrhard Date: Mon Oct 28 20:05:47 2013 +0100 kill a few xub_StrLen in ScInterpreter Change-Id: I08fbd6de92b152b94cf5cf40f0cf0c6566c617ff diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index ad1e720..952e50c 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -3237,7 +3237,7 @@ static inline bool lcl_ScInterpreter_IsPrintable( sal_Unicode c ) void ScInterpreter::ScClean() { OUString aStr = GetString().getString(); -for ( xub_StrLen i = 0; i < aStr.getLength(); i++ ) +for ( sal_Int32 i = 0; i < aStr.getLength(); i++ ) { if ( !lcl_ScInterpreter_IsPrintable( aStr[i] ) ) aStr = aStr.replaceAt(i,1,""); @@ -7181,7 +7181,7 @@ void ScInterpreter::ScAddressFunc() if (eConv == FormulaGrammar::CONV_OOO) { // Isolate Tab from 'Doc'#Tab -xub_StrLen nPos = ScCompiler::GetDocTabPos( sTabStr); +sal_Int32 nPos = ScCompiler::GetDocTabPos( sTabStr); if (nPos != STRING_NOTFOUND) { if (sTabStr[nPos+1] == '$') @@ -7682,9 +7682,9 @@ void ScInterpreter::ScReplace() PushIllegalArgument(); else { -xub_StrLen nCount = static_cast(fCount); -xub_StrLen nPos = static_cast(fPos); -xub_StrLen nLen = aOldStr.getLength(); +sal_Int32 nCount = static_cast(fCount); +sal_Int32 nPos = static_cast(fPos); +sal_Int32 nLen = aOldStr.getLength(); if (nPos > nLen + 1) nPos = nLen + 1; if (nCount > nLen - nPos + 1) @@ -7916,7 +7916,7 @@ void ScInterpreter::ScRightB() return ; } else -n = (xub_StrLen) nVal; +n = (sal_Int32) nVal; } else n = 1; @@ -7967,7 +7967,7 @@ void ScInterpreter::ScLeftB() return ; } else -n = (xub_StrLen) nVal; +n = (sal_Int32) nVal; } else n = 1; @@ -7987,8 +7987,8 @@ void ScInterpreter::ScMidB() else { -aStr = lcl_LeftB(aStr, (xub_StrLen)fAnfang + (xub_StrLen)fAnz - 1); -sal_Int32 nCnt = getLengthB(aStr) - (xub_StrLen)fAnfang + 1; +aStr = lcl_LeftB(aStr, (sal_Int32)fAnfang + (sal_Int32)fAnz - 1); +sal_Int32 nCnt = getLengthB(aStr) - (sal_Int32)fAnfang + 1; aStr = lcl_RightB(aStr, nCnt>0 ? nCnt:0); PushString(aStr); } @@ -8000,7 +8000,7 @@ void ScInterpreter::ScRight() sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 1, 2 ) ) { -xub_StrLen n; +sal_Int32 n; if (nParamCount == 2) { double nVal = ::rtl::math::approxFloor(GetDouble()); @@ -8010,7 +8010,7 @@ void ScInterpreter::ScRight() return ; } else -n = (xub_StrLen) nVal; +n = (sal_Int32) nVal; } else n = 1; @@ -8159,7 +8159,7 @@ void ScInterpreter::ScSubstitute() sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 3, 4 ) ) { -xub_StrLen nAnz; +sal_Int32 nAnz; if (nParamCount == 4) { double fAnz = ::rtl::math::approxFloor(GetDouble()); @@ -8169,7 +8169,7 @@ void ScInterpreter::ScSubstitute() return; } else -nAnz = (xub_StrLen) fAnz; +nAnz = (sal_Int32) fAnz; } else nAnz = 0; @@ -8177,9 +8177,9 @@ void ScInterpreter::ScSubstitute() OUString sOldStr = GetString().getString(); OUString sStr= GetString().getString(); sal_Int32 nPos = 0; -xub_StrLen nCount = 0; -xub_StrLen nNewLen = sNewStr.getLength(); -xub_StrLen nOldLen = sOldStr.getLength(); +sal_Int32 nCount = 0; +sal_Int32 nNewLen = sNewStr.getLength(); +sal_Int32 nOldLen = sOldStr.getLength(); while( true ) { nPos = sStr.indexOf( sOldStr, nPos ); @@ -8192,7 +8192,7 @@ void ScInterpreter::ScSubstitute() if ( CheckStringResultLen( sStr, sNewStr ) ) { sStr = sStr.replaceAt(nPos, 0, sNewStr); -nPos = sal::static_int_cast( nPos + nNewLen ); +nPos = sal::static_int_cast( nPos + nNewLen ); } else break; @@ -8224,8 +8224,8 @@ void ScInterpreter::ScRept() PushString( EMPT
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/core/data/column3.cxx | 10 +++--- sc/source/core/data/document.cxx |4 ++-- sc/source/ui/navipi/content.cxx | 17 +++-- 3 files changed, 16 insertions(+), 15 deletions(-) New commits: commit 59585984fcede9dcfce44557b7076ed682059e1c Author: Kohei Yoshida Date: Wed Oct 23 18:59:09 2013 -0400 When failing, we need to return an invalid address. ScAddress() gets initialized to a valid address of col=0,row=0,tab=0. Change-Id: I9f12b4b2329e2c9907b9c8113371d963fc06f442 diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 30c9256..ccf7d32 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -6177,12 +6177,12 @@ ScAddress ScDocument::GetNotePosition( size_t nIndex ) const return ScAddress(nCol, nRow, nTab); OSL_FAIL("note not found"); -return ScAddress(); +return ScAddress(ScAddress::INITIALIZE_INVALID); } } OSL_FAIL("note not found"); -return ScAddress(); +return ScAddress(ScAddress::INITIALIZE_INVALID); } SCROW ScDocument::GetNotePosition( SCTAB nTab, SCCOL nCol, size_t nIndex ) const commit 5b483ed15d70bdc34b9520632ee569db0e6c4f9d Author: Kohei Yoshida Date: Wed Oct 23 18:12:09 2013 -0400 Cell note deletion should happen even when no cells exist in the column. This fixes one of the API test breakages. Change-Id: I8168d490ec5d519e151a74fb8c4343337262f15b diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index c90a33e..73bcf2d 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -600,14 +600,18 @@ void ScColumn::DeleteArea(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nDelFlag) aBlockPos.miCellTextAttrPos = maCellTextAttrs.begin(); aBlockPos.miCellNotePos = maCellNotes.begin(); -if ( nDelFlag & IDF_NOTE ) -DeleteCellNotes( aBlockPos, nStartRow, nEndRow ); - // Delete the cells for real. std::for_each(aSpans.begin(), aSpans.end(), EmptyCells(aBlockPos, *this)); CellStorageModified(); } +if (nDelFlag & IDF_NOTE) +{ +sc::ColumnBlockPosition aBlockPos; +aBlockPos.miCellNotePos = maCellNotes.begin(); +DeleteCellNotes(aBlockPos, nStartRow, nEndRow); +} + if ( nDelFlag & IDF_EDITATTR ) { OSL_ENSURE( nContFlag == 0, "DeleteArea: Wrong Flags" ); commit f068f1ae32f4243d8f8f8b90209508b1b5906548 Author: Kohei Yoshida Date: Wed Oct 23 17:38:27 2013 -0400 Bail out on first hit. No need to go through the whole set. Change-Id: I044432a1d4e63f49731c24e4eb62525386818620 diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index fc70ef6..1fa2ca5 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -886,7 +886,6 @@ sal_Bool ScContentTree::NoteStringsChanged() SvTreeListEntry* pEntry = FirstChild( pParent ); -bool bEqual = true; std::vector aEntries; pDoc->GetAllNoteEntries(aEntries); std::vector::const_iterator it = aEntries.begin(), itEnd = aEntries.end(); @@ -894,20 +893,18 @@ sal_Bool ScContentTree::NoteStringsChanged() { const ScPostIt* pNote = it->mpNote; if (!pEntry) -bEqual = false; -else -{ -if (lcl_NoteString(*pNote) != GetEntryText(pEntry)) -bEqual = false; +return true; -pEntry = NextSibling(pEntry); -} +if (lcl_NoteString(*pNote) != GetEntryText(pEntry)) +return true; + +pEntry = NextSibling(pEntry); } if ( pEntry ) -bEqual = false; // kommt noch was +return true; -return !bEqual; +return false; } sal_Bool ScContentTree::DrawNamesChanged( sal_uInt16 nType ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/ui/dbgui/asciiopt.cxx | 72 sc/source/ui/inc/asciiopt.hxx | 26 +++--- 2 files changed, 35 insertions(+), 63 deletions(-) New commits: commit d4d5af7396f997d72487db3127eba7f8a4130a2b Author: Eike Rathke Date: Mon Aug 26 14:53:30 2013 +0200 translated comments Change-Id: I29cbd65d57b1c6cc26039c0f5472ecb9e669e6a7 diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx index 628f29b..0f514ce 100644 --- a/sc/source/ui/dbgui/asciiopt.cxx +++ b/sc/source/ui/dbgui/asciiopt.cxx @@ -168,7 +168,7 @@ bool ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const nInfoCount == rCmp.nInfoCount ) { OSL_ENSURE( !nInfoCount || (pColStart && pColFormat && rCmp.pColStart && rCmp.pColFormat), - "0-Zeiger in ScAsciiOptions" ); + "NULL pointer in ScAsciiOptions::operator==() column info" ); for (sal_uInt16 i=0; i= 1 ) { bFixedLen = bMergeFieldSeps = false; @@ -219,10 +213,7 @@ void ScAsciiOptions::ReadFromString( const String& rString ) } } -// -// Text-Trenner -// - +// Text separator. if ( nCount >= 2 ) { aToken = rString.GetToken(1,','); @@ -230,30 +221,21 @@ void ScAsciiOptions::ReadFromString( const String& rString ) cTextSep = (sal_Unicode) nVal; } -// -// Zeichensatz -// - +// Text encoding. if ( nCount >= 3 ) { aToken = rString.GetToken(2,','); eCharSet = ScGlobal::GetCharsetValue( aToken ); } -// -// Startzeile -// - +// Number of start row. if ( nCount >= 4 ) { aToken = rString.GetToken(3,','); nStartRow = aToken.ToInt32(); } -// -// Spalten-Infos -// - +// Column info. if ( nCount >= 5 ) { delete[] pColStart; @@ -311,10 +293,7 @@ String ScAsciiOptions::WriteToString() const { OUString aOutStr; -// -// Feld-Trenner -// - +// Field separator. if ( bFixedLen ) aOutStr += pStrFix; else if ( !aFieldSeps.Len() ) @@ -335,27 +314,20 @@ String ScAsciiOptions::WriteToString() const } } -aOutStr += "," + - // Text-Trenner - OUString::number(cTextSep) + ","; - -// -// Zeichensatz -// +// Text delimiter. +aOutStr += "," + OUString::number(cTextSep) + ","; +// Text encoding. if ( bCharSetSystem ) // force "SYSTEM" aOutStr += ScGlobal::GetCharsetString( RTL_TEXTENCODING_DONTKNOW ); else aOutStr += ScGlobal::GetCharsetString( eCharSet ); -aOutStr += "," + - // Startzeile - OUString::number(nStartRow) + ","; -// -// Spalten-Infos -// +// Number of start row. +aOutStr += "," + OUString::number(nStartRow) + ","; -OSL_ENSURE( !nInfoCount || (pColStart && pColFormat), "0-Zeiger in ScAsciiOptions" ); +// Column info. +OSL_ENSURE( !nInfoCount || (pColStart && pColFormat), "NULL pointer in ScAsciiOptions column info" ); for (sal_uInt16 nInfo=0; nInfo Date: Mon Aug 26 14:43:11 2013 +0200 typo in comment Change-Id: I4557da1d51f563be93ed33bf7a2d1804a73ed07f diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx index 045d428..628f29b 100644 --- a/sc/source/ui/dbgui/asciiopt.cxx +++ b/sc/source/ui/dbgui/asciiopt.cxx @@ -293,7 +293,7 @@ void ScAsciiOptions::ReadFromString( const String& rString ) bQuotedFieldAsText = aToken.EqualsAscii("true") ? true : false; } -// Detect special nubmers. +// Detect special numbers. if (nCount >= 8) { aToken = rString.GetToken(7, ','); commit 52810eb4552c4e327d47bca4955bf64acdb1c82e Author: Eike Rathke Date: Mon Aug 26 14:41:39 2013 +0200 sal_Bool to bool Change-Id: I3ba3a2074495d01f7877f449ed9b8723161fdd2f diff --git a/sc/source/ui/dbgui/asciiopt.cxx b/sc/source/ui/dbgui/asciiopt.cxx index 827a2f0..045d428 100644 --- a/sc/source/ui/dbgui/asciiopt.cxx +++ b/sc/source/ui/dbgui/asciiopt.cxx @@ -155,7 +155,7 @@ ScAsciiOptions& ScAsciiOptions::operator=( const ScAsciiOptions& rCpy ) } -sal_Bool ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const +bool ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const { if ( bFixedLen == rCmp.bFixedLen && aFieldSeps == rCmp.aFieldSeps && @@ -174,7 +174,7 @@ sal_Bool ScAsciiOptions::operator==( const ScAsciiOptions& rCmp ) const pColFormat[i] != rCmp.pColFormat[i] ) return false; -return sal_True; +return true; } return false; } @@ -203,13 +203,13 @@ void ScAsciiOptions::ReadFromString( const String& rString ) aToken = rString.GetT
[Libreoffice-commits] core.git: 3 commits - sc/source sd/source
sc/source/ui/view/editsh.cxx| 12 +++- sd/source/ui/remotecontrol/WINNetworkService.cxx|7 ++- sd/source/ui/remotecontrol/mDNSResponder/dnssd_clientstub.c | 11 --- 3 files changed, 21 insertions(+), 9 deletions(-) New commits: commit 4a01706377c6e1e7528f0536e4edf60d4cff5504 Author: Tor Lillqvist Date: Fri Aug 16 23:46:27 2013 +0300 WaE: C4204: nonstandard extension used : non-constant aggregate initializer Change-Id: I5f34209ad4ea5b97e12cb7073fcf1cf2264ebcf3 diff --git a/sd/source/ui/remotecontrol/mDNSResponder/dnssd_clientstub.c b/sd/source/ui/remotecontrol/mDNSResponder/dnssd_clientstub.c index fb4ae95..5dcc196 100755 --- a/sd/source/ui/remotecontrol/mDNSResponder/dnssd_clientstub.c +++ b/sd/source/ui/remotecontrol/mDNSResponder/dnssd_clientstub.c @@ -1492,7 +1492,9 @@ DNSServiceErrorType DNSSD_API DNSServiceRegister size_t len; ipc_msg_hdr *hdr; DNSServiceErrorType err; -union { uint16_t s; u_char b[2]; } port = { PortInNetworkByteOrder }; +union { uint16_t s; u_char b[2]; } port; + +port.s = PortInNetworkByteOrder; if (!name) name = ""; if (!regtype) return kDNSServiceErr_BadParam; @@ -1975,12 +1977,15 @@ DNSServiceErrorType DNSSD_API DNSServiceNATPortMappingCreate char *ptr; size_t len; ipc_msg_hdr *hdr; -union { uint16_t s; u_char b[2]; } internalPort = { internalPortInNetworkByteOrder }; -union { uint16_t s; u_char b[2]; } externalPort = { externalPortInNetworkByteOrder }; +union { uint16_t s; u_char b[2]; } internalPort; +union { uint16_t s; u_char b[2]; } externalPort; DNSServiceErrorType err = ConnectToServer(sdRef, flags, port_mapping_request, handle_port_mapping_response, callBack, context); if (err) return err;// On error ConnectToServer leaves *sdRef set to NULL +internalPort.s = internalPortInNetworkByteOrder; +externalPort.s = externalPortInNetworkByteOrder; + len = sizeof(flags); len += sizeof(interfaceIndex); len += sizeof(protocol); commit ddba5a4360e88ac4f6f848ac74ab1f350b9b7d5f Author: Tor Lillqvist Date: Fri Aug 16 23:42:22 2013 +0300 SAL_INFO is not available here Change-Id: Ic40cb29d9ade32690903bfa0f3993782711cc53f diff --git a/sd/source/ui/remotecontrol/WINNetworkService.cxx b/sd/source/ui/remotecontrol/WINNetworkService.cxx index 6e35f05..144b33a 100755 --- a/sd/source/ui/remotecontrol/WINNetworkService.cxx +++ b/sd/source/ui/remotecontrol/WINNetworkService.cxx @@ -7,13 +7,10 @@ void sd::WINNetworkService::setup() { DNSServiceErrorType err = DNSServiceRegister(&client, 0, 0, NULL, kREG_TYPE, "local", NULL, 1599, 1, "", NULL, this ); -if ( err == 0 ) { -SAL_INFO("sd", "Windows bonjour service setup"); -} // Fail silently otherwise +// Fail silently } void sd::WINNetworkService::clear() { DNSServiceRefDeallocate(client); -SAL_INFO("sd", "Windows mDNSResponder removed"); -} \ No newline at end of file +} commit a0161828b8ea4d68fb34f02656b9a4f8604129ab Author: Tor Lillqvist Date: Fri Aug 16 22:17:44 2013 +0300 WaE: C4305: 'argument' : truncation from 'int' to 'const bool' Change-Id: I92729c7272e87c2aede6cd5134c84d17b466e57f diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index 76a9529..a4b45a9 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -670,7 +670,17 @@ void ScEditShell::GetState( SfxItemSet& rSet ) if ( pActiveView ) rSet.Put( SfxBoolItem( nWhich, pActiveView->IsInsertMode() ) ); else -rSet.Put( SfxBoolItem( nWhich, 42 ) ); +{ +// Here the code used to pass the value 42 and it used +// to "work" without warnings because the SfxBoolItem +// was based on 'sal_Bool', which is actually 'unsigned +// char'. But now it uses actual 'bool', and passing 42 +// for a 'bool' parameter causes a warning at least with +// MSVC. So use 'true'. I really really hope there is +// not code somewhere that retrieves this "boolean" item +// and checks it value for the magic value 42... +rSet.Put( SfxBoolItem( nWhich, true) ); +} } break; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/source xmloff/source
sc/source/filter/excel/xetable.cxx | 46 +-- sc/source/filter/inc/xetable.hxx |3 + xmloff/source/chart/XMLChartStyleContext.cxx | 14 ++-- 3 files changed, 50 insertions(+), 13 deletions(-) New commits: commit 93a5b7ee36818d60963e4fbe21f9e6c43c7c5a80 Author: Markus Mohrhard Date: Tue Jul 2 02:37:58 2013 +0200 don't forget the formula cell style during xls/xlsx export, fdo#66242 This reverts parts of commit 64223bda068cc6d82d3c5e359d465014568398bb. Change-Id: I6d5379aaedbf011b39a4cf076f0a43bc8a6cbc93 diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 39f2e03..8694a49 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -760,13 +760,55 @@ IMPL_FIXEDMEMPOOL_NEWDEL( XclExpFormulaCell ) XclExpFormulaCell::XclExpFormulaCell( const XclExpRoot& rRoot, const XclAddress& rXclPos, -sal_uInt32 nForcedXFId, const ScFormulaCell& rScFmlaCell, +const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId, +const ScFormulaCell& rScFmlaCell, XclExpArrayBuffer& rArrayBfr, XclExpShrfmlaBuffer& rShrfmlaBfr, XclExpTableopBuffer& rTableopBfr ) : XclExpSingleCellBase( EXC_ID2_FORMULA, 0, rXclPos, nForcedXFId ), mrScFmlaCell( const_cast< ScFormulaCell& >( rScFmlaCell ) ) { +// *** Find result number format overwriting cell number format *** --- + +if( GetXFId() == EXC_XFID_NOTFOUND ) +{ +SvNumberFormatter& rFormatter = rRoot.GetFormatter(); +XclExpNumFmtBuffer& rNumFmtBfr = rRoot.GetNumFmtBuffer(); + +// current cell number format +sal_uLong nScNumFmt = pPattern ? +GETITEMVALUE( pPattern->GetItemSet(), SfxUInt32Item, ATTR_VALUE_FORMAT, sal_uLong ) : +rNumFmtBfr.GetStandardFormat(); + +// alternative number format passed to XF buffer +sal_uLong nAltScNumFmt = NUMBERFORMAT_ENTRY_NOT_FOUND; +/* Xcl doesn't know Boolean number formats, we write +"TRUE";"FALSE" (language dependent). Don't do it for automatic +formula formats, because Excel gets them right. */ +/* #i8640# Don't set text format, if we have string results. */ +short nFormatType = mrScFmlaCell.GetFormatType(); +if( ((nScNumFmt % SV_COUNTRY_LANGUAGE_OFFSET) == 0) && +(nFormatType != NUMBERFORMAT_LOGICAL) && +(nFormatType != NUMBERFORMAT_TEXT) ) +nAltScNumFmt = nScNumFmt; +/* If cell number format is Boolean and automatic formula +format is Boolean don't write that ugly special format. */ +else if( (nFormatType == NUMBERFORMAT_LOGICAL) && +(rFormatter.GetType( nScNumFmt ) == NUMBERFORMAT_LOGICAL) ) +nAltScNumFmt = rNumFmtBfr.GetStandardFormat(); + +// #i41420# find script type according to result type (always latin for numeric results) +sal_Int16 nScript = ApiScriptType::LATIN; +bool bForceLineBreak = false; +if( nFormatType == NUMBERFORMAT_TEXT ) +{ +String aResult = mrScFmlaCell.GetString(); +bForceLineBreak = mrScFmlaCell.IsMultilineResult(); +nScript = XclExpStringHelper::GetLeadingScriptType( rRoot, aResult ); +} +SetXFId( rRoot.GetXFBuffer().InsertWithNumFmt( pPattern, nScript, nAltScNumFmt, bForceLineBreak ) ); +} + // *** Convert the formula token array *** ScAddress aScPos( static_cast< SCCOL >( rXclPos.mnCol ), static_cast< SCROW >( rXclPos.mnRow ), rRoot.GetCurrScTab() ); @@ -2336,7 +2378,7 @@ XclExpCellTable::XclExpCellTable( const XclExpRoot& rRoot ) : case CELLTYPE_FORMULA: { xCell.reset(new XclExpFormulaCell( -GetRoot(), aXclPos, nMergeBaseXFId, +GetRoot(), aXclPos, pPattern, nMergeBaseXFId, *rScCell.mpFormula, maArrayBfr, maShrfmlaBfr, maTableopBfr)); } break; diff --git a/sc/source/filter/inc/xetable.hxx b/sc/source/filter/inc/xetable.hxx index b0253b3..655d6ea 100644 --- a/sc/source/filter/inc/xetable.hxx +++ b/sc/source/filter/inc/xetable.hxx @@ -451,7 +451,8 @@ class XclExpFormulaCell : public XclExpSingleCellBase public: explicitXclExpFormulaCell( const XclExpRoot& rRoot, const XclAddress& rXclPos, -sal_uInt32 nForcedXFId, const ScFormulaCell& rScFmlaCell, +const ScPatternAttr* pPattern, sal_uInt32 nForcedXFId, +const ScFormulaCell& rScFmlaCell, XclExpArrayBuffer& rArrayBfr, XclExpShrfmlaBuffer& rShrfmlaBfr, XclExpTableopBuffer& rTableopBfr ); commit ae4e42c87f10eda7efd74cb250253a4f6815d427 Author: Markus Mohrhard Dat
[Libreoffice-commits] core.git: 3 commits - sc/source
sc/source/core/data/cell.cxx |1 + sc/source/core/data/column3.cxx |3 ++- sc/source/core/data/documen4.cxx |2 +- 3 files changed, 4 insertions(+), 2 deletions(-) New commits: commit b3356f6f772d7d265160927d45f935098784c20e Author: Markus Mohrhard Date: Fri Feb 15 20:56:47 2013 +0100 coverity: fix memory leak Change-Id: Id378d44e8d469c3606050255d9712a0aed5ede57 diff --git a/sc/source/core/data/documen4.cxx b/sc/source/core/data/documen4.cxx index 9356e77..77ebe66 100644 --- a/sc/source/core/data/documen4.cxx +++ b/sc/source/core/data/documen4.cxx @@ -185,7 +185,7 @@ void ScDocument::InsertMatrixFormula(SCCOL nCol1, SCROW nRow1, // Zelle ein eigenes Array erhaelt! aPos = ScAddress( j, k, *itr ); t->CalcRelFromAbs( aPos ); -pCell = new ScFormulaCell( this, aPos, aArr.Clone(), eGram, MM_REFERENCE ); +pCell = new ScFormulaCell( this, aPos, &aArr, eGram, MM_REFERENCE ); maTabs[*itr]->PutCell(j, k, (ScBaseCell*) pCell); } } commit cc9cd7af3beb13eede23c6c60506c6e8c329e29d Author: Markus Mohrhard Date: Fri Feb 15 20:54:29 2013 +0100 coverity: initialize variable Change-Id: Ie52aae8e56e4b420d612772f8dab1d9e7330f79a diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 7976996..d681388 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -1195,7 +1195,8 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString, if (pParam) aParam = *pParam; -sal_uInt32 nIndex, nOldIndex = 0; +sal_uInt32 nIndex = 0; +sal_uInt32 nOldIndex = 0; sal_Unicode cFirstChar; if (!aParam.mpNumFormatter) aParam.mpNumFormatter = pDocument->GetFormatTable(); commit 22763347d8d4f02729c93ed19c2040ebebabb5f1 Author: Markus Mohrhard Date: Fri Feb 15 20:44:17 2013 +0100 coverity: fix memory leak Change-Id: I1c4e6cd0b60047de45a4782bfebb8520b1a17f22 diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx index 75d1ced..97282b0 100644 --- a/sc/source/core/data/cell.cxx +++ b/sc/source/core/data/cell.cxx @@ -201,6 +201,7 @@ void adjustDBRange(ScToken* pToken, ScDocument& rNewDoc, const ScDocument* pOldD if (!pNewDBCollection) { pNewDBCollection = new ScDBCollection(&rNewDoc); +rNewDoc.SetDBCollection(pNewDBCollection); } ScDBCollection::NamedDBs& aNewNamedDBs = pNewDBCollection->getNamedDBs(); ScDBData* pNewDBData = aNewNamedDBs.findByUpperName(aDBName); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits