[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source sdext/source sd/source
sc/inc/dapiuno.hxx |1 sc/source/ui/unoobj/dapiuno.cxx | 17 sd/source/core/CustomAnimationCloner.cxx |8 sd/source/core/CustomAnimationEffect.cxx | 127 ++- sd/source/core/CustomAnimationPreset.cxx | 47 -- sd/source/core/TransitionPreset.cxx | 18 - sd/source/core/drawdoc.cxx |8 sd/source/core/stlpool.cxx |5 sd/source/core/stlsheet.cxx | 19 - sd/source/filter/eppt/eppt.cxx |7 sd/source/filter/eppt/epptso.cxx |8 sd/source/filter/eppt/pptexanimations.cxx| 55 +-- sd/source/filter/eppt/pptx-animations.cxx|4 sd/source/filter/eppt/pptx-text.cxx | 35 - sd/source/filter/grf/sdgrffilter.cxx | 18 - sd/source/filter/html/HtmlOptionsDialog.cxx | 23 - sd/source/filter/html/htmlex.cxx | 110 ++ sd/source/filter/ppt/pptinanimations.cxx | 25 - sd/source/ui/app/optsitem.cxx|2 sd/source/ui/dlg/PhotoAlbumDialog.cxx|4 sd/source/ui/dlg/tpaction.cxx|3 sd/source/ui/framework/configuration/Configuration.cxx | 27 - sd/source/ui/framework/configuration/ConfigurationClassifier.cxx | 37 -- sd/source/ui/framework/configuration/ConfigurationController.cxx | 11 sd/source/ui/framework/configuration/ResourceId.cxx | 15 sd/source/ui/framework/factories/ViewShellWrapper.cxx|5 sd/source/ui/framework/tools/FrameworkHelper.cxx |4 sd/source/ui/remotecontrol/Server.cxx| 29 - sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx |9 sd/source/ui/slideshow/PaneHider.cxx |3 sd/source/ui/slideshow/slideshowimpl.cxx | 24 - sd/source/ui/table/TableDesignPane.cxx | 11 sd/source/ui/tools/ConfigurationAccess.cxx |3 sd/source/ui/unoidl/SdUnoSlideView.cxx |5 sd/source/ui/unoidl/UnoDocumentSettings.cxx |8 sd/source/ui/unoidl/unomodel.cxx | 21 - sd/source/ui/unoidl/unomodule.cxx|9 sd/source/ui/unoidl/unoobj.cxx | 45 +- sd/source/ui/unoidl/unopage.cxx | 48 +- sd/source/ui/unoidl/unopback.cxx |6 sd/source/ui/view/DocumentRenderer.cxx |4 sd/source/ui/view/ViewShellBase.cxx | 47 +- sd/source/ui/view/drviews5.cxx | 10 sd/source/ui/view/frmview.cxx| 177 -- sdext/source/minimizer/configurationaccess.cxx | 16 sdext/source/minimizer/fileopendialog.cxx| 25 - sdext/source/minimizer/impoptimizer.cxx | 46 +- sdext/source/minimizer/optimizationstats.cxx |4 sdext/source/minimizer/pppoptimizerdialog.cxx|9 sdext/source/pdfimport/filterdet.cxx |8 sdext/source/pdfimport/pdfiadaptor.cxx | 42 +- sdext/source/presenter/PresenterAccessibility.cxx| 10 sdext/source/presenter/PresenterConfigurationAccess.cxx | 12 sdext/source/presenter/PresenterScreen.cxx | 30 - sdext/source/presenter/PresenterTheme.cxx| 13 55 files changed, 530 insertions(+), 787 deletions(-) New commits: commit 515cce5e6ec92b80f524e1925660bdf5a8c90c13 Author: Arkadiy Illarionov AuthorDate: Sun Jul 28 17:50:33 2019 +0300 Commit: Arkadiy Illarionov CommitDate: Mon Jul 29 18:45:21 2019 +0200 Drop ScDataPilotFieldObj::HasString Use comphelper::findValue instead Change-Id: I59a3ef2781643dfdb7ecbfe578fb9e1faebb0c42 Reviewed-on: https://gerrit.libreoffice.org/76502 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov diff --git a/sc/inc/dapiuno.hxx b/sc/inc/dapiuno.hxx index ad6f9b275502..22d7c4302d3a 100644 --- a/sc/inc/dapiuno.hxx +++ b/sc/inc/dapiuno.hxx @@ -466,7 +466,6 @@ public: void setGroupInfo(const css::sheet::DataPilotFieldGroupInfo* pInfo); // XDataPilotFieldGrouping -static bool HasString(const css::uno::Se
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/table.hxx|2 sc/source/core/data/documen3.cxx| 14 +-- sc/source/core/data/documentimport.cxx | 12 -- sc/source/core/data/table2.cxx | 15 +++ sc/source/filter/inc/orcusinterface.hxx | 21 - sc/source/filter/orcus/interface.cxx| 130 +++- 6 files changed, 140 insertions(+), 54 deletions(-) New commits: commit ecfb22783f2462ba264e8793e3798c676dc9b727 Author: Kohei Yoshida Date: Sat Dec 9 14:32:30 2017 -0500 Handle per-cell settings of cell formats. Change-Id: I500d01921d436643499a24d375d40a607d8fd576 Reviewed-on: https://gerrit.libreoffice.org/46663 Tested-by: Jenkins Reviewed-by: Kohei Yoshida diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index d85308732fea..e8c216308941 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -644,9 +644,13 @@ void ScOrcusSheet::set_date_time( cellInserted(); } -void ScOrcusSheet::set_format(os::row_t /*row*/, os::col_t /*col*/, size_t xf_index) +void ScOrcusSheet::set_format(os::row_t row, os::col_t col, size_t xf_index) { SAL_INFO("sc.orcus.style", "set format: " << xf_index); + +ScPatternAttr aPattern(mrDoc.getDoc().GetPool()); +mrStyles.applyXfToItemSet(aPattern.GetItemSet(), xf_index); +mrDoc.getDoc().ApplyPattern(col, row, mnTab, aPattern); } void ScOrcusSheet::set_format(os::row_t row_start, os::col_t col_start, commit c7529c1ecab2d22ed10e83627884da6b08f84e6d Author: Kohei Yoshida Date: Sat Dec 9 13:38:27 2017 -0500 Implement a reference resolver for orcus. Orcus uses this to resolve cell addresses for some ops. Change-Id: I6ee9667ad994fb830e545ba3368004866a048c25 Reviewed-on: https://gerrit.libreoffice.org/46662 Tested-by: Jenkins Reviewed-by: Kohei Yoshida diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx index af5020c8ace4..e502d49296b1 100644 --- a/sc/source/filter/inc/orcusinterface.hxx +++ b/sc/source/filter/inc/orcusinterface.hxx @@ -47,6 +47,8 @@ class XStatusIndicator; class ScOrcusGlobalSettings : public orcus::spreadsheet::iface::import_global_settings { ScDocumentImport& mrDoc; +formula::FormulaGrammar::Grammar meCalcGrammar; +orcus::spreadsheet::formula_grammar_t meOrcusGrammar; public: ScOrcusGlobalSettings(ScDocumentImport& rDoc); @@ -55,6 +57,22 @@ public: virtual void set_default_formula_grammar(orcus::spreadsheet::formula_grammar_t grammar) override; virtual orcus::spreadsheet::formula_grammar_t get_default_formula_grammar() const override; + +formula::FormulaGrammar::Grammar getCalcGrammar() const +{ +return meCalcGrammar; +} +}; + +class ScOrcusRefResolver : public orcus::spreadsheet::iface::import_reference_resolver +{ +const ScOrcusGlobalSettings& mrGlobalSettings; + +public: +ScOrcusRefResolver( const ScOrcusGlobalSettings& rGS ); + +orcus::spreadsheet::address_t resolve_address(const char* p, size_t n) override; +orcus::spreadsheet::range_t resolve_range(const char* p, size_t n) override; }; class ScOrcusSharedStrings : public orcus::spreadsheet::iface::import_shared_strings @@ -202,7 +220,7 @@ class ScOrcusSheet : public orcus::spreadsheet::iface::import_sheet public: ScOrcusSheet(ScDocumentImport& rDoc, SCTAB nTab, ScOrcusFactory& rFactory); -virtual orcus::spreadsheet::iface::import_auto_filter* get_auto_filter() override { return &maAutoFilter; } +virtual orcus::spreadsheet::iface::import_auto_filter* get_auto_filter() override; virtual orcus::spreadsheet::iface::import_table* get_table() override; virtual orcus::spreadsheet::iface::import_sheet_properties* get_sheet_properties() override; virtual orcus::spreadsheet::iface::import_conditional_format* get_conditional_format() override; @@ -497,6 +515,7 @@ class ScOrcusFactory : public orcus::spreadsheet::iface::import_factory StringCellCaches maStringCells; ScOrcusGlobalSettings maGlobalSettings; +ScOrcusRefResolver maRefResolver; ScOrcusSharedStrings maSharedStrings; std::vector< std::unique_ptr > maSheets; ScOrcusStyles maStyles; diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index ec93824093a2..d85308732fea 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -58,20 +58,103 @@ using namespace com::sun::star; namespace os = orcus::spreadsheet; -ScOrcusGlobalSettings::ScOrcusGlobalSettings(ScDocumentImport& rDoc) : mrDoc(rDoc) {} +namespace { + +formula::FormulaGrammar::Grammar getCalcGrammarFromOrcus( os::formula_grammar_t grammar ) +{ +formula::FormulaGrammar::Grammar eGrammar = formula::FormulaGrammar::GRAM_ODFF; +switch(grammar) +{ +case orcus::spreadsheet::formula_grammar_t::ods: +e
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/documentimport.hxx |1 sc/source/core/data/documentimport.cxx |5 + sc/source/filter/orcus/interface.cxx| 12 ++ sc/source/filter/orcus/orcusfiltersimpl.cxx | 122 +++- 4 files changed, 51 insertions(+), 89 deletions(-) New commits: commit 599a23b17818bbeea85b6ab0b57401e4ff2cd5c0 Author: Kohei Yoshida Date: Thu Dec 7 21:58:16 2017 -0500 Take into account the fact that ScDocument already has one sheet. ScDocument already has one sheet upon creation, so we need to avoid appending sheet when the request is for the first sheet. Change-Id: Ie5526d6791e545f5faa0bf3f16988351c09e94c8 Reviewed-on: https://gerrit.libreoffice.org/46658 Tested-by: Jenkins Reviewed-by: Kohei Yoshida diff --git a/sc/inc/documentimport.hxx b/sc/inc/documentimport.hxx index 00496cdaac2b..03f415c381cc 100644 --- a/sc/inc/documentimport.hxx +++ b/sc/inc/documentimport.hxx @@ -87,6 +87,7 @@ public: SCTAB getSheetIndex(const OUString& rName) const; SCTAB getSheetCount() const; bool appendSheet(const OUString& rName); +void setSheetName(SCTAB nTab, const OUString& rName); void setOriginDate(sal_uInt16 nYear, sal_uInt16 nMonth, sal_uInt16 nDay); diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx index c46f1b09c95d..c41e134558bf 100644 --- a/sc/source/core/data/documentimport.cxx +++ b/sc/source/core/data/documentimport.cxx @@ -167,6 +167,11 @@ bool ScDocumentImport::appendSheet(const OUString& rName) return true; } +void ScDocumentImport::setSheetName(SCTAB nTab, const OUString& rName) +{ +mpImpl->mrDoc.SetTabNameOnLoad(nTab, rName); +} + void ScDocumentImport::setOriginDate(sal_uInt16 nYear, sal_uInt16 nMonth, sal_uInt16 nDay) { if (!mpImpl->mrDoc.pDocOptions) diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index 4a2f5567f583..eff9570e66c3 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -85,9 +85,19 @@ ScOrcusFactory::ScOrcusFactory(ScDocument& rDoc) : mnProgress(0) {} orcus::spreadsheet::iface::import_sheet* ScOrcusFactory::append_sheet( -orcus::spreadsheet::sheet_t /*sheet_index*/, const char* sheet_name, size_t sheet_name_length) +orcus::spreadsheet::sheet_t sheet_index, const char* sheet_name, size_t sheet_name_length) { OUString aTabName(sheet_name, sheet_name_length, RTL_TEXTENCODING_UTF8); + +if (sheet_index == 0) +{ +// The calc document initializes with one sheet already present. +assert(maDoc.getSheetCount() == 1); +maDoc.setSheetName(0, aTabName); +maSheets.push_back(o3tl::make_unique(maDoc, 0, *this)); +return maSheets.back().get(); +} + if (!maDoc.appendSheet(aTabName)) return nullptr; diff --git a/sc/source/filter/orcus/orcusfiltersimpl.cxx b/sc/source/filter/orcus/orcusfiltersimpl.cxx index fbbdd0b64e53..8683749fdd7c 100644 --- a/sc/source/filter/orcus/orcusfiltersimpl.cxx +++ b/sc/source/filter/orcus/orcusfiltersimpl.cxx @@ -55,7 +55,7 @@ uno::Reference getStatusIndicator(const SfxMedium& rMedi return xStatusIndicator; } -bool loadFileContent(ScDocument& rDoc, SfxMedium& rMedium, orcus::iface::import_filter& filter) +bool loadFileContent(SfxMedium& rMedium, orcus::iface::import_filter& filter) { SvStream* pStream = rMedium.GetInStream(); pStream->Seek(0); @@ -72,7 +72,6 @@ bool loadFileContent(ScDocument& rDoc, SfxMedium& rMedium, orcus::iface::import_ try { -rDoc.ClearTabs(); filter.read_stream(aBuffer.getStr(), aBuffer.getLength()); } catch (const std::exception& e) @@ -98,7 +97,7 @@ bool ScOrcusFiltersImpl::importCSV(ScDocument& rDoc, SfxMedium& rMedium) const aFactory.setStatusIndicator(getStatusIndicator(rMedium)); orcus::orcus_csv filter(&aFactory); -return loadFileContent(rDoc, rMedium, filter); +return loadFileContent(rMedium, filter); } bool ScOrcusFiltersImpl::importGnumeric(ScDocument& rDoc, SfxMedium& rMedium) const @@ -107,7 +106,7 @@ bool ScOrcusFiltersImpl::importGnumeric(ScDocument& rDoc, SfxMedium& rMedium) co aFactory.setStatusIndicator(getStatusIndicator(rMedium)); orcus::orcus_gnumeric filter(&aFactory); -return loadFileContent(rDoc, rMedium, filter); +return loadFileContent(rMedium, filter); } bool ScOrcusFiltersImpl::importExcel2003XML(ScDocument& rDoc, SfxMedium& rMedium) const @@ -116,7 +115,7 @@ bool ScOrcusFiltersImpl::importExcel2003XML(ScDocument& rDoc, SfxMedium& rMedium aFactory.setStatusIndicator(getStatusIndicator(rMedium)); orcus::orcus_xls_xml filter(&aFactory); -return loadFileContent(rDoc, rMedium, filter); +return loadFileContent(rMedium, filter); } bool ScOrcusFiltersImpl::importXLSX(ScDocument& rDoc, SfxMedium& rMedium) const @@ -125,7 +124,7 @@ bool ScOrcusFiltersIm
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/document.hxx | 10 +-- sc/source/core/data/documen2.cxx | 26 sc/source/core/data/documen5.cxx | 42 ++--- sc/source/core/data/documen8.cxx | 42 ++--- sc/source/core/data/documen9.cxx | 122 +++ sc/source/core/data/document.cxx | 26 6 files changed, 134 insertions(+), 134 deletions(-) New commits: commit 3ce229678a338b06f6d826a4c79cb80d79b51956 Author: Tor Lillqvist Date: Tue Sep 12 12:35:04 2017 +0300 Prefix one more member of ScDocument: pDrawLayer Change-Id: I8b2fdca8a58db6c6633d7708ed42ca218799c53b diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index c9a68c40a74e..d9c7a42970ae 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -323,7 +323,7 @@ private: SfxObjectShell* mpShell; VclPtr mpPrinter; VclPtr mpVirtualDevice_100th_mm; -ScDrawLayer*pDrawLayer; // SdrModel +ScDrawLayer*mpDrawLayer;// SdrModel rtl::Reference pColorList; ScValidationDataList* pValidationList; // validity SvNumberFormatterIndexTable*pFormatExchangeList;// for application of number formats @@ -933,8 +933,8 @@ public: SfxBindings*GetViewBindings(); SfxObjectShell* GetDocumentShell() const{ return mpShell; } -SC_DLLPUBLIC ScDrawLayer* GetDrawLayer() { return pDrawLayer; } -SC_DLLPUBLIC const ScDrawLayer* GetDrawLayer() const { return pDrawLayer; } +SC_DLLPUBLIC ScDrawLayer* GetDrawLayer() { return mpDrawLayer; } +SC_DLLPUBLIC const ScDrawLayer* GetDrawLayer() const { return mpDrawLayer; } SfxBroadcaster* GetDrawBroadcaster(); // to avoid header voidBeginDrawUndo(); diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 8f2200d24df7..d6b7a03d14c0 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -141,7 +141,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) : mpShell( pDocShell ), mpPrinter( nullptr ), mpVirtualDevice_100th_mm( nullptr ), -pDrawLayer( nullptr ), +mpDrawLayer( nullptr ), pValidationList( nullptr ), pFormatExchangeList( nullptr ), pRangeName(nullptr), @@ -628,7 +628,7 @@ bool ScDocument::GetPrintArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow, if (ValidTab(nTab) && nTab < static_cast(maTabs.size()) && maTabs[nTab]) { bool bAny = maTabs[nTab]->GetPrintArea( rEndCol, rEndRow, bNotes ); -if (pDrawLayer) +if (mpDrawLayer) { ScRange aDrawRange(0,0,nTab, MAXCOL,MAXROW,nTab); if (DrawGetPrintArea( aDrawRange, true, true )) @@ -652,7 +652,7 @@ bool ScDocument::GetPrintAreaHor( SCTAB nTab, SCROW nStartRow, SCROW nEndRow, if (ValidTab(nTab) && nTab < static_cast(maTabs.size()) && maTabs[nTab]) { bool bAny = maTabs[nTab]->GetPrintAreaHor( nStartRow, nEndRow, rEndCol ); -if (pDrawLayer) +if (mpDrawLayer) { ScRange aDrawRange(0,nStartRow,nTab, MAXCOL,nEndRow,nTab); if (DrawGetPrintArea( aDrawRange, true, false )) @@ -674,7 +674,7 @@ bool ScDocument::GetPrintAreaVer( SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol, if (ValidTab(nTab) && nTab < static_cast(maTabs.size()) && maTabs[nTab]) { bool bAny = maTabs[nTab]->GetPrintAreaVer( nStartCol, nEndCol, rEndRow, bNotes ); -if (pDrawLayer) +if (mpDrawLayer) { ScRange aDrawRange(nStartCol,0,nTab, nEndCol,MAXROW,nTab); if (DrawGetPrintArea( aDrawRange, false, true )) @@ -695,7 +695,7 @@ bool ScDocument::GetDataStart( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow ) if (ValidTab(nTab) && nTab < static_cast(maTabs.size()) && maTabs[nTab]) { bool bAny = maTabs[nTab]->GetDataStart( rStartCol, rStartRow ); -if (pDrawLayer) +if (mpDrawLayer) { ScRange aDrawRange(0,0,nTab, MAXCOL,MAXROW,nTab); if (DrawGetPrintArea( aDrawRange, true, true )) @@ -810,8 +810,8 @@ bool ScDocument::MoveTab( SCTAB nOldPos, SCTAB nNewPos, ScProgress* pProgress ) sc::SetFormulaDirtyContext aFormulaDirtyCxt; SetAllFormulasDirty(aFormulaDirtyCxt); -if (pDrawLayer) -pDrawLayer->ScMovePage( static_cast(nOldPos), static_cast(nNewPos) ); +if (mpDrawLayer) +mpDrawLayer->ScMovePage( static_cast(nOldPos), static_cast(nNewPos) ); bValid = true; } @@ -940,9 +940,9 @@ bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM sc::SetFormulaDirtyContext aFormulaDirtyCxt; SetAllFormulasDirty(aFormulaDirtyCxt); -if (pDrawLayer
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source svtools/source
sc/inc/docuno.hxx|3 sc/source/ui/unoobj/docuno.cxx | 154 ++- svtools/source/filter/DocumentToGraphicRenderer.cxx |8 svtools/source/filter/GraphicExportOptionsDialog.cxx |7 4 files changed, 130 insertions(+), 42 deletions(-) New commits: commit 8c0c897c8cb92285e6461cc99ab0f2bbe15be65f Author: Eike Rathke Date: Tue Aug 29 11:15:57 2017 +0200 Export to PNG: init DPI with screen resolution, tdf#108317 This whole concept of "use a JPG dialog for PNG export" is nonsense anyway, but.. as long as there isn't anything better at least have sensible defaults. Change-Id: I0c074f7bb2989122aed039c739fd1813f371cbca diff --git a/svtools/source/filter/GraphicExportOptionsDialog.cxx b/svtools/source/filter/GraphicExportOptionsDialog.cxx index cb7928ad104e..cb7cb64c919e 100644 --- a/svtools/source/filter/GraphicExportOptionsDialog.cxx +++ b/svtools/source/filter/GraphicExportOptionsDialog.cxx @@ -18,6 +18,7 @@ */ #include +#include using namespace css::beans; using namespace css::lang; @@ -61,6 +62,12 @@ void GraphicExportOptionsDialog::initialize() { mCurrentPage = mRenderer.getCurrentPageWriter(); mSize100mm = mRenderer.getDocumentSizeIn100mm(mCurrentPage); +// Init DPI with screen resolution, taking width. This may lead to unusual +// DPI values but ensures a size in pixels that matches the actual screen +// content, which is vital for example for Calc with drawing layer and +// pixel images. +Size aSizePixels = Application::GetDefaultDevice()->LogicToPixel( mSize100mm, MapUnit::Map100thMM ); +mResolution = aSizePixels.Width() / getViewWidthInch(); } IMPL_LINK_NOARG( GraphicExportOptionsDialog, widthModifiedHandle, Edit&, void ) commit d34fa1fc643cc49253e7340b3de1c87a49875e8a Author: Eike Rathke Date: Tue Aug 29 11:09:34 2017 +0200 Export to PNG: export selected cell range only, not as page, tdf#108317 Change-Id: If662f4ed360c702e572fc5d7b473eb53b9cb14d2 diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx index 00ff88999bd0..67ee07440884 100644 --- a/sc/inc/docuno.hxx +++ b/sc/inc/docuno.hxx @@ -106,7 +106,8 @@ private: boolFillRenderMarkData( const css::uno::Any& aSelection, const css::uno::Sequence< css::beans::PropertyValue >& rOptions, -ScMarkData& rMark, ScPrintSelectionStatus& rStatus, OUString& rPagesStr ) const; +ScMarkData& rMark, ScPrintSelectionStatus& rStatus, OUString& rPagesStr, +bool& rbRenderToGraphic ) const; css::uno::Reference const & GetFormatter(); voidHandleCalculateEvents(); diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 67659f7076e4..b7b55293edd9 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -1432,7 +1432,8 @@ static bool lcl_ParseTarget( const OUString& rTarget, ScRange& rTargetRange, too bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection, const uno::Sequence< beans::PropertyValue >& rOptions, ScMarkData& rMark, - ScPrintSelectionStatus& rStatus, OUString& rPagesStr ) const + ScPrintSelectionStatus& rStatus, OUString& rPagesStr, + bool& rbRenderToGraphic ) const { OSL_ENSURE( !rMark.IsMarked() && !rMark.IsMultiMarked(), "FillRenderMarkData: MarkData must be empty" ); OSL_ENSURE( pDocShell, "FillRenderMarkData: DocShell must be set" ); @@ -1477,6 +1478,10 @@ bool ScModelObj::FillRenderMarkData( const uno::Any& aSelection, { rOptions[i].Value >>= xView; } +else if ( rOptions[i].Name == "RenderToGraphic" ) +{ +rOptions[i].Value >>= rbRenderToGraphic; +} } // "Print Content" selection wins over "Selected Sheets" option @@ -1613,7 +1618,8 @@ sal_Int32 SAL_CALL ScModelObj::getRendererCount(const uno::Any& aSelection, ScMarkData aMark; ScPrintSelectionStatus aStatus; OUString aPagesStr; -if ( !FillRenderMarkData( aSelection, rOptions, aMark, aStatus, aPagesStr ) ) +bool bRenderToGraphic = false; +if ( !FillRenderMarkData( aSelection, rOptions, aMark, aStatus, aPagesStr, bRenderToGraphic ) ) return 0; // The same ScPrintFuncCache object in pPrintFuncCache is used as long as @@ -1650,6 +1656,11 @@ static sal_Int32 lcl_GetRendererNum( sal_Int32 nSelRenderer, const OUString& rPa return *aIter; // returns -1 if reached the end } +static bool lcl_renderSelectionToGraphic( bool bRenderToGraphic, const ScPrintSelectionStatus& rStatus ) +{ +retur
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source uui/source vcl/headless xmlsecurity/source
sc/inc/sc.hrc | 38 ++--- sc/source/ui/cctrl/checklistmenu.cxx | 18 ++ sc/source/ui/cctrl/checklistmenu.src | 14 +--- sc/source/ui/navipi/navipi.cxx |8 +- sc/source/ui/navipi/navipi.src | 24 sc/source/ui/pagedlg/pagedlg.hrc |5 - sc/source/ui/pagedlg/pagedlg.src | 17 +++-- sc/source/ui/pagedlg/tptable.cxx |2 sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx | 20 +++--- sc/source/ui/sidebar/CellAppearancePropertyPanel.src | 49 ++--- sc/source/ui/xmlsource/xmlsourcedlg.cxx|6 +- uui/source/iahndl-ssl.cxx | 23 +-- vcl/headless/svpgdi.cxx|2 xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.cxx | 46 +++ xmlsecurity/source/xmlsec/nss/sanextension_nssimpl.hxx |3 - 15 files changed, 139 insertions(+), 136 deletions(-) New commits: commit 4e9cfc178c47893229f8030bfe73e2b7c5de92c3 Author: Caolán McNamara Date: Thu Jan 19 10:01:25 2017 + Resolves: tdf#105416 blank windows under HiDPI RTL Change-Id: I819f06babd448c37ce2d58297562b640aba1c8c6 diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index de5596f..9828147 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -409,7 +409,7 @@ sal_uInt16 SvpSalGraphics::GetBitCount() const long SvpSalGraphics::GetGraphicsWidth() const { -return m_pSurface ? cairo_image_surface_get_width(m_pSurface) : 0; +return m_pSurface ? cairo_image_surface_get_width(m_pSurface) / m_fScale : 0; } void SvpSalGraphics::ResetClipRegion() commit f0421b64cb66709b09ef836129cdf77ccd60243e Author: Caolán McNamara Date: Thu Jan 19 09:38:10 2017 + sc: load BitmapEx resources instead of Image ones Change-Id: If10ae4238a580ab6d19287968aecbf29acbd550e diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 98053e5..3bd2e75 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -994,25 +994,25 @@ #define BMP_START (STR_END) // navigator -#define RID_IMG_DROP_URL(BMP_START + 2) -#define RID_IMG_DROP_LINK (BMP_START + 3) -#define RID_IMG_DROP_COPY (BMP_START + 4) -#define RID_IMG_SELECT_CURRENT (BMP_START + 8) -#define RID_IMG_UNSELECT_CURRENT (BMP_START + 9) - -#define IMG_CELL_BORDER (BMP_START + 10) -#define IMG_LINE_STYLE1 (BMP_START + 11) -#define IMG_LINE_STYLE2 (BMP_START + 12) -#define IMG_LINE_STYLE3 (BMP_START + 13) -#define IMG_LINE_STYLE4 (BMP_START + 14) -#define IMG_LINE_STYLE5 (BMP_START + 15) -#define IMG_LINE_STYLE6 (BMP_START + 16) -#define IMG_LINE_STYLE7 (BMP_START + 17) -#define IMG_LINE_STYLE8 (BMP_START + 18) -#define IMG_LINE_STYLE9 (BMP_START + 19) -#define IMG_ELEMENT_DEFAULT (BMP_START + 20) -#define IMG_ELEMENT_REPEAT (BMP_START + 21) -#define IMG_ELEMENT_ATTRIBUTE (BMP_START + 22) +#define RID_BMP_DROP_URL(BMP_START + 2) +#define RID_BMP_DROP_LINK (BMP_START + 3) +#define RID_BMP_DROP_COPY (BMP_START + 4) +#define RID_BMP_SELECT_CURRENT (BMP_START + 8) +#define RID_BMP_UNSELECT_CURRENT (BMP_START + 9) + +#define RID_BMP_CELL_BORDER (BMP_START + 10) +#define RID_BMP_LINE_STYLE1 (BMP_START + 11) +#define RID_BMP_LINE_STYLE2 (BMP_START + 12) +#define RID_BMP_LINE_STYLE3 (BMP_START + 13) +#define RID_BMP_LINE_STYLE4 (BMP_START + 14) +#define RID_BMP_LINE_STYLE5 (BMP_START + 15) +#define RID_BMP_LINE_STYLE6 (BMP_START + 16) +#define RID_BMP_LINE_STYLE7 (BMP_START + 17) +#define RID_BMP_LINE_STYLE8 (BMP_START + 18) +#define RID_BMP_LINE_STYLE9 (BMP_START + 19) +#define RID_BMP_ELEMENT_DEFAULT (BMP_START + 20) +#define RID_BMP_ELEMENT_REPEAT (BMP_START + 21) +#define RID_BMP_ELEMENT_ATTRIBUTE (BMP_START + 22) #define RID_BMP_LEVEL1 (BMP_START + 23) #define RID_BMP_LEVEL2 (BMP_START + 24) #define RID_BMP_LEVEL3 (BMP_START + 25) diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index d32ac8b..d997653 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -1096,13 +1096,10 @@ void ScCheckListMenuWindow::packWindow() float fScaleFactor = GetDPIScaleFactor(); -Image aSingleSelect(ScResId(RID_IMG_SELECT_CURRENT)); +BitmapEx aSingleSelectBmp(ScResId(RID_BMP_SELECT_CURRENT)); if (fScaleFactor > 1) -{ -BitmapEx aBitmap = aSingleSelect.GetBitmapEx(); -aBitmap.Scale(fScaleFactor, fScaleFactor, BmpScaleFlag::Fast); -aSingleSelect = Image(aBitmap); -} +aSingleSelectBmp.Scale(fScaleFactor, fScaleFactor, BmpScaleFlag::Fast); +Image aSingleSelect(aSingleSelectBmp); getSectionPosS
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/compiler.hxx | 15 +-- sc/source/core/tool/token.cxx |5 + 2 files changed, 6 insertions(+), 14 deletions(-) New commits: commit dcc56d663059b3baced58e34bb8186a05ceadf53 Author: Eike Rathke Date: Thu Sep 1 14:16:03 2016 +0200 remove now pointless comment about alignment boundaries ... and adapt ScRawToken size comment to reality. Change-Id: Ia9c1cecc5d01f49c6d5fbe5b53472e6f0ef153cb diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 1e68576..ba91d2a 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -204,10 +204,7 @@ namespace } // namespace -// Align MemPools on 4k boundaries - 64 bytes (4k is a MUST for OS/2) - -// Since RawTokens are temporary for the compiler, don't align on 4k and waste memory. -// ScRawToken size is FixMembers + MAXSTRLEN + ~4 ~= 1036 +// ScRawToken size is OpCode + StackVar + MAXSTRLEN+1 + ~20 ~= 1049 IMPL_FIXEDMEMPOOL_NEWDEL( ScRawToken ) // Need a whole bunch of ScSingleRefToken commit f684d1edfd48b686549b893dc0612c31d9617bdc Author: Eike Rathke Date: Thu Sep 1 13:48:51 2016 +0200 cosmetics Change-Id: I22d4c04db2917f96e3c9ca1a71c628e859ad13c5 diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx index ba32974..14e760e 100644 --- a/sc/inc/compiler.hxx +++ b/sc/inc/compiler.hxx @@ -91,7 +91,6 @@ class CompileFormulaContext; // constants and data types internal to compiler - struct ScRawToken { friend class ScCompiler; @@ -99,19 +98,19 @@ struct ScRawToken // the private dtor) and know what they're doing.. friend class ScTokenArray; protected: -OpCode eOp; -formula::StackVar eType;// type of data; this determines how the unions are used +OpCode eOp; +formula::StackVar eType; // type of data; this determines how the unions are used public: union { double nValue; struct { -sal_uInt8cByte; +sal_uInt8 cByte; boolbIsInForceArray; } sbyte; ScComplexRefData aRef; struct { -sal_uInt16 nFileId; -sal_Unicode cTabName[MAXSTRLEN+1]; +sal_uInt16 nFileId; +sal_Unicode cTabName[MAXSTRLEN+1]; ScComplexRefDataaRef; } extref; struct { commit ce23f28157e8925be815d7e7340e229e4302ce15 Author: Eike Rathke Date: Thu Sep 1 13:32:12 2016 +0200 move comment to where it belongs Change-Id: Ia3110b911e6d367a3b5d246a95384efc2f72f9f8 diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx index 849e8ca..ba32974 100644 --- a/sc/inc/compiler.hxx +++ b/sc/inc/compiler.hxx @@ -91,10 +91,6 @@ class CompileFormulaContext; // constants and data types internal to compiler -/* -OpCode eOp;// OpCode -formula::StackVar eType; // type of data - */ struct ScRawToken { @@ -104,7 +100,7 @@ struct ScRawToken friend class ScTokenArray; protected: OpCode eOp; -formula::StackVar eType; +formula::StackVar eType;// type of data; this determines how the unions are used public: union { double nValue; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/scmatrix.hxx |6 sc/source/core/tool/interpr4.cxx |4 +-- sc/source/core/tool/scmatrix.cxx | 48 ++- 3 files changed, 46 insertions(+), 12 deletions(-) New commits: commit 68455c20cb5edf2bfc57243b44fc81b7fa5ea5db Author: Eike Rathke Date: Wed Jun 15 20:49:31 2016 +0200 set string conversion error also at interpreter if available Change-Id: Idedb9192938a01ecfda3dd93e69c16a896801fd7 diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index 59787d9..7133004 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -77,7 +77,10 @@ double convertStringToValue( ScInterpreter* pErrorInterpreter, const OUString& r short nCurFmtType = 0; double fValue = pErrorInterpreter->ConvertStringToValue( rStr, nError, nCurFmtType); if (nError) +{ +pErrorInterpreter->SetError( nError); return formula::CreateDoubleError( nError); +} return fValue; } return formula::CreateDoubleError( formula::errNoValue); commit f219bd4c3599e0933760f8a9f0155fc97a9ab23c Author: Eike Rathke Date: Wed Jun 15 16:45:32 2016 +0200 Resolves: tdf#100409 GetDoubleWithStringConversion() in GetDoubleFromMatrix() Change-Id: I1e88e9fa6361c6f1f2aebebc101d44bc8e974283 diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index f5138bb..c773f7b 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -1989,14 +1989,14 @@ double ScInterpreter::GetDoubleFromMatrix(const ScMatrixRef& pMat) return 0.0; if ( !pJumpMatrix ) -return pMat->GetDouble( 0 ); +return pMat->GetDoubleWithStringConversion( 0, 0); SCSIZE nCols, nRows, nC, nR; pMat->GetDimensions( nCols, nRows); pJumpMatrix->GetPos( nC, nR); // Use vector replication for single row/column arrays. if ( (nC < nCols || nCols == 1) && (nR < nRows || nRows == 1) ) -return pMat->GetDouble( nC, nR); +return pMat->GetDoubleWithStringConversion( nC, nR); SetError( errNoValue); return 0.0; commit 481b8589d135baced12469bec4ee734b23faac21 Author: Eike Rathke Date: Wed Jun 15 16:28:44 2016 +0200 introduce ScMatrix::GetDoubleWithStringConversion() preparing for tdf#100409 ... as GetDouble() returns 0.0 for any string and we don't want to change that, most relevant places already check for numeric/text beforehand. Change-Id: Ifbc04e892f6f504040026042faa38674ced880fb diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx index aacb9ce..a5c810f 100644 --- a/sc/inc/scmatrix.hxx +++ b/sc/inc/scmatrix.hxx @@ -306,6 +306,8 @@ public: virtual double GetDouble( SCSIZE nC, SCSIZE nR) const = 0; /// @return 0.0 if empty or empty path, else value or DoubleError. virtual double GetDouble( SCSIZE nIndex) const = 0; +/// @return value or DoubleError or string converted to value. +virtual double GetDoubleWithStringConversion( SCSIZE nC, SCSIZE nR ) const = 0; /// @return empty string if empty or empty path, else string content. virtual svl::SharedString GetString( SCSIZE nC, SCSIZE nR) const = 0; @@ -517,6 +519,8 @@ public: virtual double GetDouble( SCSIZE nC, SCSIZE nR) const override; /// @return 0.0 if empty or empty path, else value or DoubleError. virtual double GetDouble( SCSIZE nIndex) const override; +/// @return value or DoubleError or string converted to value. +virtual double GetDoubleWithStringConversion( SCSIZE nC, SCSIZE nR ) const override; /// @return empty string if empty or empty path, else string content. virtual svl::SharedString GetString( SCSIZE nC, SCSIZE nR) const override; @@ -731,6 +735,8 @@ public: virtual double GetDouble(SCSIZE nC, SCSIZE nR) const override; /// @return 0.0 if empty or empty path, else value or DoubleError. virtual double GetDouble(SCSIZE nIndex) const override; +/// @return value or DoubleError or string converted to value. +virtual double GetDoubleWithStringConversion( SCSIZE nC, SCSIZE nR ) const override; /// @return empty string if empty or empty path, else string content. virtual svl::SharedString GetString(SCSIZE nC, SCSIZE nR) const override; diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index a693aba..59787d9 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -69,6 +69,20 @@ typedef mdds::multi_type_matrix MatrixImplType; namespace { +double convertStringToValue( ScInterpreter* pErrorInterpreter, const OUString& rStr ) +{ +if (pErrorInterpreter) +{ +sal_uInt16 nError = 0; +short nCurFmtType = 0; +double fValue = pErrorInterpreter->ConvertStringToValue( rStr, nError, nCurFmtType); +if (nError) +return formula::CreateDoubl
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/document.hxx | 83 sc/source/core/data/document10.cxx | 356 ++ sc/source/core/data/formulacell.cxx | 372 3 files changed, 444 insertions(+), 367 deletions(-) New commits: commit 37b071c9330d28f08d5a9f7bf11e577040925684 Author: Eike Rathke Date: Thu Apr 28 22:42:14 2016 +0200 move to ScDocument::CopyAdjustRangeName() and namespace Change-Id: I1ec3c8cc1b8d3cb899d49192295b14ffac02849a diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index bb46e2d..a38279f 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -600,6 +600,40 @@ public: SCTAB nGlobalRefTab, SCTAB nLocalRefTab, SCTAB nOldTokenTab, SCTAB nOldTokenTabReplacement, bool bSameDoc, int nRecursion ) const; +/** If necessary (name references sheet rOldPos.Tab()) copy and adjust +named expression/range from sheet-local to sheet-local, or global to +sheet-local if bGlobalNamesToLocal==true. + +Also copies nested names and adjusts the ocName tokens of the calling name. + +@param rSheet +On entry, the original sheet of the named expression/range, <0 global. +On return TRUE, the new sheet. Else unchanged. + +@param rIndex +On entry, the original index of the named expression/range. +On return TRUE, the new index, or 0 if a new copied name couldn't be inserted. Else unchanged. + +@param rpRangeData +On entry, the pointer to the original named expression/range. +On return TRUE, the pointer to the new copied name, or nullptr if hit shappened. + +@param rNewPos +New position of formula cell if called for that, else new base +position of a to be created new name adjusted for Tab. +rNewPos.nTab MUST point to the new sheet copied to. + +@param rOldPos +Old position of formula cell if called for that, else base +position of the existing name adjusted for Tab. +rOldPos.nTab MUST point to the old sheet copied from. + +@return TRUE if copied and caller may need to evaluate rpRangeData and rSheet and rIndex. +FALSE if nothing to be done. + */ +bool CopyAdjustRangeName( SCTAB& rSheet, sal_uInt16& rIndex, ScRangeData*& rpRangeData, ScDocument& rNewDoc, +const ScAddress& rNewPos, const ScAddress& rOldPos, const bool bGlobalNamesToLocal) const; + /** * Call this immediately before updating all named ranges. */ diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx index 80375b8..f7ed6e8 100644 --- a/sc/source/core/data/document10.cxx +++ b/sc/source/core/data/document10.cxx @@ -513,4 +513,296 @@ bool ScDocument::FindRangeNamesReferencingSheet( sc::UpdatedRangeNames& rIndexes return bRef; } +namespace { + +enum MightReferenceSheet +{ +UNKNOWN, +NONE, +CODE, +NAME +}; + +MightReferenceSheet mightRangeNameReferenceSheet( ScRangeData* pData, SCTAB nRefTab) +{ +ScTokenArray* pCode = pData->GetCode(); +if (!pCode) +return MightReferenceSheet::NONE; + +for (const formula::FormulaToken* p = pCode->First(); p; p = pCode->Next()) +{ +if (p->GetOpCode() == ocName) +return MightReferenceSheet::NAME; +} + +return pCode->ReferencesSheet( nRefTab, pData->GetPos().Tab()) ? +MightReferenceSheet::CODE : MightReferenceSheet::NONE; +} + +ScRangeData* copyRangeName( const ScRangeData* pOldRangeData, ScDocument& rNewDoc, const ScDocument* pOldDoc, +const ScAddress& rNewPos, const ScAddress& rOldPos, bool bGlobalNamesToLocal, +SCTAB nOldSheet, const SCTAB nNewSheet, bool bSameDoc) +{ +ScAddress aRangePos( pOldRangeData->GetPos()); +if (nNewSheet >= 0) +aRangePos.SetTab( nNewSheet); +ScRangeData* pRangeData = new ScRangeData(*pOldRangeData, &rNewDoc, &aRangePos); +pRangeData->SetIndex(0);// needed for insert to assign a new index +ScTokenArray* pRangeNameToken = pRangeData->GetCode(); +if (bSameDoc && nNewSheet >= 0) +{ +if (bGlobalNamesToLocal && nOldSheet < 0) +{ +nOldSheet = rOldPos.Tab(); +if (rNewPos.Tab() <= nOldSheet) +// Sheet was inserted before and references already updated. +++nOldSheet; +} +pRangeNameToken->AdjustSheetLocalNameReferences( nOldSheet, nNewSheet); +} +if (!bSameDoc) +{ +pRangeNameToken->ReadjustAbsolute3DReferences(pOldDoc, &rNewDoc, pRangeData->GetPos(), true); +pRangeNameToken->AdjustAbsoluteRefs(pOldDoc, rOldPos, rNewPos, true); +} + +bool bInserted; +if (nNewSheet < 0) +bInserted = rNewDoc.GetRangeName()->insert(pRangeData); +else +bInserted = rNewDoc.Get
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/document.hxx |6 - sc/source/core/data/conditio.cxx|2 sc/source/core/data/documen3.cxx|2 sc/source/core/data/formulacell.cxx | 119 sc/source/core/data/validat.cxx |2 sc/source/core/tool/compiler.cxx|2 6 files changed, 75 insertions(+), 58 deletions(-) New commits: commit f5cd030ee0d15ae0519d68b8675773ce0b223a36 Author: Eike Rathke Date: Wed Apr 27 20:04:47 2016 +0200 extract adjustCopyRangeName() from adjustRangeName() Change-Id: I1dd41a4fe96187750d4269e732ca39c19de3c060 diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 7949010..280c1eb 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -636,22 +636,25 @@ ScRangeData* copyRangeNames( SheetIndexMap& rSheetIndexMap, std::vector(pOldDoc)->GetPool()); -const SCTAB nOldSheet = pToken->GetSheet(); +const bool bSameDoc = (rNewDoc.GetPool() == const_cast(pOldDoc)->GetPool()); if (bSameDoc && ((nOldSheet < 0 && !bGlobalNamesToLocal) || (nOldSheet >= 0 && nOldSheet != rOldPos.Tab( // Same doc and global name, if not copied to local name, or // sheet-local name on other sheet stays the same. -return; +return false; SAL_WARN_IF( !bSameDoc && nOldSheet >= 0 && nOldSheet != rOldPos.Tab(), -"sc.core", "adjustRangeName - sheet-local name was on other sheet in other document"); +"sc.core", "adjustCopyRangeName - sheet-local name was on other sheet in other document"); /* TODO: can we do something about that? e.g. loop over sheets? */ OUString aRangeName; -const sal_uInt16 nOldIndex = pToken->GetIndex(); ScRangeData* pOldRangeData = nullptr; // XXX bGlobalNamesToLocal is also a synonym for copied sheet. @@ -673,42 +676,41 @@ void adjustRangeName(formula::FormulaToken* pToken, ScDocument& rNewDoc, const S const ScRangeName* pRangeName = pOldDoc->GetRangeName(nOldTab); pOldRangeData = pRangeName ? pRangeName->findByIndex(nOldIndex) : nullptr; if (!pOldRangeData) -return; // might be an error in the formula array +return false; // might be an error in the formula array aRangeName = pOldRangeData->GetUpperName(); } else { pOldRangeData = pOldDoc->GetRangeName()->findByIndex(nOldIndex); if (!pOldRangeData) -return; // might be an error in the formula array +return false; // might be an error in the formula array aRangeName = pOldRangeData->GetUpperName(); } // Find corresponding range name in new document. // First search for local range name then global range names. -SCTAB nNewSheet = rNewPos.Tab(); -ScRangeName* pRangeName = rNewDoc.GetRangeName(nNewSheet); -ScRangeData* pRangeData = nullptr; +rNewSheet = rNewPos.Tab(); +ScRangeName* pRangeName = rNewDoc.GetRangeName(rNewSheet); // Search local range names. if (pRangeName) { -pRangeData = pRangeName->findByUpperName(aRangeName); +rpRangeData = pRangeName->findByUpperName(aRangeName); } // Search global range names. -if (!pRangeData && !bGlobalNamesToLocal) +if (!rpRangeData && !bGlobalNamesToLocal) { -nNewSheet = -1; +rNewSheet = -1; pRangeName = rNewDoc.GetRangeName(); if (pRangeName) -pRangeData = pRangeName->findByUpperName(aRangeName); +rpRangeData = pRangeName->findByUpperName(aRangeName); } // If no range name was found copy it. -if (!pRangeData) +if (!rpRangeData) { bool bEarlyBailOut = (nOldSheet < 0 && bSameDoc); MightReferenceSheet eMightReference = mightRangeNameReferenceSheet( pOldRangeData, nOldTab); if (bEarlyBailOut && eMightReference == MightReferenceSheet::NONE) -return; +return false; if (eMightReference == MightReferenceSheet::NAME) { @@ -721,17 +723,17 @@ void adjustRangeName(formula::FormulaToken* pToken, ScDocument& rNewDoc, const S findRangeNamesReferencingSheet( aReferencingNames, nOldSheet, nOldIndex, pOldDoc, nGlobalRefTab, nLocalRefTab, nOldTokenTab, nOldTokenTabReplacement, bSameDoc, 0); if (bEarlyBailOut && aReferencingNames.isEmpty(-1) && aReferencingNames.isEmpty(nOldTokenTabReplacement)) -return; +return false; SheetIndexMap aSheetIndexMap; std::vector aRangeDataVec; if (!aReferencingNames.isEmpty(nOldTokenTabReplacement)) { const SCTAB nTmpOldSheet = (nOldSheet < 0 ? nOldTab : nOldSheet); -nNewSheet = rNewPos.Tab(); -pRangeData = copyRangeNames( aSheetIndexMap, aRangeDataVec, aReferencingNames, nOldTab, +
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/dpobject.hxx | 15 ++--- sc/source/core/data/dpobject.cxx | 93 +-- sc/source/filter/xml/pivotsource.cxx |2 3 files changed, 55 insertions(+), 55 deletions(-) New commits: commit def6b1dd14b7d7dbf776e3de9e2f2d5a0cd1fc2c Author: Michael Stahl Date: Fri Dec 18 17:20:56 2015 +0100 sc: replace boost::ptr_map with std::map Change-Id: Ia9d061d9f5fb07e07fd6253a6493a4e9b1f9c975 diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index 0af7348..610cf8e 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -35,8 +35,6 @@ #include #include -#include - namespace com { namespace sun { namespace star { namespace container { @@ -337,8 +335,8 @@ public: class DBCaches { friend class ScDPCollection; -typedef ::boost::ptr_map CachesType; -CachesType maCaches; +typedef ::std::map, DBType::less> CachesType; +CachesType m_Caches; ScDocument* mpDoc; public: DBCaches(ScDocument* pDoc); diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index f6fee9f..59dcd61 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -68,7 +68,6 @@ #include #include #include -#include #include #include #include @@ -3104,8 +3103,8 @@ ScDPCollection::DBCaches::DBCaches(ScDocument* pDoc) : mpDoc(pDoc) {} bool ScDPCollection::DBCaches::hasCache(sal_Int32 nSdbType, const OUString& rDBName, const OUString& rCommand) const { DBType aType(nSdbType, rDBName, rCommand); -CachesType::const_iterator itr = maCaches.find(aType); -return itr != maCaches.end(); +CachesType::const_iterator const itr = m_Caches.find(aType); +return itr != m_Caches.end(); } const ScDPCache* ScDPCollection::DBCaches::getCache( @@ -3113,10 +3112,10 @@ const ScDPCache* ScDPCollection::DBCaches::getCache( const ScDPDimensionSaveData* pDimData) { DBType aType(nSdbType, rDBName, rCommand); -CachesType::const_iterator itr = maCaches.find(aType); -if (itr != maCaches.end()) +CachesType::const_iterator const itr = m_Caches.find(aType); +if (itr != m_Caches.end()) // already cached. -return itr->second; +return itr->second.get(); uno::Reference xRowSet = createRowSet(nSdbType, rDBName, rCommand); if (!xRowSet.is()) @@ -3140,7 +3139,7 @@ const ScDPCache* ScDPCollection::DBCaches::getCache( ::comphelper::disposeComponent(xRowSet); const ScDPCache* p = pCache.get(); -o3tl::ptr_container::insert(maCaches, aType, std::move(pCache)); +m_Caches.insert(std::make_pair(aType, std::move(pCache))); return p; } @@ -3148,8 +3147,8 @@ ScDPCache* ScDPCollection::DBCaches::getExistingCache( sal_Int32 nSdbType, const OUString& rDBName, const OUString& rCommand) { DBType aType(nSdbType, rDBName, rCommand); -CachesType::iterator itr = maCaches.find(aType); -return itr != maCaches.end() ? itr->second : nullptr; +CachesType::iterator const itr = m_Caches.find(aType); +return itr != m_Caches.end() ? itr->second.get() : nullptr; } uno::Reference ScDPCollection::DBCaches::createRowSet( @@ -3215,8 +3214,8 @@ void ScDPCollection::DBCaches::updateCache( std::set& rRefs) { DBType aType(nSdbType, rDBName, rCommand); -CachesType::iterator it = maCaches.find(aType); -if (it == maCaches.end()) +CachesType::iterator const it = m_Caches.find(aType); +if (it == m_Caches.end()) { // not cached. rRefs.clear(); @@ -3255,12 +3254,12 @@ void ScDPCollection::DBCaches::updateCache( bool ScDPCollection::DBCaches::remove(const ScDPCache* p) { -CachesType::iterator it = maCaches.begin(), itEnd = maCaches.end(); +CachesType::iterator it = m_Caches.begin(), itEnd = m_Caches.end(); for (; it != itEnd; ++it) { -if (it->second == p) +if (it->second.get() == p) { -maCaches.erase(it); +m_Caches.erase(it); return true; } } diff --git a/sc/source/filter/xml/pivotsource.cxx b/sc/source/filter/xml/pivotsource.cxx index 43b5a4d..633b8c5 100644 --- a/sc/source/filter/xml/pivotsource.cxx +++ b/sc/source/filter/xml/pivotsource.cxx @@ -11,6 +11,8 @@ #include +#include + namespace sc { PivotTableSources::SelectedPages::SelectedPages( ScDPObject* pObj, const SelectedPagesType& rSelected ) : commit 91f571a2d6b0db016342fa2f2e5b7b83a23ae873 Author: Michael Stahl Date: Fri Dec 18 14:45:37 2015 +0100 sc: replace boost::ptr_map with std::map Change-Id: I5abc1d6fae7186342e45a83253d56c2311ec5139 diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index 646817e..0af7348 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -297,8 +297,8 @@ public: class NameCaches { friend class ScDPCollection; -typedef ::boost::ptr_map CachesType; -C
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/compiler.hxx |4 + sc/source/core/tool/compiler.cxx | 150 ++- 2 files changed, 106 insertions(+), 48 deletions(-) New commits: commit d6398719abecfca60db37637490e60992dc2 Author: Eike Rathke Date: Thu Apr 9 18:03:09 2015 +0200 TableRef: correct GetToken() logic Ensure that only desired tokens are obtained and the resulting new token is actually the current one upon return. Change-Id: I624c324b861d8658accf3285cad2cfc5a598b450 diff --git a/sc/inc/compiler.hxx b/sc/inc/compiler.hxx index 3154d57..03baa29 100644 --- a/sc/inc/compiler.hxx +++ b/sc/inc/compiler.hxx @@ -386,6 +386,9 @@ public: bool IsTableRefItem( const OUString& ) const; bool IsTableRefColumn( const OUString& ) const; +/** Calls GetToken() if PeekNextNoSpaces() is of given OpCode. */ +bool GetTokenIfOpCode( OpCode eOp ); + /** * When auto correction is set, the jump command reorder must be enabled. */ diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 4cf6f24..a988209 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -4820,6 +4820,14 @@ bool ScCompiler::HandleDbData() return true; } +bool ScCompiler::GetTokenIfOpCode( OpCode eOp ) +{ +const formula::FormulaToken* p = pArr->PeekNextNoSpaces(); +if (p && p->GetOpCode() == eOp) +return GetToken(); +return false; +} + /* Documentation on MS-Excel Table structured references: * https://support.office.com/en-us/article/Use-structured-references-in-Excel-table-formulas-75fb07d3-826a-449c-b76f-363057e3d16f @@ -4847,7 +4855,6 @@ bool ScCompiler::HandleTableRef() aDBRange.aEnd.SetTab(aDBRange.aStart.Tab()); ScRange aRange( aDBRange); ScTokenArray* pNew = new ScTokenArray(); -bool bGotToken = false; bool bAddRange = true; bool bForwardToClose = false; ScTableRefToken::Item eItem = pTR->GetItem(); @@ -4927,22 +4934,27 @@ bool ScCompiler::HandleTableRef() break; } bool bColumnRange = false; -if (bForwardToClose && (bGotToken = GetToken()) && mpToken->GetOpCode() == ocTableRefOpen) +int nLevel = 0; +if (bForwardToClose && GetTokenIfOpCode( ocTableRefOpen)) { -int nLevel = 1; +++nLevel; enum { sOpen, sItem, sClose, sSep, +sLast, sStop } eState = sOpen; do { -if ((bGotToken = GetToken())) +const formula::FormulaToken* p = pArr->PeekNextNoSpaces(); +if (!p) +eState = sStop; +else { -switch (mpToken->GetOpCode()) +switch (p->GetOpCode()) { case ocTableRefOpen: eState = ((eState == sOpen || eState == sSep) ? sOpen : sStop); @@ -4961,35 +4973,37 @@ bool ScCompiler::HandleTableRef() break; case ocTableRefClose: eState = ((eState == sItem || eState == sClose) ? sClose : sStop); -if (--nLevel <= 0) -{ -if (nLevel < 0) -SetError( errPair); -eState = sStop; -} +if (eState != sStop && --nLevel == 0) +eState = sLast; break; case ocSep: eState = ((eState == sClose) ? sSep : sStop); break; case ocPush: -if (eState == sOpen && -(mpToken->GetType() == svSingleRef || mpToken->GetType() == svDoubleRef)) +if (eState == sOpen && (p->GetType() == svSingleRef || p->GetType() == svDoubleRef)) +{ bColumnRange = true; -eState = sStop; +eState = sLast; +} +else +{ +eState = sStop; +} break; default: eState = sStop; } +if (eState != sStop) +GetToken(); +if (eState == sLast) +eState = sStop; } -} while (bGotToken && eState != sStop); -
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/dbdata.hxx|3 +++ sc/inc/token.hxx |4 +--- sc/source/core/tool/compiler.cxx | 36 +--- sc/source/core/tool/dbdata.cxx |6 ++ 4 files changed, 39 insertions(+), 10 deletions(-) New commits: commit c012af28e334c3f01430ec46e1d7b1ed87b55c54 Author: Eike Rathke Date: Tue Apr 7 23:08:08 2015 +0200 TableRef: implement more keyword cases Change-Id: Ib37bfb1b8721d3f6729ce5c312863ffa6a1f76d4 diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 5512e382..f3b68f5 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -4800,7 +4800,10 @@ bool ScCompiler::HandleTableRef() break; case ScTableRefToken::HEADERS: { -aRange.aEnd.SetRow( aRange.aStart.Row()); +if (pDBData->HasHeader()) +aRange.aEnd.SetRow( aRange.aStart.Row()); +else +bAddRange = false; bForwardToClose = true; } break; @@ -4808,9 +4811,11 @@ bool ScCompiler::HandleTableRef() { if (pDBData->HasHeader()) aRange.aStart.IncRow(); -/* TODO: this assumes totals to be present, they need to - * be implemented at the table. */ -if (aRange.aEnd.Row() - aRange.aStart.Row() >= 1) +} +// fallthru +case ScTableRefToken::HEADERS_DATA: +{ +if (pDBData->HasTotals()) aRange.aEnd.IncRow(-1); if (aRange.aEnd.Row() < aRange.aStart.Row()) { @@ -4823,14 +4828,31 @@ bool ScCompiler::HandleTableRef() break; case ScTableRefToken::TOTALS: { -aRange.aStart.SetRow( aRange.aEnd.Row()); +if (pDBData->HasTotals()) +aRange.aStart.SetRow( aRange.aEnd.Row()); +else +bAddRange = false; bForwardToClose = true; } break; -default: -/* TODO: implement all other cases. */ +case ScTableRefToken::DATA_TOTALS: +{ +if (pDBData->HasHeader()) +aRange.aStart.IncRow(); +if (aRange.aEnd.Row() < aRange.aStart.Row()) +{ +/* TODO: add RefData with deleted rows to generate + * #REF! error? */ +bAddRange = false; +} +bForwardToClose = true; +} +break; +case ScTableRefToken::THIS_ROW: +/* TODO: implement this. */ SetError(errUnknownToken); bAddRange = false; +break; } if (bAddRange) { commit 576b14ead012993b58a5217c9c8e863f59fc5088 Author: Eike Rathke Date: Tue Apr 7 21:04:23 2015 +0200 TableRef: add Totals to ScDBData Change-Id: Ie38eaba48abbfc4f54304b349f5d2b135f4f7046 diff --git a/sc/inc/dbdata.hxx b/sc/inc/dbdata.hxx index c2a8426..708bd85 100644 --- a/sc/inc/dbdata.hxx +++ b/sc/inc/dbdata.hxx @@ -53,6 +53,7 @@ private: SCROW nEndRow; boolbByRow; boolbHasHeader; +boolbHasTotals; boolbDoSize; boolbKeepFmt; boolbStripData; @@ -97,6 +98,8 @@ public: voidSetByRow(bool bByR) { bByRow = bByR; } boolHasHeader() const { return bHasHeader; } voidSetHeader(bool bHasH) { bHasHeader = bHasH; } +boolHasTotals() const { return bHasTotals; } +voidSetTotals(bool bTotals) { bHasTotals = bTotals; } voidSetIndex(sal_uInt16 nInd) { nIndex = nInd; } sal_uInt16 GetIndex() const{ return nIndex; } boolIsDoSize() const{ return bDoSize; } diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index e9299e3..64bb384 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -65,6 +65,7 @@ ScDBData::ScDBData( const OUString& rName, nEndRow (nRow2), bByRow (bByR), bHasHeader (bHasH), +bHasTotals (false), bDoSize (false), bKeepFmt(false), bStripData (false), @@ -92,6 +93,7 @@ ScDBData::ScDBData( const ScDBData& rData ) : nEndRow (rData.nEndRow), bByRow (rData.bByRow), bHasHeader (rData.bHasHeader), +bHasTotals (rData.bHasTo
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/globstr.hrc |5 + sc/source/ui/condformat/condformatdlgentry.cxx | 83 +++-- sc/source/ui/inc/condformatdlg.hrc |2 sc/source/ui/inc/condformatdlgentry.hxx| 10 ++- sc/source/ui/src/condformatdlg.src |6 + sc/source/ui/src/globstr.src |8 ++ 6 files changed, 92 insertions(+), 22 deletions(-) New commits: commit 73779a5ba01d513d1eee498b77ef985bd1c9f1fc Author: Markus Mohrhard Date: Sat Mar 28 19:19:04 2015 +0100 show warning also for existing entries, related tdf#42897 Change-Id: I80e215387852a1aa4ca0165ba62f307389abee32 diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index ce184d6..a7ea722 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -215,12 +215,15 @@ ScConditionFrmtEntry::ScConditionFrmtEntry( vcl::Window* pParent, ScDocument* pD maEdVal1.Show(); maEdVal1.SetText(pFormatEntry->GetExpression(maPos, 0)); maEdVal2.Hide(); +OnEdChanged(&maEdVal1); break; case 2: maEdVal1.Show(); maEdVal1.SetText(pFormatEntry->GetExpression(maPos, 0)); +OnEdChanged(&maEdVal1); maEdVal2.Show(); maEdVal2.SetText(pFormatEntry->GetExpression(maPos, 1)); +OnEdChanged(&maEdVal2); break; } } commit c276ca28262c4dc690849d89aa246a308dba1b25 Author: Markus Mohrhard Date: Sat Mar 28 19:13:40 2015 +0100 let it sound a bit less dramatic, related tdf#42897 Change-Id: Ie387f8e12efb1624ff56d7e25afd27deb0f1135b diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 4fd949d..ce184d6 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -299,7 +299,7 @@ IMPL_LINK(ScConditionFrmtEntry, OnEdChanged, Edit*, pEdit) ( ( op == ocBad ) && ( t == formula::svString ) ) ) { -pEdit->SetControlBackground(COL_LIGHTRED); +pEdit->SetControlBackground(COL_YELLOW); maFtVal.SetText(ScGlobal::GetRscString(STR_UNQUOTED_STRING)); return 0; } diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src index 616342b..40b6b93 100644 --- a/sc/source/ui/src/globstr.src +++ b/sc/source/ui/src/globstr.src @@ -2083,7 +2083,7 @@ Resource RID_GLOBSTR }; String STR_UNQUOTED_STRING { -Text [ en-US ] = "Strings must be quoted, otherwise they might be interpreted as an address or col/row name!"; +Text [ en-US ] = "Strings without quotes are interpreted as column/row labels."; }; String STR_ENTER_VALUE { commit fd28dea50930797652afbdce6992bea08c56caa0 Author: Laszlo Kis-Adam Date: Fri Mar 20 02:14:38 2015 +0100 tdf#42897 Warn the user if string without quote is entered as condition value. Change-Id: I5b30b608c0192b434ff237513ed7fbbf5af43f11 diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index eab98cc..9ef50d5 100644 --- a/sc/inc/globstr.hrc +++ b/sc/inc/globstr.hrc @@ -695,7 +695,10 @@ #define STR_UNDO_CONDFORMAT 531 #define STR_UNDO_FORMULA_TO_VALUE 532 -#define SC_GLOBSTR_STR_COUNT533 /**< the count of permanently resident strings */ +#define STR_UNQUOTED_STRING 533 +#define STR_ENTER_VALUE 534 + +#define SC_GLOBSTR_STR_COUNT535 /**< the count of permanently resident strings */ #endif diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 87c7f45..4fd949d 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -23,9 +23,11 @@ #include #include #include +#include #include "tokenarray.hxx" #include "stlpool.hxx" #include "tabvwsh.hxx" +#include "simpleformulacalc.hxx" #include "colorformat.hxx" @@ -124,23 +126,6 @@ void ScCondFrmtEntry::Deselect() SetHeight(); } -IMPL_LINK(ScCondFrmtEntry, EdModifyHdl, Edit*, pEdit) -{ -OUString aFormula = pEdit->GetText(); -ScCompiler aComp( mpDoc, maPos ); -aComp.SetGrammar( mpDoc->GetGrammar() ); -boost::scoped_ptr mpCode(aComp.CompileString(aFormula)); -if(mpCode->GetCodeError()) -{ -pEdit->SetControlBackground(COL_LIGHTRED); -} -else -{ - pEdit->SetControlBackground(GetSettings().GetStyleSettings().GetWindowColor()); -} -return 0; -} - //condition namespace { @@ -197,6 +182,7 @@ ScConditionFrmtEntry::ScConditionFrmtEntry( vcl::Window* pParent, ScDocument* pD maLbCondType( this, ScResId( LB_CELLIS_TYPE ) ), maEdVal1( this, NULL, NULL, ScResId( ED_VAL1 ) ),
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/table.hxx |2 +- sc/source/core/data/documen7.cxx | 23 +-- sc/source/core/data/document.cxx |2 +- sc/source/core/data/table2.cxx |4 ++-- 4 files changed, 21 insertions(+), 10 deletions(-) New commits: commit 7b95b0cc2b7806aa00e5b201e0cd922274d0c04d Author: Eike Rathke Date: Wed Dec 3 21:09:41 2014 +0100 do not construct an ScAddress on each iteration Change-Id: I3c89e649c289cd50035929d4025d0c18968b36f9 diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx index dc511a5..45c9416 100644 --- a/sc/source/core/data/documen7.cxx +++ b/sc/source/core/data/documen7.cxx @@ -157,10 +157,15 @@ void ScDocument::BroadcastCells( const ScRange& rRange, sal_uLong nHint ) ScConditionalFormatList* pCondFormList = GetCondFormList(nTab); if (pCondFormList) { +ScAddress aAddress( 0, 0, nTab); for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow) { +aAddress.SetRow(nRow); for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol) -pCondFormList->SourceChanged(ScAddress(nCol,nRow,nTab)); +{ +aAddress.SetCol(nCol); +pCondFormList->SourceChanged(aAddress); +} } } } commit 99270aefbfbec2f759f1f96e8777f76bc113dabc Author: Eike Rathke Date: Wed Dec 3 20:41:33 2014 +0100 slightly speed-up things by using ScTable access Change-Id: I378cd0e1eaa0f41799e4e18d1daae813540da77d diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx index 6429fa5..dc511a5 100644 --- a/sc/source/core/data/documen7.cxx +++ b/sc/source/core/data/documen7.cxx @@ -120,16 +120,22 @@ void ScDocument::BroadcastCells( const ScRange& rRange, sal_uLong nHint ) for (SCTAB nTab = nTab1; nTab <= nTab2; ++nTab) { +ScTable* pTab = FetchTable(nTab); +if (!pTab) +continue; + rPos.SetTab(nTab); -for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow) +for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol) { -rPos.SetRow(nRow); -for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol) +rPos.SetCol(nCol); +/* TODO: to speed-up things a per column iterator to + * cell-broadcast in a range of rows would come handy. */ +for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow) { -rPos.SetCol(nCol); -SvtBroadcaster* pBC = GetBroadcaster(rPos); +SvtBroadcaster* pBC = pTab->GetBroadcaster( nCol, nRow); if (pBC) { +rPos.SetRow(nRow); pBC->Broadcast(aHint); bIsBroadcasted = true; } commit b8a7c39cf26f6d417efc34acdf6f4c2a6762052d Author: Eike Rathke Date: Wed Dec 3 19:37:18 2014 +0100 introduce bool bBroadcast parameter for ScTable::SetDirty() Change-Id: I62c3714c8036fe8d4b70ee188546c7d69ece1ea5 diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 318805a..d5cb383 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -532,7 +532,7 @@ public: voidResetChanged( const ScRange& rRange ); void SetAllFormulasDirty( const sc::SetFormulaDirtyContext& rCxt ); -voidSetDirty( const ScRange&, bool bIncludeEmptyCells ); +voidSetDirty( const ScRange&, bool bBroadcast, bool bIncludeEmptyCells ); voidSetDirtyAfterLoad(); voidSetDirtyVar(); voidSetTableOpDirty( const ScRange& ); diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index fdab204..a654eba 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -3627,7 +3627,7 @@ void ScDocument::SetDirty( const ScRange& rRange, bool bIncludeEmptyCells ) ScBulkBroadcast aBulkBroadcast( GetBASM()); SCTAB nTab2 = rRange.aEnd.Tab(); for (SCTAB i=rRange.aStart.Tab(); i<=nTab2 && i < static_cast(maTabs.size()); i++) -if (maTabs[i]) maTabs[i]->SetDirty( rRange, bIncludeEmptyCells ); +if (maTabs[i]) maTabs[i]->SetDirty( rRange, true, bIncludeEmptyCells ); } SetAutoCalc( bOldAutoCalc ); } diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index fad5443..3665765 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -1684,13 +1684,13 @@ void ScTable::SetAllFormulasDirty( const sc::SetFormulaDirtyContext& rCxt ) aCol[i].SetAllFormulasDirty(rCxt); } -void ScTable::SetDirty( const ScRange& rRange, bool bIncludeEmptyCells ) +void ScTable::SetDirty( const ScRange& rRange, bool bBroadcast, bool bIncludeEmptyCells ) { bool bOldAutoCalc = pDocument
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/column.hxx |2 sc/inc/document.hxx |2 sc/inc/refhint.hxx | 18 ++ sc/inc/table.hxx|2 sc/source/core/data/column.cxx | 19 ++ sc/source/core/data/document.cxx|4 sc/source/core/data/formulacell.cxx | 10 + sc/source/core/data/table2.cxx |4 sc/source/core/data/table3.cxx | 245 +++- sc/source/core/tool/refhint.cxx |6 sc/source/ui/docshell/dbdocfun.cxx |2 11 files changed, 221 insertions(+), 93 deletions(-) New commits: commit e119f3883513aeaa49f332362620e955dc8b453f Author: Eike Rathke Date: Tue Dec 2 14:53:53 2014 +0100 fdo#86762 re-establish listeners on moved broadcasters ... also in SortReorderByColumn() similar to SortReorderByRow() Change-Id: I7665dcc90d70fcf3b08bef0adb9ab6aaff1cdcdf diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 857850f..280cb32 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -715,6 +715,28 @@ void ScTable::SortReorderByColumn( for (SCCOL nCol = nStart; nCol <= nLast; ++nCol) aCol[nCol].SplitFormulaGroupByRelativeRef(aSortRange); +// Collect all listeners of cell broadcasters of sorted range. +std::vector aCellListeners; + +if (!pArray->IsUpdateRefs()) +{ +// Collect listeners of cell broadcasters. +for (SCCOL nCol = nStart; nCol <= nLast; ++nCol) +aCol[nCol].CollectListeners(aCellListeners, nRow1, nRow2); + +// Remove any duplicate listener entries. We must ensure that we +// notify each unique listener only once. +std::sort(aCellListeners.begin(), aCellListeners.end()); +aCellListeners.erase(std::unique(aCellListeners.begin(), aCellListeners.end()), aCellListeners.end()); + +// Notify the cells' listeners to stop listening. +/* TODO: for performance this could be enhanced to stop and later + * restart only listening to within the reordered range and keep + * listening to everything outside untouched. */ +StopListeningNotifier aFunc; +std::for_each(aCellListeners.begin(), aCellListeners.end(), aFunc); +} + // table to keep track of column index to position in the index table. std::vector aPosTable(nCount); for (size_t i = 0; i < nCount; ++i) @@ -743,38 +765,38 @@ void ScTable::SortReorderByColumn( for (SCCOL nCol = nStart; nCol <= nLast; ++nCol) aCol[nCol].ResetFormulaCellPositions(nRow1, nRow2, bUpdateRefs); -// Set up column reorder map (for later broadcasting of reference updates). -sc::ColRowReorderMapType aColMap; -const std::vector& rOldIndices = pArray->GetOrderIndices(); -for (size_t i = 0, n = rOldIndices.size(); i < n; ++i) -{ -SCCOL nNew = i + nStart; -SCCOL nOld = rOldIndices[i]; -aColMap.insert(sc::ColRowReorderMapType::value_type(nOld, nNew)); -} - -// Collect all listeners within sorted range ahead of time. -std::vector aListeners; - -// Get all area listeners that listen on one column within the range and -// end their listening. -ScRange aMoveRange( nStart, nRow1, nTab, nLast, nRow2, nTab); -std::vector aAreaListeners = pDocument->GetBASM()->GetAllListeners( -aMoveRange, sc::OneColumnInsideArea); +if (pArray->IsUpdateRefs()) { -std::vector::iterator it = aAreaListeners.begin(), itEnd = aAreaListeners.end(); -for (; it != itEnd; ++it) +// Set up column reorder map (for later broadcasting of reference updates). +sc::ColRowReorderMapType aColMap; +const std::vector& rOldIndices = pArray->GetOrderIndices(); +for (size_t i = 0, n = rOldIndices.size(); i < n; ++i) { -pDocument->EndListeningArea(it->maArea, it->mbGroupListening, it->mpListener); -aListeners.push_back( it->mpListener); +SCCOL nNew = i + nStart; +SCCOL nOld = rOldIndices[i]; +aColMap.insert(sc::ColRowReorderMapType::value_type(nOld, nNew)); } -} -if (pArray->IsUpdateRefs()) -{ +// Collect all listeners within sorted range ahead of time. +std::vector aListeners; + for (SCCOL nCol = nStart; nCol <= nLast; ++nCol) aCol[nCol].CollectListeners(aListeners, nRow1, nRow2); +// Get all area listeners that listen on one column within the range +// and end their listening. +ScRange aMoveRange( nStart, nRow1, nTab, nLast, nRow2, nTab); +std::vector aAreaListeners = pDocument->GetBASM()->GetAllListeners( +aMoveRange, sc::OneColumnInsideArea); +{ +std::vector::iterator it = aAreaListeners.begin(), itEnd = aAreaListeners.end(); +for (; it != itEnd; ++it) +{ +pDocument->EndListeningArea(it->maA
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/token.hxx |2 ++ sc/source/filter/oox/addressconverter.cxx |6 +- sc/source/filter/oox/formulaparser.cxx| 22 +- 3 files changed, 28 insertions(+), 2 deletions(-) New commits: commit 2ec4c8b07427af868e32e14aaefd20649c1135d6 Author: Eike Rathke Date: Fri Oct 31 16:11:44 2014 +0100 converity#1249470 Uninitialized scalar field comment it's unnecessary Change-Id: Iebf2d1dbed1f9c1e2e09144f47e73d9628355f2e diff --git a/sc/inc/token.hxx b/sc/inc/token.hxx index 7eb4ef0..da4f9e9 100644 --- a/sc/inc/token.hxx +++ b/sc/inc/token.hxx @@ -383,6 +383,8 @@ public: { pS = 0; pD = rT.GetDoubleRef(); +// aDub intentionally not initialized, unnecessary +// because unused. } } SingleDoubleRefModifier( ScSingleRefData& rS ) commit 4c3dbdd2afafa6d112e8262b448ce9462472ee49 Author: Eike Rathke Date: Fri Oct 31 15:53:52 2014 +0100 converity#707956 Uninitialized scalar field Change-Id: Ic341502383de8a5b0843d2c4c15e7388818a6027 diff --git a/sc/source/filter/oox/addressconverter.cxx b/sc/source/filter/oox/addressconverter.cxx index 75d5d33..c3a8fb7 100644 --- a/sc/source/filter/oox/addressconverter.cxx +++ b/sc/source/filter/oox/addressconverter.cxx @@ -123,6 +123,7 @@ AddressConverter::AddressConverter( const WorkbookHelper& rHelper ) : { case FILTER_OOXML: initializeMaxPos( OOX_MAXTAB, OOX_MAXCOL, OOX_MAXROW ); +maLinkChars.set( 0x, 0x, 0x, 0x, 0x ); break; case FILTER_BIFF: switch( getBiff() ) { @@ -149,7 +150,10 @@ AddressConverter::AddressConverter( const WorkbookHelper& rHelper ) : case BIFF_UNKNOWN: break; } break; -case FILTER_UNKNOWN: break; +case FILTER_UNKNOWN: +initializeMaxPos( 0, 0, 0 ); +maLinkChars.set( 0x, 0x, 0x, 0x, 0x ); +break; } } commit eeec20ddb3034bd2aef775d614d9d80019c7493f Author: Eike Rathke Date: Fri Oct 31 15:42:14 2014 +0100 converity#738797 Uninitialized pointer field Change-Id: I84cd8b6542d2b52df620d56eb6492139a1d60c10 diff --git a/sc/source/filter/oox/formulaparser.cxx b/sc/source/filter/oox/formulaparser.cxx index 9909818..ba99aa6 100644 --- a/sc/source/filter/oox/formulaparser.cxx +++ b/sc/source/filter/oox/formulaparser.cxx @@ -2046,7 +2046,27 @@ BiffFormulaParserImpl::BiffFormulaParserImpl( const FormulaParser& rParent ) : mnMemFuncSize = 2; mnRefIdSize = 0; break; -case BIFF_UNKNOWN: break; +case BIFF_UNKNOWN: +mpImportStrToken = NULL; +mpImportSpaceToken = NULL; +mpImportSheetToken = NULL; +mpImportEndSheetToken = NULL; +mpImportNlrToken = NULL; +mpImportRefToken = NULL; +mpImportAreaToken = NULL; +mpImportRef3dToken = NULL; +mpImportArea3dToken = NULL; +mpImportNameXToken = NULL; +mpImportFuncToken = NULL; +mpImportFuncVarToken = NULL; +mpImportFuncCEToken = NULL; +mnAttrDataSize = 0; +mnArraySize = 0; +mnNameSize = 0; +mnMemAreaSize = 0; +mnMemFuncSize = 0; +mnRefIdSize = 0; +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/inc sc/source
sc/inc/markarr.hxx|1 sc/inc/rangelst.hxx |1 sc/source/core/data/markarr.cxx | 15 ++ sc/source/core/data/markdata.cxx | 17 +++ sc/source/core/tool/rangelst.cxx | 49 -- sc/source/ui/Accessibility/AccessibleDocument.cxx |4 - 6 files changed, 78 insertions(+), 9 deletions(-) New commits: commit defa080e585fb351bc4049b2f280d2e7e5256f6e Author: Eike Rathke Date: Wed Oct 15 02:03:09 2014 +0200 remove duplicated call to mpChildrenShapes->SelectionChanged() Found when investigating performance bottlenecks of fdo#75486, after the selection is completed ScTabViewObj::getSelection() is called multiple times, each creating a ScCellRangesObj of the range list of filtered ranges, which then is used for ScChildrenShapes::FindSelectedShapesChanges() The duplicated call was introduced with b41332475783c31136673fb44cf4c411bb0148f8 but IMHO does not make any sense at all unless it has obscure side effects, it only slows down things even more. Change-Id: I3cee2e3e62c24ad72efb8cc2021e74d0afc70b69 diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 975dfc7..751a9fe 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -1691,10 +1691,6 @@ void SAL_CALL ScAccessibleDocument::selectionChanged( const lang::EventObject& / CommitChange(aEvent); } -if(mpChildrenShapes ) -{ -mpChildrenShapes->SelectionChanged(); -} } //= XInterface = commit 94efc482d514bf9c6c4edb149f86084d672b724f Author: Eike Rathke Date: Tue Oct 14 23:50:24 2014 +0200 speed up simple range list joins that could be appends, fdo#75486 related Change-Id: I734ff88bc4c0633875c9e9c19a817b8b08511c83 diff --git a/sc/inc/rangelst.hxx b/sc/inc/rangelst.hxx index 897bb97..4a10eed 100644 --- a/sc/inc/rangelst.hxx +++ b/sc/inc/rangelst.hxx @@ -93,6 +93,7 @@ public: private: ::std::vector maRanges; +SCROW mnMaxRowUsed; typedef std::vector::iterator iterator; typedef std::vector::const_iterator const_iterator; }; diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx index 6e276bc..ab5653f5 100644 --- a/sc/source/core/tool/rangelst.cxx +++ b/sc/source/core/tool/rangelst.cxx @@ -229,6 +229,37 @@ void ScRangeList::Join( const ScRange& r, bool bIsInList ) SCROW nRow2 = r.aEnd.Row(); SCTAB nTab2 = r.aEnd.Tab(); +// One common usage is to join ranges that actually are top to bottom +// appends but the caller doesn't exactly know about it, e.g. when invoked +// by ScMarkData::FillRangeListWithMarks(), check for this special case +// first and speed up things by not looping over all ranges for each range +// to be joined. We don't remember the exact encompassing range that would +// have to be updated on refupdates and insertions and deletions, instead +// remember just the maximum row used, even independently of the sheet. +// This satisfies most use cases. + +if (!bIsInList) +{ +if (nRow1 > mnMaxRowUsed + 1) +{ +Append( r ); +return; +} +else if (nRow1 == mnMaxRowUsed + 1) +{ +// Check if we can simply enlarge the last range. +ScRange* p = maRanges.back(); +if (p->aEnd.Row() + 1 == nRow1 && +p->aStart.Col() == nCol1 && p->aEnd.Col() == nCol2 && +p->aStart.Tab() == nTab1 && p->aEnd.Tab() == nTab2) +{ +p->aEnd.SetRow( nRow2 ); +mnMaxRowUsed = nRow2; +return; +} +} +} + ScRange* pOver = (ScRange*) &r; // fies aber wahr wenn bInList size_t nOldPos = 0; if ( bIsInList ) @@ -403,6 +434,8 @@ bool ScRangeList::UpdateReference( bChanged = true; pR->aStart.Set( theCol1, theRow1, theTab1 ); pR->aEnd.Set( theCol2, theRow2, theTab2 ); +if (mnMaxRowUsed < theRow2) +mnMaxRowUsed = theRow2; } } @@ -435,6 +468,8 @@ void ScRangeList::InsertRow( SCTAB nTab, SCCOL nColStart, SCCOL nColEnd, SCROW n SCROW nNewRangeEndRow = nRowPos + nSize - 1; aNewRanges.push_back(ScRange(nNewRangeStartCol, nNewRangeStartRow, nTab, nNewRangeEndCol, nNewRangeEndRow, nTab)); +if (mnMaxRowUsed < nNewRangeEndRow) +mnMaxRowUsed = nNewRangeEndRow; } } } @@ -983,16 +1018,19 @@ ScRange* ScRangeList::Find( const ScAddress& rAdr ) return itr == maRanges.end() ? NULL : *itr; } -ScRangeList::
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/tabprotection.hxx |8 +++- sc/source/core/data/tabprotection.cxx |6 +++--- sc/source/filter/excel/excimp8.cxx|7 --- sc/source/filter/xcl97/xcl97rec.cxx |2 +- 4 files changed, 15 insertions(+), 8 deletions(-) New commits: commit d114939dabaf5cb0c14b619ef851be17c28e69e5 Author: Eike Rathke Date: Tue Apr 8 11:51:19 2014 +0200 resize vector in advance Obtaining front() from an empty vector is disallowed, even if size was reserved. So resize it. Change-Id: Iae2aafd6b7b725ea36bf9c3fb0a2370c703f diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index fd8e221..24adc64 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -375,9 +375,10 @@ void ImportExcel8::Feat( void ) { sal_uInt32 nCbSD = aIn.ReaduInt32(); // TODO: could here be some sanity check applied to not allocate 4GB? -aProt.maSecurityDescriptor.reserve( nCbSD); +aProt.maSecurityDescriptor.resize( nCbSD); sal_Size nRead = aIn.Read( &aProt.maSecurityDescriptor.front(), nCbSD); -aProt.maSecurityDescriptor.resize( nRead); +if (nRead < nCbSD) +aProt.maSecurityDescriptor.resize( nRead); } GetSheetProtectBuffer().AppendEnhancedProtection( aProt, GetCurrScTab() ); commit 5bce64e4759ee3bd98d34b70d02f9b54550a53ed Author: Eike Rathke Date: Tue Apr 8 11:34:49 2014 +0200 bit 0 is bit 0 They say they use big-endian bit diagrams, but just to confuse you. Change-Id: I7fd6bb58c721f1dca2f6ecbaae90d516746762f0 diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index 8209a86..fd8e221 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -371,7 +371,7 @@ void ImportExcel8::Feat( void ) aProt.mnAreserved = aIn.ReaduInt32(); aProt.mnPasswordVerifier = aIn.ReaduInt32(); aProt.maTitle = aIn.ReadUniString(); -if ((aProt.mnAreserved & 0x8000) == 0x8000) +if ((aProt.mnAreserved & 0x0001) == 0x0001) { sal_uInt32 nCbSD = aIn.ReaduInt32(); // TODO: could here be some sanity check applied to not allocate 4GB? diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index d6c39ce..285fc62 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -1492,7 +1492,7 @@ void XclExpSheetEnhancedProtection::WriteBody( XclExpStream& rStrm ) rStrm << maEnhancedProtection.mnAreserved; // 1 bit A and 31 bits reserved rStrm << maEnhancedProtection.mnPasswordVerifier; // wPassword rStrm << XclExpString( maEnhancedProtection.maTitle); // stTitle -bool bSDContainer = ((maEnhancedProtection.mnAreserved & 0x8000) == 0x8000); +bool bSDContainer = ((maEnhancedProtection.mnAreserved & 0x0001) == 0x0001); sal_uInt32 nCbSD = maEnhancedProtection.maSecurityDescriptor.size(); SAL_WARN_IF( bSDContainer && nCbSD < 20, "sc.filter", "XclExpSheetEnhancedProtection A flag indicates container but cbSD < 20"); commit a65e9fd24d905d03cd77551f2d6c9b2efa18fff6 Author: Eike Rathke Date: Tue Apr 8 11:08:30 2014 +0200 hold security descriptors read from OOXML independently If anyone knows how to interpret that stuff and convert between BIFF/OOXML feel free to implement.. According to ISO/IEC 29000 the securityDescriptor is application defined, but recommends that username@domain be used, which is addr-spec of RFC 822. Well, what Excel2013 writes is something like this 'O:WDG:WDD:(A;;CC;;;S-1-5-21-2328606873-448790680-2149751550-1003)' Change-Id: I138fa116b019f200c211272abf69831bc49127ab diff --git a/sc/inc/tabprotection.hxx b/sc/inc/tabprotection.hxx index a224dc8..2dc798c 100644 --- a/sc/inc/tabprotection.hxx +++ b/sc/inc/tabprotection.hxx @@ -119,9 +119,15 @@ struct ScEnhancedProtection sal_uInt32 mnAreserved; sal_uInt32 mnPasswordVerifier; OUStringmaTitle; -::std::vector< sal_uInt8 > maSecurityDescriptor; // raw data +::std::vector< sal_uInt8 > maSecurityDescriptor; // imported as raw BIFF data +OUStringmaSecurityDescriptorXML;// imported from OOXML ScEnhancedProtection() : mnAreserved(0), mnPasswordVerifier(0) {} + +bool hasSecurityDescriptor() const +{ +return !maSecurityDescriptor.empty() || !maSecurityDescriptorXML.isEmpty(); +} }; /** sheet protection state container diff --git a/sc/source/core/data/tabprotection.cxx b/sc/source/core/data/tabprotection.cxx index f8a6a12..a9bfd8f 100644 --- a/sc/source/core/data/tabprotection.cxx +++ b/sc/source/core/data/tabprotection.cxx @@ -396,7 +396,7 @@ bool ScTableProtectionImpl::isBlockEditable( const ScRange& rRange )
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/tabprotection.hxx | 19 ++ sc/source/core/data/tabprotection.cxx | 44 ++ sc/source/filter/excel/xicontent.cxx | 39 +++--- sc/source/filter/inc/xicontent.hxx|6 +++- 4 files changed, 103 insertions(+), 5 deletions(-) New commits: commit 273195cb0a237142dd8885529688325438f27281 Author: Eike Rathke Date: Thu Mar 20 13:00:48 2014 +0100 stuff Excel enhanced protection read into ScTableProtection Change-Id: I06db8f7466f5baddc55ea9cb117bb8a222de0c01 diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx index 4edbff6..bc27a29 100644 --- a/sc/source/filter/excel/xicontent.cxx +++ b/sc/source/filter/excel/xicontent.cxx @@ -74,11 +74,29 @@ const XclRef8U & XclRef8U::read( XclImpStream & rStrm ) return *this; } -ScRange XclRef8U::convertToScRange( SCTAB nTab ) +ScRange XclRef8U::convertToScRange( SCTAB nTab ) const { return ScRange( mnCol1, mnRow1, nTab, mnCol2, mnRow2, nTab); } +ScEnhancedProtection XclEnhancedProtection::convertToScEnhancedProtection( SCTAB nTab ) const +{ +ScEnhancedProtection aProt; +if (!maRefs.empty()) +{ +aProt.maRangeList = new ScRangeList; +for (::std::vector::const_iterator it(maRefs.begin()), itEnd(maRefs.end()); it != itEnd; ++it) +{ +aProt.maRangeList->Append( it->convertToScRange( nTab)); +} +} +aProt.mnAreserved = mnAreserved; +aProt.mnPasswordVerifier = mnPasswordVerifier; +aProt.maTitle = maTitle; +aProt.maSecurityDescriptor = maSecurityDescriptor; +return aProt; +} + // Shared string table @@ -1302,8 +1320,6 @@ void XclImpSheetProtectBuffer::Apply() const pProtect->setPasswordHash(aPass, PASSHASH_XL); } -// ranges the protection is applied to - // sheet protection options const sal_uInt16 nOptions = itr->second.mnOptions; pProtect->setOption( ScTableProtection::OBJECTS, (nOptions & 0x0001) ); @@ -1322,8 +1338,23 @@ void XclImpSheetProtectBuffer::Apply() const pProtect->setOption( ScTableProtection::PIVOT_TABLES, (nOptions & 0x2000) ); pProtect->setOption( ScTableProtection::SELECT_UNLOCKED_CELLS, (nOptions & 0x4000) ); +SCTAB nTab = itr->first; + +// Enhanced protection containing editable ranges and permissions. +if (!itr->second.maEnhancedProtections.empty()) +{ +::std::vector aProtections; +for (::std::vector::const_iterator +it(itr->second.maEnhancedProtections.begin()), itEnd(itr->second.maEnhancedProtections.end()); +it != itEnd; ++it) +{ +aProtections.push_back( it->convertToScEnhancedProtection( nTab)); +} +pProtect->setEnhancedProtection( aProtections); +} + // all done. now commit. -GetDoc().SetTabProtection(itr->first, pProtect.get()); +GetDoc().SetTabProtection(nTab, pProtect.get()); } } diff --git a/sc/source/filter/inc/xicontent.hxx b/sc/source/filter/inc/xicontent.hxx index 72ed76915..86142ec 100644 --- a/sc/source/filter/inc/xicontent.hxx +++ b/sc/source/filter/inc/xicontent.hxx @@ -31,6 +31,8 @@ #include #include +class ScEnhancedProtection; + /* Classes to import the big Excel document contents (related to several cells or globals for the document). @@ -52,7 +54,7 @@ struct XclRef8U sal_uInt16 mnCol2; const XclRef8U & read( XclImpStream & rStrm ); -ScRange convertToScRange( SCTAB nTab ); +ScRange convertToScRange( SCTAB nTab ) const; }; /** Feat ISFPROTECTION refs plus FeatProtection */ @@ -63,6 +65,8 @@ struct XclEnhancedProtection sal_uInt32 mnPasswordVerifier; OUStringmaTitle; ::std::vector< sal_uInt8 > maSecurityDescriptor; // raw data + +ScEnhancedProtection convertToScEnhancedProtection( SCTAB nTab ) const; }; // Shared string table commit 6daff4ed350b6b2493f36290a00892a9584e786f Author: Eike Rathke Date: Thu Mar 20 11:23:48 2014 +0100 range list might be nil, who knows Change-Id: Iee5554f1b51db0f6dc22ccbed743ae431bb895f6 diff --git a/sc/source/core/data/tabprotection.cxx b/sc/source/core/data/tabprotection.cxx index 10eef3c..7accb27 100644 --- a/sc/source/core/data/tabprotection.cxx +++ b/sc/source/core/data/tabprotection.cxx @@ -374,7 +374,8 @@ bool ScTableProtectionImpl::updateReference( UpdateRefMode eMode, ScDocument* pD for (::std::vector::iterator it(maEnhancedProtection.begin()); it != maEnhancedProtection.end(); ++it) { -bChanged |= (*it).maRa
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/dbdocutl.hxx |2 sc/inc/detdata.hxx|8 +- sc/inc/detfunc.hxx| 42 ++-- sc/source/core/data/dbdocutl.cxx |2 sc/source/core/tool/detdata.cxx |6 - sc/source/core/tool/detfunc.cxx | 124 +++--- sc/source/ui/docshell/docfunc.cxx | 16 ++-- 7 files changed, 100 insertions(+), 100 deletions(-) New commits: commit ec3c9a5f7fd04327697d50505ac56fcfbb71ca45 Author: Noel Grandin Date: Fri Feb 7 16:06:27 2014 +0200 sal_Bool->bool Change-Id: I1b45ccb419ce827ca9ddb475e67878c95d67d36d diff --git a/sc/inc/detfunc.hxx b/sc/inc/detfunc.hxx index 4091162..2f7d636 100644 --- a/sc/inc/detfunc.hxx +++ b/sc/inc/detfunc.hxx @@ -53,7 +53,7 @@ class SC_DLLPUBLIC ScDetectiveFunc static ColorData nArrowColor; static ColorData nErrorColor; static ColorData nCommentColor; -static sal_Bool bColorsInitialized; +static bool bColorsInitialized; ScDocument* pDoc; SCTAB nTab; @@ -76,30 +76,30 @@ class SC_DLLPUBLIC ScDetectiveFunc /** @return the drawing layer rectangle for the passed cell address. */ Rectangle GetDrawRect( SCCOL nCol, SCROW nRow ) const; -sal_BoolHasArrow( const ScAddress& rStart, +boolHasArrow( const ScAddress& rStart, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab ); -voidDeleteArrowsAt( SCCOL nCol, SCROW nRow, sal_Bool bDestPnt ); +voidDeleteArrowsAt( SCCOL nCol, SCROW nRow, bool bDestPnt ); voidDeleteBox( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ); -sal_BoolHasError( const ScRange& rRange, ScAddress& rErrPos ); +boolHasError( const ScRange& rRange, ScAddress& rErrPos ); voidFillAttributes( ScDetectiveData& rData ); /// called from DrawEntry/DrawAlienEntry and InsertObject -sal_BoolInsertArrow( SCCOL nCol, SCROW nRow, +boolInsertArrow( SCCOL nCol, SCROW nRow, SCCOL nRefStartCol, SCROW nRefStartRow, SCCOL nRefEndCol, SCROW nRefEndRow, -sal_Bool bFromOtherTab, sal_Bool bRed, +bool bFromOtherTab, bool bRed, ScDetectiveData& rData ); -sal_BoolInsertToOtherTab( SCCOL nStartCol, SCROW nStartRow, -SCCOL nEndCol, SCROW nEndRow, sal_Bool bRed, +boolInsertToOtherTab( SCCOL nStartCol, SCROW nStartRow, +SCCOL nEndCol, SCROW nEndRow, bool bRed, ScDetectiveData& rData ); /// DrawEntry / DrawAlienEntry check for existing arrows and errors -sal_BoolDrawEntry( SCCOL nCol, SCROW nRow, const ScRange& rRef, +boolDrawEntry( SCCOL nCol, SCROW nRow, const ScRange& rRef, ScDetectiveData& rData ); -sal_BoolDrawAlienEntry( const ScRange& rRef, +boolDrawAlienEntry( const ScRange& rRef, ScDetectiveData& rData ); voidDrawCircle( SCCOL nCol, SCROW nRow, ScDetectiveData& rData ); @@ -118,22 +118,22 @@ class SC_DLLPUBLIC ScDetectiveFunc sal_uInt16 FindSuccLevel( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uInt16 nLevel, sal_uInt16 nDeleteLevel ); -sal_BoolFindFrameForObject( SdrObject* pObject, ScRange& rRange ); +boolFindFrameForObject( SdrObject* pObject, ScRange& rRange ); voidModified(); public: ScDetectiveFunc(ScDocument* pDocument, SCTAB nTable) : pDoc(pDocument),nTab(nTable) {} -sal_BoolShowSucc( SCCOL nCol, SCROW nRow ); -sal_BoolShowPred( SCCOL nCol, SCROW nRow ); -sal_BoolShowError( SCCOL nCol, SCROW nRow ); +boolShowSucc( SCCOL nCol, SCROW nRow ); +boolShowPred( SCCOL nCol, SCROW nRow ); +boolShowError( SCCOL nCol, SCROW nRow ); -sal_BoolDeleteSucc( SCCOL nCol, SCROW nRow ); -sal_BoolDeletePred( SCCOL nCol, SCROW nRow ); -sal_BoolDeleteAll( ScDetectiveDelete eWhat ); +boolDeleteSucc( SCCOL nCol, SCROW nRow ); +boolDeletePred( SCCOL nCol, SCROW nRow ); +boolDeleteAll( ScDetectiveDelete eWhat ); -sal_BoolMarkInvalid(sal_Bool& rOverflow); +boolMarkInvalid(bool& rOverflow); voidGetAllPreds(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ::std::vector& rRefTokens); voidGetAllSuccs(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ::std::vector& rRefTokens); @@ -141,18 +141,18 @@ public: static void UpdateAllComments( ScDocument& rDoc );///< on all tables voidUpdateAllArrowColors();
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/table.hxx |6 ++ sc/source/core/data/table4.cxx | 119 ++--- 2 files changed, 72 insertions(+), 53 deletions(-) New commits: commit dcca10d4e26d4602d9ac4f0b340b52c31fe086e3 Author: Kohei Yoshida Date: Fri Jan 31 21:06:34 2014 -0500 Special case for formula cell fill down for quicker filling. Change-Id: Ia03aa4c042b22551deacf4d7a58c9492a0a13a66 diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 16fd34f..88d1f68 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -1298,7 +1298,14 @@ void ScTable::FillAutoSimple( if ( bGetCell ) { if (bVertical) // rInner&:=nRow, rOuter&:=nCol +{ aSrcCell = aCol[rCol].GetCellValue(nSource); +if (aSrcCell.meType == CELLTYPE_FORMULA) +{ +FillFormulaVertical(*aSrcCell.mpFormula, rInner, rCol, nIStart, nIEnd, pProgress, rProgress); +return; +} +} else// rInner&:=nCol, rOuter&:=nRow aSrcCell = aCol[nSource].GetCellValue(rRow); commit 34ebbc6418e0953cd857c35e6d63a7aaae74dfda Author: Kohei Yoshida Date: Fri Jan 31 20:18:42 2014 -0500 Move this to its own method. Change-Id: Ief8356bc8e0d3d791c97849b8b00ece4ede0b803 diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 095b16e..2621d32 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -915,6 +915,12 @@ public: static void UpdateSearchItemAddressForReplace( const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow ); private: + +void FillFormulaVertical( +const ScFormulaCell& rSrcCell, +SCCOLROW& rInner, SCCOL nCol, SCROW nRow1, SCROW nRow2, +ScProgress* pProgress, sal_uLong& rProgress ); + void FillSeriesSimple( ScCellValue& rSrcCell, SCCOLROW& rInner, SCCOLROW nIMin, SCCOLROW nIMax, SCCOLROW& rCol, SCCOLROW& rRow, bool bVertical, ScProgress* pProgress, sal_uLong& rProgress ); diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 71fb74c..16fd34f 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -1133,6 +1133,51 @@ bool HiddenRowColumn(ScTable* pTable, SCCOLROW nRowColumn, bool bVertical, SCCOL } +void ScTable::FillFormulaVertical( +const ScFormulaCell& rSrcCell, +SCCOLROW& rInner, SCCOL nCol, SCROW nRow1, SCROW nRow2, +ScProgress* pProgress, sal_uLong& rProgress ) +{ +bool bHidden = false; +SCCOLROW nHiddenLast = -1; + +SCCOLROW nRowStart = -1, nRowEnd = -1; +std::vector aSpans; +for (rInner = nRow1; rInner <= nRow2; ++rInner) +{ +if (rInner > nHiddenLast) +bHidden = HiddenRowColumn(this, rInner, true, nHiddenLast); + +if (bHidden) +{ +if (nRowStart >= 0) +{ +nRowEnd = rInner - 1; +aSpans.push_back(sc::RowSpan(nRowStart, nRowEnd)); +nRowStart = -1; +} +rInner = nHiddenLast; +continue; +} + +if (nRowStart < 0) +nRowStart = rInner; +} + +if (nRowStart >= 0) +{ +nRowEnd = rInner - 1; +aSpans.push_back(sc::RowSpan(nRowStart, nRowEnd)); +} + +aCol[nCol].DeleteRanges(aSpans, IDF_CONTENTS, false); +aCol[nCol].CloneFormulaCell(rSrcCell, aSpans); + +rProgress += nRow2 - nRow1 + 1; +if (pProgress) +pProgress->SetStateOnPercent(rProgress); +} + void ScTable::FillSeriesSimple( ScCellValue& rSrcCell, SCCOLROW& rInner, SCCOLROW nIMin, SCCOLROW nIMax, SCCOLROW& rCol, SCCOLROW& rRow, bool bVertical, ScProgress* pProgress, sal_uLong& rProgress ) @@ -1146,41 +1191,8 @@ void ScTable::FillSeriesSimple( { case CELLTYPE_FORMULA: { -SCCOLROW nRowStart = -1, nRowEnd = -1; -std::vector aSpans; -for (rInner = nIMin; rInner <= nIMax; ++rInner) -{ -if (rInner > nHiddenLast) -bHidden = HiddenRowColumn(this, rInner, bVertical, nHiddenLast); - -if (bHidden) -{ -if (nRowStart >= 0) -{ -nRowEnd = rInner - 1; -aSpans.push_back(sc::RowSpan(nRowStart, nRowEnd)); -nRowStart = -1; -} -rInner = nHiddenLast; -continue; -} - -if (nRowStart < 0) -nRowStart = rInner; -} - -if (nRowStart >= 0) -{ -nRowEnd = rInner - 1; -
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source sd/source
sc/inc/validat.hxx|5 - sc/source/core/data/simpleformulacalc.cxx | 10 +-- sc/source/core/data/validat.cxx | 94 +++--- sd/source/filter/eppt/pptx-epptooxml.cxx |7 +- 4 files changed, 60 insertions(+), 56 deletions(-) New commits: commit 9bdf5e9d107a09bad5d03189e76f20cb0bbcd15c Author: Norbert Thiebaud Date: Mon Jan 27 00:14:01 2014 -0600 coverity#1038497 : Uninitialized scalar field Change-Id: I814eb68a74812b83dd98e80cf286fc11e6f57fab diff --git a/sc/source/core/data/simpleformulacalc.cxx b/sc/source/core/data/simpleformulacalc.cxx index 8702c3b..b1d56f3 100644 --- a/sc/source/core/data/simpleformulacalc.cxx +++ b/sc/source/core/data/simpleformulacalc.cxx @@ -15,10 +15,12 @@ ScSimpleFormulaCalculator::ScSimpleFormulaCalculator( ScDocument* pDoc, const ScAddress& rAddr, -const OUString& rFormula, formula::FormulaGrammar::Grammar eGram ): -mbCalculated(false), -maAddr(rAddr), -mpDoc(pDoc) +const OUString& rFormula, formula::FormulaGrammar::Grammar eGram ) +: mnFormatType(0) +, mnFormatIndex(0) +, mbCalculated(false) +, maAddr(rAddr) +, mpDoc(pDoc) { // compile already here ScCompiler aComp(pDoc, rAddr); commit 61ca90050badefdfbd9d5282317d03deb3339870 Author: Norbert Thiebaud Date: Mon Jan 27 00:06:40 2014 -0600 coverity#1038498 : Uninitialized scalar field Change-Id: I11f3056e96436fbb305316ef5c6505629e6418a3 diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 234f87c..ce47590 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -206,9 +206,12 @@ int PowerPointExport::GetPPTXLayoutId( int nOffset ) return nId; } -PowerPointShapeExport::PowerPointShapeExport( FSHelperPtr pFS, ShapeHashMap* pShapeMap, PowerPointExport* pFB ) -: ShapeExport( XML_p, pFS, pShapeMap, pFB ) +PowerPointShapeExport::PowerPointShapeExport( FSHelperPtr pFS, ShapeHashMap* pShapeMap, + PowerPointExport* pFB ) +: ShapeExport( XML_p, pFS, pShapeMap, pFB ) , mrExport( *pFB ) +, mePageType(UNDEFINED) +, mbMaster(sal_False) { } commit 2a339a2ffc7f9923648d83bf287228a9008a54b9 Author: Norbert Thiebaud Date: Sun Jan 26 23:45:06 2014 -0600 coverity#1103748 coverity#708009 coverity#708011-12 Change-Id: I8855114b3cd6cf073af182b5730c3fc9e08a56df diff --git a/sc/inc/validat.hxx b/sc/inc/validat.hxx index c66c929..ccf50a6c 100644 --- a/sc/inc/validat.hxx +++ b/sc/inc/validat.hxx @@ -75,8 +75,6 @@ private: OUString aErrorTitle; OUString aErrorMessage; -bool bIsUsed;// temporary during saving - bool DoMacro( const ScAddress& rPos, const OUString& rInput, ScFormulaCell* pCell, Window* pParent ) const; @@ -145,9 +143,6 @@ public: sal_uInt32 GetKey() const { return nKey; } voidSetKey(sal_uInt32 nNew) { nKey = nNew; }// only if not inserted! -voidSetUsed(bool bSet) { bIsUsed = bSet; } -boolIsUsed() const { return bIsUsed; } - boolEqualEntries( const ScValidationData& r ) const;// for undo // sort (using std::set) by index diff --git a/sc/source/core/data/validat.cxx b/sc/source/core/data/validat.cxx index 878dc0a..7ca9589 100644 --- a/sc/source/core/data/validat.cxx +++ b/sc/source/core/data/validat.cxx @@ -57,59 +57,63 @@ using namespace formula; // ScValidationData::ScValidationData( ScValidationMode eMode, ScConditionMode eOper, -const OUString& rExpr1, const OUString& rExpr2, -ScDocument* pDocument, const ScAddress& rPos, -const OUString& rExprNmsp1, const OUString& rExprNmsp2, -FormulaGrammar::Grammar eGrammar1, FormulaGrammar::Grammar eGrammar2 ) : -ScConditionEntry( eOper, rExpr1, rExpr2, pDocument, rPos, rExprNmsp1, rExprNmsp2, eGrammar1, eGrammar2 ), -nKey( 0 ), -eDataMode( eMode ), -eErrorStyle( SC_VALERR_STOP ), -mnListType( ValidListType::UNSORTED ) +const OUString& rExpr1, const OUString& rExpr2, +ScDocument* pDocument, const ScAddress& rPos, +const OUString& rExprNmsp1, const OUString& rExprNmsp2, +FormulaGrammar::Grammar eGrammar1, +FormulaGrammar::Grammar eGrammar2 ) +: ScConditionEntry( eOper, rExpr1, rExpr2, pDocument, rPos, rExprNmsp1, +rExprNmsp2, eGrammar1, eGrammar2 ) +, nKey( 0 ) +, eDataMode( eMode ) +, bShowInput(false) +, bShowError(false) +, eErrorStyle( SC_VALERR_STOP ) +, mnListType( ValidListType::UNSO
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/table.hxx |2 - sc/source/core/data/table2.cxx |9 sc/source/ui/Accessibility/AccessibleTableBase.cxx | 38 ++--- 3 files changed, 26 insertions(+), 23 deletions(-) New commits: commit c16ec3067e96fe0a53ae56d118e85dda4831f88b Author: Eike Rathke Date: Fri Dec 13 21:13:12 2013 +0100 there is no need to expose an ScColumn*, and always check for validity Change-Id: Id7f4f180083ec61a98cc93dd7c41b66cbac28953 diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 1a84fce..f07e8d4 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -1068,8 +1068,6 @@ private: SCROW mnUBound; }; -public : -ScColumn* GetColumnByIndex( sal_Int32 nIndex ); }; diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index e4b9ea6..30771ab 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -3654,13 +3654,4 @@ sal_uLong ScTable::GetColOffset( SCCOL nCol, bool bHiddenAsZero ) const return n; } -ScColumn* ScTable::GetColumnByIndex( sal_Int32 nIndex ) -{ -if (ValidCol(nIndex)) -{ -return &(aCol[nIndex]); -} -return NULL; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/Accessibility/AccessibleTableBase.cxx b/sc/source/ui/Accessibility/AccessibleTableBase.cxx index 9ce33be..9963e34 100644 --- a/sc/source/ui/Accessibility/AccessibleTableBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleTableBase.cxx @@ -146,12 +146,19 @@ sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleRowExtentAt( sal_Int32 nR if (mpDoc) { -SCROW nEndRow(0); -SCCOL nEndCol(0); -mpDoc->FetchTable(maRange.aStart.Tab())->GetColumnByIndex(nColumn)-> -ExtendMerge( static_cast(nColumn), static_cast(nRow), nRow, nEndCol, nEndRow, sal_False ); -if (nEndRow > nRow) - nCount = nEndRow - nRow + 1; +ScTable* pTab = mpDoc->FetchTable(maRange.aStart.Tab()); +if (pTab) +{ +SCROW nStartRow = static_cast(nRow); +SCROW nEndRow = nStartRow; +SCCOL nStartCol = static_cast(nColumn); +SCCOL nEndCol = nStartCol; +if (pTab->ExtendMerge( nStartCol, nStartRow, nEndCol, nEndRow, false)) +{ +if (nEndRow > nStartRow) +nCount = nEndRow - nStartRow + 1; +} +} } return nCount; @@ -173,12 +180,19 @@ sal_Int32 SAL_CALL ScAccessibleTableBase::getAccessibleColumnExtentAt( sal_Int32 if (mpDoc) { -SCROW nEndRow(0); -SCCOL nEndCol(0); -mpDoc->FetchTable(maRange.aStart.Tab())->GetColumnByIndex(nColumn)-> -ExtendMerge( static_cast(nColumn), static_cast(nRow), nRow, nEndCol, nEndRow, sal_False ); -if (nEndCol > nColumn) -nCount = nEndCol - nColumn + 1; +ScTable* pTab = mpDoc->FetchTable(maRange.aStart.Tab()); +if (pTab) +{ +SCROW nStartRow = static_cast(nRow); +SCROW nEndRow = nStartRow; +SCCOL nStartCol = static_cast(nColumn); +SCCOL nEndCol = nStartCol; +if (pTab->ExtendMerge( nStartCol, nStartRow, nEndCol, nEndRow, false)) +{ +if (nEndCol > nStartCol) +nCount = nEndCol - nStartCol + 1; +} +} } return nCount; commit ffb8b734c0654c3e1d7d2acb01d5ea00400b1b68 Author: Eike Rathke Date: Fri Dec 13 20:18:17 2013 +0100 how about style? Change-Id: I2b53f87f0bf0838c0ef61c3b31408643ae4a0fc3 diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index f29e7f9..1a84fce 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -1069,7 +1069,7 @@ private: }; public : -ScColumn* GetColumnByIndex(sal_Int32 index); +ScColumn* GetColumnByIndex( sal_Int32 nIndex ); }; diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index cc7b435..e4b9ea6 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -3654,11 +3654,11 @@ sal_uLong ScTable::GetColOffset( SCCOL nCol, bool bHiddenAsZero ) const return n; } -ScColumn* ScTable::GetColumnByIndex(sal_Int32 index) +ScColumn* ScTable::GetColumnByIndex( sal_Int32 nIndex ) { -if (ValidCol(index)) +if (ValidCol(nIndex)) { -return &(aCol[index]); +return &(aCol[nIndex]); } return NULL; } commit b51b34ca82411d91e300107b0fca9041ba806366 Author: Eike Rathke Date: Fri Dec 13 20:09:48 2013 +0100 we do have ValidCol(), so use it Change-Id: I50d39f7022edcf851f299fc3589e43bf95f682b5 diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 87e4832..cc7b435 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -3656,7 +3656,7 @@ sal_uLong ScTable::GetColOffset( SC
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/column.hxx |5 +++-- sc/source/core/data/column.cxx | 12 +++- sc/source/core/data/column2.cxx |9 + sc/source/core/data/column3.cxx |8 +--- sc/source/core/data/table1.cxx |3 ++- sc/source/ui/docshell/impex.cxx |8 sc/source/ui/inc/impex.hxx |2 +- 7 files changed, 27 insertions(+), 20 deletions(-) New commits: commit 7504b3dd8ca4424fd7da91195741b566ce42a2c0 Author: Markus Mohrhard Date: Wed Oct 30 22:57:45 2013 +0100 extend the position hint to GetRangeScriptType brings a bit more performance benefits. Still not as much as I expected. Change-Id: I1abead8694acdd965520a9353e84824a68672988 diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 61af67c..3ee53d6 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -470,7 +470,8 @@ public: * Get combined script types of the specified range. This method may * update script types on demand if they have not been determined. */ -sal_uInt8 GetRangeScriptType( sc::CellTextAttrStoreType::iterator& itPos, SCROW nRow1, SCROW nRow2 ); +sal_uInt8 GetRangeScriptType( sc::CellTextAttrStoreType::iterator& itPos, SCROW nRow1, SCROW nRow2, +sc::CellStoreType::iterator itr); void SetScriptType( SCROW nRow, sal_uInt8 nType ); diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 63433c5..018f9e1 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -2952,10 +2952,12 @@ class FindEditCellsHandler { ScColumn& mrColumn; sc::CellTextAttrStoreType::iterator miAttrPos; +sc::CellStoreType::iterator miCellPos; public: -FindEditCellsHandler(ScColumn& rColumn, sc::CellTextAttrStoreType& rAttrs) : -mrColumn(rColumn), miAttrPos(rAttrs.begin()) {} +FindEditCellsHandler(ScColumn& rColumn, sc::CellTextAttrStoreType& rAttrs, +sc::CellStoreType::iterator rCellItr) : +mrColumn(rColumn), miAttrPos(rAttrs.begin()), miCellPos(rCellItr) {} bool operator() (size_t, const EditTextObject*) { @@ -2964,7 +2966,7 @@ public: bool operator() (size_t nRow, const ScFormulaCell* p) { -sal_uInt8 nScriptType = mrColumn.GetRangeScriptType(miAttrPos, nRow, nRow); +sal_uInt8 nScriptType = mrColumn.GetRangeScriptType(miAttrPos, nRow, nRow, miCellPos); if (IsAmbiguousScriptNonZero(nScriptType)) return true; @@ -2981,7 +2983,7 @@ public: for (size_t i = 0; i < nDataSize; ++i) { SCROW nRow = nTopRow + i; -sal_uInt8 nScriptType = mrColumn.GetRangeScriptType(miAttrPos, nRow, nRow); +sal_uInt8 nScriptType = mrColumn.GetRangeScriptType(miAttrPos, nRow, nRow, miCellPos); if (IsAmbiguousScriptNonZero(nScriptType)) // Return the offset from the first row. return RetType(i, true); @@ -3216,7 +3218,7 @@ bool ScColumn::HasEditCells(SCROW nStartRow, SCROW nEndRow, SCROW& rFirst) { // used in GetOptimalHeight - ambiguous script type counts as edit cell -FindEditCellsHandler aFunc(*this, maCellTextAttrs); +FindEditCellsHandler aFunc(*this, maCellTextAttrs, maCells.begin()); std::pair aPos = sc::FindFormulaEditText(maCells, nStartRow, nEndRow, aFunc); diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 207718c..5176d82 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -874,11 +874,12 @@ void ScColumn::GetOptimalHeight( // check for cells with different script type sc::CellTextAttrStoreType::iterator itAttr = maCellTextAttrs.begin(); sc::SingleColumnSpanSet::SpansType::const_iterator it = aSpans.begin(), itEnd = aSpans.end(); +sc::CellStoreType::iterator itCells = maCells.begin(); for (; it != itEnd; ++it) { for (SCROW nRow = it->mnRow1; nRow <= it->mnRow2; ++nRow) { -sal_uInt8 nScript = GetRangeScriptType(itAttr, nRow, nRow); +sal_uInt8 nScript = GetRangeScriptType(itAttr, nRow, nRow, itCells); if (nScript == nDefScript) continue; @@ -2038,7 +2039,7 @@ sal_uInt8 ScColumn::GetScriptType( SCROW nRow ) const } sal_uInt8 ScColumn::GetRangeScriptType( -sc::CellTextAttrStoreType::iterator& itPos, SCROW nRow1, SCROW nRow2 ) +sc::CellTextAttrStoreType::iterator& itPos, SCROW nRow1, SCROW nRow2, sc::CellStoreType::iterator itrCells ) { if (!ValidRow(nRow1) || !ValidRow(nRow2) || nRow1 > nRow2) return 0; @@ -2056,14 +2057,13 @@ sal_uInt8 ScColumn::GetRangeScriptType( sc::celltextattr_block::iterator it = sc::celltextattr_block::begin(*itPos->data); sc::cel
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/globstr.hrc |3 -- sc/source/ui/src/globstr.src |8 - sc/source/ui/view/formatsh.cxx | 59 - 3 files changed, 70 deletions(-) New commits: commit 955281e50e2728932edc3b688ce3cf235bdfd0c9 Author: Eike Rathke Date: Tue Oct 29 19:10:21 2013 +0100 Revert "fix fdo#63546 : set appropriate alignment when writing direction is changed." This reverts commit 16f508686c29bfa244ca6f81b5ab3bbaf5fef2a7. diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 39d8fc6..ef45387 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -2607,29 +2607,6 @@ void ScFormatShell::ExecuteTextDirection( SfxRequest& rReq ) SvxFrameDirection eDirection = ( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT ) ? FRMDIR_HORI_LEFT_TOP : FRMDIR_HORI_RIGHT_TOP; pTabViewShell->ApplyAttr( SvxFrameDirectionItem( eDirection, ATTR_WRITINGDIR ) ); - -const SfxItemSet& rAttrSet = pTabViewShell->GetSelectionPattern()->GetItemSet(); -const SfxPoolItem* pItem = NULL; -const SvxHorJustifyItem* pHorJustify = NULL; -SvxCellHorJustify eHorJustify = SVX_HOR_JUSTIFY_STANDARD; - -if( rAttrSet.GetItemState(ATTR_HOR_JUSTIFY, sal_True, &pItem) == SFX_ITEM_SET ) -{ -pHorJustify = (const SvxHorJustifyItem*)pItem; -eHorJustify = SvxCellHorJustify( pHorJustify->GetValue() ); -} - -if( eHorJustify != SVX_HOR_JUSTIFY_CENTER && eHorJustify != SVX_HOR_JUSTIFY_BLOCK ) -{ -if( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT ) - rReq.AppendItem( SvxHorJustifyItem( SVX_HOR_JUSTIFY_LEFT, SID_H_ALIGNCELL ) ); -else - rReq.AppendItem( SvxHorJustifyItem( SVX_HOR_JUSTIFY_RIGHT, SID_H_ALIGNCELL ) ); - -rReq.SetSlot( SID_H_ALIGNCELL ); -ExecuteSlot( rReq, GetInterface() ); -} - } break; } commit 8276cc057a1caf2e282093fcd90ac7b5a2c1c844 Author: Eike Rathke Date: Tue Oct 29 19:03:24 2013 +0100 Revert "Related: fdo#63546 bundle both changes together as one undo" This reverts commit c4da31d33bcd00230153929bba3165f5257aabde. Conflicts: sc/inc/globstr.hrc sc/source/ui/view/formatsh.cxx Change-Id: If74872b89dff88f1f1fc7fac1a7b6224f3763d26 diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index 9c064fb..688d589 100644 --- a/sc/inc/globstr.hrc +++ b/sc/inc/globstr.hrc @@ -668,9 +668,6 @@ #define STR_INVALIDINPUT542 #define STR_INVALIDCONDITION543 -#define STR_UNDO_L2R544 -#define STR_UNDO_R2L545 - #define STR_FUN_TEXT_SELECTION_COUNT546 #define STR_QUERYREMOVE 547 diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src index acab6b0..a19f2c8 100644 --- a/sc/source/ui/src/globstr.src +++ b/sc/source/ui/src/globstr.src @@ -1784,14 +1784,6 @@ Resource RID_GLOBSTR { Text [ en-US ] = "Insert Current Time"; }; -String STR_UNDO_L2R -{ -Text [ en-US ] = "Left-to-right" ; -}; -String STR_UNDO_R2L -{ -Text [ en-US ] = "Right-to-left" ; -}; String STR_MANAGE_NAMES { Text [ en-US ] = "Manage Names..."; diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index b211617..39d8fc6 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -2606,12 +2606,6 @@ void ScFormatShell::ExecuteTextDirection( SfxRequest& rReq ) { SvxFrameDirection eDirection = ( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT ) ? FRMDIR_HORI_LEFT_TOP : FRMDIR_HORI_RIGHT_TOP; - -OUString aUndo = ScGlobal::GetRscString( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT ? -STR_UNDO_L2R : STR_UNDO_R2L ); -ScDocShell* pDocSh = GetViewData()->GetDocShell(); -pDocSh->GetUndoManager()->EnterListAction( aUndo, aUndo ); - pTabViewShell->ApplyAttr( SvxFrameDirectionItem( eDirection, ATTR_WRITINGDIR ) ); const SfxItemSet& rAttrSet = pTabViewShell->GetSelectionPattern()->GetItemSet(); @@ -2636,7 +2630,6 @@ void ScFormatShell::ExecuteTextDirection( SfxRequest& rReq ) ExecuteSlot( rReq, GetInterface() ); } -pDocSh->GetUndoManager()->LeaveListAction(); } break; } commit 2f29e544932633a01162ecb80e50872eabdd2bc1 Author: Eike Rathke Date: Tue Oct 29 18:17:18 2013 +0100 Revert "fdo#63546: set appropriate alignment when wrt direction of cells is changed." This reverts commit 706e3b8e43df94310b2fe8458da67875073a046c. Related previous commits t
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/compare.hxx |2 sc/inc/scmatrix.hxx |8 ++- sc/source/core/inc/interpre.hxx |2 sc/source/core/tool/interpr1.cxx | 83 +-- sc/source/core/tool/scmatrix.cxx | 64 -- 5 files changed, 99 insertions(+), 60 deletions(-) New commits: commit 75e6bcba872bc1fd7b4316ff219fb6545e9f542d Author: Kohei Yoshida Date: Sat Oct 19 13:55:53 2013 -0400 Construct and initialize result matrix in one step. It's faster this way, than first constructing it then populating it in two separate steps. Change-Id: I61d30ed33a63dcf4c89b18d80ae4c3217cc43015 diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx index b2a5d8d..f2508a6 100644 --- a/sc/inc/scmatrix.hxx +++ b/sc/inc/scmatrix.hxx @@ -202,6 +202,8 @@ public: ScMatrix(SCSIZE nC, SCSIZE nR); ScMatrix(SCSIZE nC, SCSIZE nR, double fInitVal); +ScMatrix( size_t nC, size_t nR, const std::vector& rInitVals ); + /** Clone the matrix. */ ScMatrix* Clone() const; @@ -351,8 +353,8 @@ public: double GetMaxValue( bool bTextAsZero ) const; double GetMinValue( bool bTextAsZero ) const; -void CompareMatrix( -ScMatrix& rResMat, sc::Compare& rComp, size_t nMatPos, sc::CompareOptions* pOptions = NULL ) const; +ScMatrixRef CompareMatrix( +sc::Compare& rComp, size_t nMatPos, sc::CompareOptions* pOptions = NULL ) const; /** * Convert the content of matrix into a linear array of numeric values. diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 69cfa10..2cea9a2 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -1018,11 +1018,6 @@ sc::RangeMatrix ScInterpreter::CompareMat( ScQueryOp eOp, sc::CompareOptions* pO else if (aMat[0].mpMat || aMat[1].mpMat) { size_t i = ( aMat[0].mpMat ? 0 : 1); -SCSIZE nC, nR; -aMat[i].mpMat->GetDimensions(nC, nR); -aRes.mpMat = GetNewMat(nC, nR, false); -if (!aRes.mpMat) -return aRes; aRes.mnCol1 = aMat[i].mnCol1; aRes.mnRow1 = aMat[i].mnRow1; @@ -1032,8 +1027,9 @@ sc::RangeMatrix ScInterpreter::CompareMat( ScQueryOp eOp, sc::CompareOptions* pO aRes.mnTab2 = aMat[i].mnTab2; ScMatrix& rMat = *aMat[i].mpMat; -ScMatrix& rResMat = *aRes.mpMat; -rMat.CompareMatrix(rResMat, aComp, i, pOptions); +aRes.mpMat = rMat.CompareMatrix(aComp, i, pOptions); +if (!aRes.mpMat) +return aRes; } nCurFmtType = nFuncFmtType = NUMBERFORMAT_LOGICAL; diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index 489dcfe..3fbdc7f 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -200,6 +200,9 @@ class ScMatrixImpl public: ScMatrixImpl(SCSIZE nC, SCSIZE nR); ScMatrixImpl(SCSIZE nC, SCSIZE nR, double fInitVal); + +ScMatrixImpl( size_t nC, size_t nR, const std::vector& rInitVals ); + ~ScMatrixImpl(); void Clear(); @@ -269,7 +272,7 @@ public: double GetMaxValue( bool bTextAsZero ) const; double GetMinValue( bool bTextAsZero ) const; -void CompareMatrix( ScMatrix& rResMat, sc::Compare& rComp, size_t nMatPos, sc::CompareOptions* pOptions ) const; +ScMatrixRef CompareMatrix( sc::Compare& rComp, size_t nMatPos, sc::CompareOptions* pOptions ) const; void GetDoubleArray( std::vector& rArray, bool bEmptyAsZero ) const; void MergeDoubleArray( std::vector& rArray, ScMatrix::Op eOp ) const; @@ -289,6 +292,9 @@ ScMatrixImpl::ScMatrixImpl(SCSIZE nC, SCSIZE nR) : ScMatrixImpl::ScMatrixImpl(SCSIZE nC, SCSIZE nR, double fInitVal) : maMat(nR, nC, fInitVal), maMatFlag(nR, nC), pErrorInterpreter(NULL), mbCloneIfConst(true) {} +ScMatrixImpl::ScMatrixImpl( size_t nC, size_t nR, const std::vector& rInitVals ) : +maMat(nR, nC, rInitVals.begin(), rInitVals.end()), maMatFlag(nR, nC), pErrorInterpreter(NULL), mbCloneIfConst(true) {} + ScMatrixImpl::~ScMatrixImpl() { Clear(); @@ -1516,8 +1522,8 @@ double ScMatrixImpl::GetMinValue( bool bTextAsZero ) const return aFunc.getValue(); } -void ScMatrixImpl::CompareMatrix( -ScMatrix& rResMat, sc::Compare& rComp, size_t nMatPos, sc::CompareOptions* pOptions ) const +ScMatrixRef ScMatrixImpl::CompareMatrix( +sc::Compare& rComp, size_t nMatPos, sc::CompareOptions* pOptions ) const { MatrixImplType::size_pair_type aSize = maMat.size(); size_t nSize = aSize.column * aSize.row; @@ -1526,8 +1532,10 @@ void ScMatrixImpl::CompareMatrix( // We assume the result matrix has the same dimension as this matrix. const std::vector& rResVal = aFunc.getValues(); -if (nSize == rResVal.size()) -rResMat.pImpl->maMat.set(0, 0, rResVal.begin(), rResVal.end()); +if (nSize != rResVal.size()) +ScMatrixRef(); + +return ScMatrixRef(new ScMatrix(aSi
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source xmloff/source
sc/inc/colorscale.hxx | 35 + sc/inc/conditio.hxx|2 sc/source/core/data/colorscale.cxx | 154 - sc/source/core/data/conditio.cxx | 17 ++ sc/source/ui/condformat/condformatdlgentry.cxx | 28 ++-- xmloff/source/chart/SchXMLTableContext.cxx | 118 +++ 6 files changed, 338 insertions(+), 16 deletions(-) New commits: commit 17cb1d6d82db56761c86ee95195689cc155901b3 Author: Markus Mohrhard Date: Fri Jun 28 23:28:36 2013 +0200 allow these cond formats to be updated when formula val changes,fdo#64401 When the formulas depend on cells outside of the paint range we need to update the whole range. This approach will update the range more often than necessary but prevents that we need to mess with ScFormulaCell. In the future we should replace ScFormulaCell in this part of the code with something simpler that will correctly fix this problem. Change-Id: Ie8a8e5205f9ea1e43bb6d9f8bee6e0bab29e4840 diff --git a/sc/inc/colorscale.hxx b/sc/inc/colorscale.hxx index 5a390de6..832e09b 100644 --- a/sc/inc/colorscale.hxx +++ b/sc/inc/colorscale.hxx @@ -17,6 +17,9 @@ #include #include "conditio.hxx" +#include +#include + #include //TODO: merge this with conditio.hxx @@ -27,6 +30,24 @@ class ScTokenArray; struct ScDataBarInfo; class BitmapEx; +class ScFormulaListener : public SvtListener +{ +private: +std::vector maCells; +mutable bool mbDirty; +ScDocument* mpDoc; + +void startListening(ScTokenArray* pTokens, const ScAddress& rPos); + +public: +ScFormulaListener(ScFormulaCell* pCell); +virtual ~ScFormulaListener(); + +void Notify( SvtBroadcaster& rBC, const SfxHint& rHint ); + +bool NeedsRepaint() const; +}; + // don't change the order // they are also used in the dialog to determine the position // in the list box @@ -47,6 +68,7 @@ private: double mnVal; Color maColor; boost::scoped_ptr mpCell; +boost::scoped_ptr mpListener; ScColorScaleEntryType meType; public: @@ -60,7 +82,9 @@ public: void SetColor(const Color&); double GetValue() const; void SetValue(double nValue); -void SetFormula(const OUString& rFormula, ScDocument* pDoc, const ScAddress& rAddr, formula::FormulaGrammar::Grammar eGrammar = formula::FormulaGrammar::GRAM_DEFAULT); +void SetFormula(const OUString& rFormula, ScDocument* pDoc, const ScAddress& rAddr, +formula::FormulaGrammar::Grammar eGrammar = formula::FormulaGrammar::GRAM_DEFAULT); + void UpdateMoveTab(SCTAB nOldTab, SCTAB nNewTab, SCTAB nTabNo); void UpdateReference( UpdateRefMode eUpdateRefMode, const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); @@ -71,6 +95,7 @@ public: ScColorScaleEntryType GetType() const; void SetType( ScColorScaleEntryType eType ); +bool NeedsRepaint() const; }; namespace databar @@ -200,6 +225,8 @@ public: virtual void startRendering(); virtual void endRendering(); +virtual bool NeedsRepaint() const = 0; + protected: std::vector& getValues() const; @@ -243,6 +270,8 @@ public: virtual void UpdateReference( UpdateRefMode eUpdateRefMode, const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); +virtual bool NeedsRepaint() const; + virtual condformat::ScFormatEntryType GetType() const; typedef ColorScaleEntries::iterator iterator; typedef ColorScaleEntries::const_iterator const_iterator; @@ -271,6 +300,8 @@ public: virtual void UpdateReference( UpdateRefMode eUpdateRefMode, const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); +virtual bool NeedsRepaint() const; + virtual condformat::ScFormatEntryType GetType() const; private: @@ -313,6 +344,8 @@ public: virtual void UpdateReference( UpdateRefMode eUpdateRefMode, const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); +virtual bool NeedsRepaint() const; + virtual condformat::ScFormatEntryType GetType() const; static ScIconSetMap* getIconSetMap(); diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx index 87cfcc3..42ad1f7 100644 --- a/sc/inc/conditio.hxx +++ b/sc/inc/conditio.hxx @@ -390,6 +390,8 @@ public: // don't use the same name as for the const version ScRangeList& GetRangeList() { return maRanges; } +ScDocument* GetDocument() { return pDoc; } + bool IsEmpty() const; size_t size() const; diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index 70865be..9d4d71b 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -13,12 +13,117 @@ #include "fillinfo.hxx" #include "iconsets.hrc" #include "scresid.hxx" +#include "tokenarray.hxx" + +#include "formula/token.hxx" #include +ScFormulaListener::ScFormulaListener(ScFormulaCell* pCell):
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source sfx2/inc sfx2/Library_sfx.mk sfx2/source sfx2/uiconfig sfx2/UI_sfx.mk sw/inc sw/Library_swui.mk sw/source sw/UI_swriter.mk xmloff/source
sc/inc/document.hxx |4 + sc/inc/unonames.hxx |2 sc/source/core/data/documen2.cxx |3 - sc/source/filter/xml/xmlfonte.cxx| 17 -- sc/source/filter/xml/xmlimprt.cxx|6 ++ sc/source/filter/xml/xmlimprt.hxx|1 sc/source/ui/docshell/docsh.cxx |1 sc/source/ui/unoobj/confuno.cxx | 15 + sfx2/Library_sfx.mk |1 sfx2/UI_sfx.mk |1 sfx2/inc/sfx2/dinfdlg.hxx|1 sfx2/source/dialog/dialog.hrc|1 sfx2/source/dialog/dialog.src|5 + sfx2/source/dialog/dinfdlg.cxx |8 ++ sfx2/source/dialog/documentfontsdialog.cxx | 75 +++ sfx2/source/inc/documentfontsdialog.hxx | 44 +++ sfx2/uiconfig/ui/documentfontspage.ui| 29 ++ sw/Library_swui.mk |1 sw/UI_swriter.mk |1 sw/inc/globals.hrc |2 sw/source/ui/app/app.src |5 - sw/source/ui/app/docsh2.cxx |2 sw/source/ui/dialog/documentfontsdialog.cxx | 54 --- sw/source/ui/dialog/swdlgfact.cxx|4 - sw/source/ui/inc/documentfontsdialog.hxx | 44 --- sw/source/ui/uno/SwXDocumentSettings.cxx |1 xmloff/source/style/XMLFontStylesContext.cxx |1 27 files changed, 211 insertions(+), 118 deletions(-) New commits: commit db28ed792e08d3eef3e901eaedb255bdc66d1db1 Author: Noel Power Date: Thu Feb 21 10:39:10 2013 + adapt writer to use centralised font dialog and fix some minor bugs fixed incorrect return of EmbeddFonts property and also make sure that NotifyEmbeddedFontRead is called on reload Change-Id: I085f50ff88bbf73b5dcdb9630b6c5844430a47c2 diff --git a/sw/Library_swui.mk b/sw/Library_swui.mk index 4731533..771ddfa 100644 --- a/sw/Library_swui.mk +++ b/sw/Library_swui.mk @@ -78,7 +78,6 @@ $(eval $(call gb_Library_add_exception_objects,swui,\ sw/source/ui/dialog/abstract \ sw/source/ui/dialog/addrdlg \ sw/source/ui/dialog/ascfldlg \ -sw/source/ui/dialog/documentfontsdialog \ sw/source/ui/dialog/docstdlg \ sw/source/ui/dialog/macassgn \ sw/source/ui/dialog/swdialmgr \ diff --git a/sw/UI_swriter.mk b/sw/UI_swriter.mk index 86e75e2..d410de6 100644 --- a/sw/UI_swriter.mk +++ b/sw/UI_swriter.mk @@ -21,7 +21,6 @@ $(eval $(call gb_UI_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/columnpage \ sw/uiconfig/swriter/ui/columnwidth \ sw/uiconfig/swriter/ui/converttexttable \ - sw/uiconfig/swriter/ui/documentfontspage \ sw/uiconfig/swriter/ui/endnotepage \ sw/uiconfig/swriter/ui/editcategories \ sw/uiconfig/swriter/ui/exchangedatabases \ diff --git a/sw/inc/globals.hrc b/sw/inc/globals.hrc index 8a2b81d..0653aaf 100644 --- a/sw/inc/globals.hrc +++ b/sw/inc/globals.hrc @@ -30,7 +30,6 @@ #define STR_LOAD_GLOBAL_DOC (RC_GLOBALS_BEGIN + 2) #define STR_DOC_STAT(RC_GLOBALS_BEGIN + 10) -#define STR_DOC_FONTS (RC_GLOBALS_BEGIN + 107) #define STR_PAGE(RC_GLOBALS_BEGIN + 14) #define STR_PRINTOPTUI (RC_GLOBALS_BEGIN + 15) @@ -139,7 +138,6 @@ #define TP_COLUMN (RC_GLOBALS_BEGIN + 13) #define TP_DOC_STAT (RC_GLOBALS_BEGIN + 15) -#define TP_DOC_FONTS(RC_GLOBALS_BEGIN + 108) #define TP_HEADER_PAGE (RC_GLOBALS_BEGIN + 16) #define TP_FOOTER_PAGE (RC_GLOBALS_BEGIN + 17) diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src index 9e1eff6..38f114f 100644 --- a/sw/source/ui/app/app.src +++ b/sw/source/ui/app/app.src @@ -305,11 +305,6 @@ String STR_DOC_STAT Text [ en-US ] = "Statistics" ; }; -String STR_DOC_FONTS -{ -Text [ en-US ] = "Fonts" ; -}; - // // Statusbar-titles // diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index b13e53d..b306ded 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -141,7 +141,7 @@ SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog( { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); -pDlg->AddTabPage(TP_DOC_FONTS, SW_RESSTR(STR_DOC_FONTS),pFact->GetTabPageCreatorFunc( TP_DOC_FONTS ),0); +pDlg->AddFontTabPage(); pDlg->AddTabPage(TP_DOC_STAT, SW_RESSTR(STR_DOC_STAT),pFact->GetTabPageCreatorFunc( TP_DOC_STAT ),0); } } diff --git a/sw/source/ui/dialog/documentfontsdialog.cxx b/sw/source/ui/dialog/documentfontsdialog.cxx deleted fil
[Libreoffice-commits] core.git: 3 commits - sc/inc sc/source
sc/inc/dptabdat.hxx |2 sc/inc/dptabres.hxx | 129 ++--- sc/source/core/data/dptabdat.cxx | 22 +++--- sc/source/core/data/dptabres.cxx | 133 +++ sc/source/core/data/dptabsrc.cxx |4 - 5 files changed, 144 insertions(+), 146 deletions(-) New commits: commit b801a56de6d34f8d7d42a91400482a88801380f4 Author: Kohei Yoshida Date: Thu Feb 14 11:04:58 2013 -0500 Massive sal_Bool to bool conversion. Change-Id: I9fa22b4c5a85b0ddf83a1d7b0e8be0a1134ea19a diff --git a/sc/inc/dptabres.hxx b/sc/inc/dptabres.hxx index 4321651..a2df857 100644 --- a/sc/inc/dptabres.hxx +++ b/sc/inc/dptabres.hxx @@ -170,11 +170,11 @@ public: voidUpdate( const ScDPValue& rNext, ScSubTotalFunc eFunc, const ScDPSubTotalState& rSubState ); voidCalculate( ScSubTotalFunc eFunc, const ScDPSubTotalState& rSubState ); -sal_BoolIsCalculated() const; +bool IsCalculated() const; double GetResult() const; -sal_BoolHasError() const; -sal_BoolHasData() const; +bool HasError() const; +bool HasData() const; voidSetResult( double fNew ); voidSetEmpty( sal_Bool bSet ); @@ -197,7 +197,7 @@ class ScDPRowTotals { ScDPAggData aRowTotal; ScDPAggData aGrandTotal; -sal_BoolbIsInColRoot; +bool bIsInColRoot; public: ScDPRowTotals(); @@ -206,8 +206,8 @@ public: ScDPAggData*GetRowTotal( long nMeasure ); ScDPAggData*GetGrandTotal( long nMeasure ); -sal_BoolIsInColRoot() const { return bIsInColRoot; } -voidSetInColRoot(sal_Bool bSet) { bIsInColRoot = bSet; } +bool IsInColRoot() const { return bIsInColRoot; } +void SetInColRoot(bool bSet) { bIsInColRoot = bSet; } }; // @@ -245,12 +245,12 @@ typedef boost::unordered_map < SCROW, ScDPParentDimData *, MemberHashIndexFunc> class ResultMembers { DimMemberHash maMemberHash; -sal_BoolmbHasHideDetailsMember; +bool mbHasHideDetailsMember; public: ScDPParentDimData* FindMember( const SCROW& nIndex ) const; void InsertMember( ScDPParentDimData* pNew ); -sal_BoolIsHasHideDetailsMembers() const { return mbHasHideDetailsMember; } -voidSetHasHideDetailsMembers( sal_Bool b ) { mbHasHideDetailsMember=b; } +bool IsHasHideDetailsMembers() const { return mbHasHideDetailsMember; } +void SetHasHideDetailsMembers( bool b ) { mbHasHideDetailsMember = b; } ResultMembers(); virtual ~ResultMembers(); }; @@ -261,24 +261,24 @@ private: const ::std::vector& mppDim; const ::std::vector& mppLev; -sal_Bool mbRow; -sal_Bool mbInitChild; -sal_Bool mbAllChildren; +bool mbRow:1; +bool mbInitChild:1; +bool mbAllChildren:1; public: LateInitParams( const ::std::vector& ppDim, const ::std::vector& ppLev, -sal_Bool bRow, sal_Bool bInitChild = sal_True , sal_Bool bAllChildren = false); +bool bRow, bool bInitChild = true, bool bAllChildren = false); ~LateInitParams(); -void SetInitChild( sal_Bool b ) { mbInitChild = b; } -void SetInitAllChildren( sal_Bool b ) { mbAllChildren = b; } +void SetInitChild( bool b ) { mbInitChild = b; } +void SetInitAllChildren( bool b ) { mbAllChildren = b; } inline ScDPDimension* GetDim( size_t nPos ) const { return mppDim[nPos];} inline ScDPLevel* GetLevel( size_t nPos ) const { return mppLev[nPos];} -inline sal_Bool GetInitChild() const {return mbInitChild; } -inline sal_Bool GetInitAllChild() const { return mbAllChildren; } -inline sal_Bool IsRow() const { return mbRow; } -sal_Bool IsEnd( size_t nPos ) const ; +bool GetInitChild() const {return mbInitChild; } +bool GetInitAllChild() const { return mbAllChildren; } +bool IsRow() const { return mbRow; } +bool IsEnd( size_t nPos ) const ; }; class ScDPResultData @@ -346,46 +346,46 @@ private: ScDPParentDimDataaParentDimData; ScDPResultDimension*pChildDimension; ScDPDataMember* pDataRoot; -sal_BoolbHasElements; -sal_BoolbForceSubTotal; -sal_BoolbHasHiddenDetails; -sal_BoolbInitialized; -sal_BoolbAutoHidden; +boolbHasElements:1; +boolbForceSubTotal:1; +boolbHasHiddenDetails:1; +boolbInitialized:1; +boolbAutoHidden:1; ScDPAggData aColTotal; // to store column totals sal_uInt16 nMemberStep;// step to show details public: -ScDPResultMember( const ScDPResultData* pData, const S