/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #ifndef INCLUDED_SC_INC_DPDIMSAVE_HXX #define INCLUDED_SC_INC_DPDIMSAVE_HXX #include #include #include "dpgroup.hxx" #include "scdllapi.h" #include "dptypes.hxx" class ScDPGroupTableData; class ScDPGroupDimension; class ScDPObject; class ScDPCache; class SvNumberFormatter; class ScDPSaveGroupDimension; /** * Classes to save Data Pilot settings that create new dimensions (fields). * These have to be applied before the other ScDPSaveData settings. */ class SC_DLLPUBLIC ScDPSaveGroupItem { OUString aGroupName; ///< name of group std::vector aElements; ///< names of items in original dimension mutable std::vector maItems; ///< items converted from the strings. public: ScDPSaveGroupItem( const OUString& rName ); ~ScDPSaveGroupItem(); void AddToData(ScDPGroupDimension& rDataDim) const; void AddElement( const OUString& rName ); void AddElementsFromGroup( const ScDPSaveGroupItem& rGroup ); const OUString& GetGroupName() const { return aGroupName; } /// @return true if found (removed) bool RemoveElement( const OUString& rName ); bool IsEmpty() const; size_t GetElementCount() const; const OUString* GetElementByIndex(size_t nIndex) const; void Rename( const OUString& rNewName ); /** remove this group's elements from their groups in rDimension (rDimension must be a different dimension from the one which contains this)*/ void RemoveElementsFromGroups( ScDPSaveGroupDimension& rDimension ) const; void ConvertElementsToItems(SvNumberFormatter* pFormatter) const; bool HasInGroup(const ScDPItemData& rItem) const; }; typedef ::std::vector ScDPSaveGroupItemVec; /** * Represents a new group dimension whose dimension ID is higher than the * highest source dimension ID. */ class SC_DLLPUBLIC ScDPSaveGroupDimension { OUString aSourceDim; ///< always the real source from the original data OUString aGroupDimName; ScDPSaveGroupItemVec aGroups; mutable ScDPNumGroupInfo aDateInfo; sal_Int32 nDatePart; public: ScDPSaveGroupDimension( const OUString& rSource, const OUString& rName ); ScDPSaveGroupDimension( const OUString& rSource, const OUString& rName, const ScDPNumGroupInfo& rDateInfo, sal_Int32 nPart ); ~ScDPSaveGroupDimension(); void AddToData( ScDPGroupTableData& rData ) const; void AddToCache(ScDPCache& rCache) const; void SetDateInfo( const ScDPNumGroupInfo& rInfo, sal_Int32 nPart ); void AddGroupItem( const ScDPSaveGroupItem& rItem ); const OUString& GetGroupDimName() const { return aGroupDimName; } const OUString& GetSourceDimName() const { return aSourceDim; } sal_Int32 GetDatePart() const { return nDatePart; } const ScDPNumGroupInfo& GetDateInfo() const { return aDateInfo; } OUString CreateGroupName( const OUString& rPrefix ); const ScDPSaveGroupItem* GetNamedGroup( const OUString& rGroupName ) const; ScDPSaveGroupItem* GetNamedGroupAcc( const OUString& rGroupName ); void RemoveFromGroups( const OUString& rItemName ); void RemoveGroup(const OUString& rGroupName); bool IsEmpty() const; bool HasOnlyHidden(const ScDPUniqueStringSet& rVisible); long GetGroupCount() const; const ScDPSaveGroupItem& GetGroupByIndex( long nIndex ) const; void Rename( const OUString& rNewName ); private: bool IsInGroup(const ScDPItemData& rItem) const; }; /** * Represents a group dimension that introduces a new hierarchy for an * existing dimension. Unlike the ScDPSaveGroupDimension counterpart, it * re-uses the source dimension name and ID. */ class SC_DLLPUBLIC ScDPSaveNumGroupDimension { OUString aDimensionName; mutable ScDPNumGroupInfo aGroupInfo; mutable ScDPNumGroupInfo aDateInfo; sal_Int32 nDatePart; public: ScDPSaveNumGroupDimension( const OUString& rName, const ScDPNumGroupInfo& rInfo ); ScDPSaveNumGroupDimension( const OUString& rName, const ScDPNumGroupInfo& rDateInfo, sal_Int32 nPart ); ~ScDPSaveNumGroupDimension(); void AddToData( ScDPGroupTableData& rData ) const; void AddToCache(ScDPCache& rCache) const; const OUString& GetDimensionName() const { return aDimensionName; } const ScDPNumGroupInfo& GetInfo() const { return aGroupInfo; } sal_Int32 GetDatePart() const { return nDatePart; } const ScDPNumGroupInfo& GetDateInfo() const { return aDateInfo; } void SetGroupInfo( const ScDPNumGroupInfo& rNew ); void SetDateInfo( const ScDPNumGroupInfo& rInfo, sal_Int32 nPart ); }; /** * This class has to do with handling exclusively grouped dimensions? TODO: * Find out what this class does and document it here. */ class SC_DLLPUBLIC ScDPDimensionSaveData { public: ScDPDimensionSaveData(); ~ScDPDimensionSaveData(); bool operator==( const ScDPDimensionSaveData& r ) const; void WriteToData( ScDPGroupTableData& rData ) const; void WriteToCache(ScDPCache& rCache) const; OUString CreateGroupDimName( const OUString& rSourceName, const ScDPObject& rObject, bool bAllowSource, const ::std::vector* pDeletedNames ); OUString CreateDateGroupDimName( sal_Int32 nDatePart, const ScDPObject& rObject, bool bAllowSource, const ::std::vector* pDeletedNames ); void AddGroupDimension( const ScDPSaveGroupDimension& rGroupDim ); void ReplaceGroupDimension( const ScDPSaveGroupDimension& rGroupDim ); void RemoveGroupDimension( const OUString& rGroupDimName ); void AddNumGroupDimension( const ScDPSaveNumGroupDimension& rGroupDim ); void ReplaceNumGroupDimension( const ScDPSaveNumGroupDimension& rGroupDim ); void RemoveNumGroupDimension( const OUString& rGroupDimName ); const ScDPSaveGroupDimension* GetGroupDimForBase( const OUString& rBaseDimName ) const; const ScDPSaveGroupDimension* GetNamedGroupDim( const OUString& rGroupDimName ) const; const ScDPSaveGroupDimension* GetFirstNamedGroupDim( const OUString& rBaseDimName ) const; const ScDPSaveGroupDimension* GetNextNamedGroupDim( const OUString& rGroupDimName ) const; const ScDPSaveNumGroupDimension* GetNumGroupDim( const OUString& rGroupDimName ) const; ScDPSaveGroupDimension* GetGroupDimAccForBase( const OUString& rBaseDimName ); ScDPSaveGroupDimension* GetNamedGroupDimAcc( const OUString& rGroupDimName ); ScDPSaveGroupDimension* GetFirstNamedGroupDimAcc( const OUString& rBaseDimName ); ScDPSaveGroupDimension* GetNextNamedGroupDimAcc( const OUString& rGroupDimName ); ScDPSaveNumGroupDimension* GetNumGroupDimAcc( const OUString& rGroupDimName ); bool HasGroupDimensions() const; sal_Int32 CollectDateParts( const OUString& rBaseDimName ) const; private: typedef ::std::vector< ScDPSaveGroupDimension > ScDPSaveGroupDimVec; typedef ::std::map ScDPSaveNumGroupDimMap; ScDPDimensionSaveData& operator=( const ScDPDimensionSaveData& ) = delete; ScDPSaveGroupDimVec maGroupDims; ScDPSaveNumGroupDimMap maNumGroupDims; }; #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ isz/libreoffice-7-0'>distro/nisz/libreoffice-7-0 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-12-07weld: Rename weld::Treeview selection signal/connectMichael Weghorn
Rename weld::TreeView member + methods to clarify that these are about selection changes: * m_aChangeHdl to m_aSelectionChangedHdl, * signal_changed to signal_selection_changed * connect_changed to connect_selection_changed In GtkInstanceTreeview, also rename the related methods calling signal_selection_changed accordingly for consistency. Change-Id: I299d7930484677395a0bdd0ff105df18688f2e04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178023 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2024-11-28Simplify ScSubTotalParamMike Kaganski
Change-Id: I4c1840e377711ad065c3042bddacb2028481b88d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177433 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-10-28tdf#162262 sc add "Summary below data" option for Subtotal dialogBalazs Varga
With this option we can set where the summary rows should appear, above or below the datas when we create a new Subtotal area. The default option is "True" (which means the summary rows are below the datas) when we create a new subtotal area. Unless if we already have one subtotal area on the same sheet, in that case the sheet level property, "TotalsRowBelow" contains where should the summary rows be for the new Subtotal's. TODO: add new ODF xml attribute for Summary below Change-Id: Icf86c85041d75c24919cb528846d5bb2b517ca78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175556 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2024-05-28loplugin:ostr in sc/../dbguiNoel Grandin
Change-Id: Ife9bda0112a9f76b767c6c8f5afba464da8d8464 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168144 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-05-06ScGlobal::GetUserList never returns nullCaolán McNamara
Change-Id: Ibce3fc1b6d85fc6183fc2552a71ead6443b45fad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167172 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2024-02-18ITEM: Rename for more control over SlotID usagesArmin Le Grand (allotropia)
Change-Id: I51585f1c15984a066262023184f668662853d20f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163556 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-04-02Avoid conversions between OUString and OString in VCLMike Kaganski
Standardize on OUString, which is the main internal string class. Convert from/to OUString only when communicating with respective external APIs. Removes about 200 conversions from the code. Change-Id: I96ecee7c6fd271bb76639220e96d69d2964bed26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149930 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-06-05restore %PRODUCTNAME to accessible descriptions that need themCaolán McNamara
The original problem was that %PRODUCTNAME wasn't replaced for accessibility descriptions (which are reused for extended tips) under gtk. Universally querying all a11y descs on load to potentially replace %PRODUCTNAME in a11y descs at runtime led to tdf146971 which was a huge startup slowdown. The half way 7.3 fix was to leave a11y descs alone, but do the replacement when querying for the extended tip case. So the extended tooltips were ok, but screen readers would still say a raw "%PRODUCTNAME" text, hence the rewording effort to remove %PRODUCTNAME from the a11y descs entirely for 7.4. But there is now a few cases where some options paths exists in the a11y descs which is not exactly correct wrt to the text shown in the options dialog. Reworking the options dialog to not have %PRODUCTNAME there at all and updating everything to fit that sort of change would not be popular. So move the cases where a11y descs really should have %PRODUCTNAME in them out of the .ui files and into .hrc files and use specific set_accessibility_description calls for them via ResID which will do the %PRODUCTNAME replacement automatically. Hopefully the a11y runtime cost for just this handful of cases is negligible in the overall scheme of things. Change-Id: Ieb17d26fd581cd5804a52b371b3bb5ea43023aa3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135432 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-05-17freeze() and thaw() a widget during creation (tdf#149112)Luboš Luňák
The repeated inserts each trigger SvTreeList::GetVisibleCount(), which has a poor performance because of repeated uses of the SvListView::Impl::m_DataTable map. Change-Id: Ibb261a8501a1d5c168b37675e34498386f161595 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134415 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2022-03-01use SfxItemSet::GetItemIfSet in sc/source/ui/Noel Grandin
Change-Id: Ia360a0bbc57f2d50dc26ae670d6e953d3f2d8a8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130745 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-02-11uitest: sc: add a buidable name to the tabs in DataSubTotals dialogXisco Fauli
Change-Id: I045f301083767fa32fd516a4a46823b3af4a6a2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129794 Tested-by: Jenkins Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-02-11Better SCSTR_COLUMN, SCSTR_ROW names, tdf#140290 follow-upEike Rathke
The remaining SCSTR_ROW wasn't used anymore at all, remove. Rename SCSTR_COLUMN -> SCSTR_COLUMN_LETTER "Column %1" SCSTR_COLUMN_NAME -> SCSTR_COLUMN "Column" SCSTR_ROW_NAME -> SCSTR_ROW "Row" Change-Id: I1f68c8d0cc4e970ca508c8ee854f4c59a6d2f7d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129806 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
2021-05-21add Toggleable as a separate thing to a ButtonCaolán McNamara
and inherit ToggleButton from both it and Button Change-Id: If0e500aca8d0ffa087cb5e2bfc1786372fbff4eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115921 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-20use toggle instead of click for CheckButtonCaolán McNamara
Change-Id: Ic8957a59addbf08f2b2e4e84167991f00048c6a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115876 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-05-16fix leak in ScSubTotalParamNoel Grandin
Change-Id: If839585931fc90b9910f6b95338d59ba48a1a78f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115676 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-03-26loplugin:flattenNoel
Change-Id: Ib7a895fba66f8dc9b6501e61631c02694053b7fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113157 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-12cid#1471553 establish that pViewData will never be nullCaolán McNamara
seeing as these are created from CreateScSubTotalDlg and that is always called with a aArgSet containing a ScSubTotalItem with a non-null ScViewData set Change-Id: I1e3d243e4b00d54f9f5015a543556c39d6053f07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109069 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-10merge ScSubTotalItem ctorsCaolán McNamara
Change-Id: Id71c56eb96abc80a1038a9d6cf12bc5124aa8529 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109060 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-12-22more jumbo sheet workNoel Grandin
Change-Id: I67884a0c0b897d8d60f2cfaba644e01f90f7d164 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108123 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-17loplugin:stringviewparam check methods tooNoel
not just functions Change-Id: Icca295dd159002b428b73f2c95d40725434f04d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105789 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-11tdf#133886 - Libreoffice Calc Subtotals check all columns at onceTomofumi Yagi
"Select all columns" checkbox is added to the subtotal group page. Change-Id: Iee5be3218ecb6d74c7c65b2bf49febf0703ebf35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104135 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-15establish that ScViewData::GetDocument can always return ScDocument&Caolán McNamara
we can only be ctored with a ScDocShell& or ScDocument&, and ScDocShell provides a ScDocument& from its GetDocument() so we can always have a ScDocument& when a public ctor has completed some null checks can then be seen to be redundant and are removed Change-Id: Ifaf39cb06e8dbce363999c05ee0aeb3ec4f00428 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102775 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-08-09loplugin:flatten in scNoel Grandin
Change-Id: Iedb6ca37d1b006131d1fc77eca3303a12ccb60c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100401 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-06-08rework treeview initial toggle button col to be like expander colCaolán McNamara
cause this assumption is baked into the vcl one making it hard to adapt remaining cases Change-Id: I75dd5264c65b1ffbf4d26c9a86f6d4d08b400d90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95622 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-05-29change TreeView toggle signal to provide an iter instead of a row indexCaolán McNamara
Change-Id: Ib611780816d170daa40f394b9798640ff6284d68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95056 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>