diff options
Diffstat (limited to 'include')
127 files changed, 953 insertions, 456 deletions
diff --git a/include/basegfx/raster/rasterconvert3d.hxx b/include/basegfx/raster/rasterconvert3d.hxx index 83f753e3184b..25cf2a333f06 100644 --- a/include/basegfx/raster/rasterconvert3d.hxx +++ b/include/basegfx/raster/rasterconvert3d.hxx @@ -21,6 +21,7 @@ #include <config_options.h> #include <sal/types.h> +#include <cassert> #include <vector> #include <osl/diagnose.h> @@ -395,7 +396,7 @@ namespace basegfx { bool operator()(const RasterConversionLineEntry3D* pA, const RasterConversionLineEntry3D* pB) { - OSL_ENSURE(pA && pB, "lineComparator: empty pointer (!)"); + assert(pA && pB && "lineComparator: empty pointer (!)"); return pA->getX().getVal() < pB->getX().getVal(); } }; diff --git a/include/basic/sbmod.hxx b/include/basic/sbmod.hxx index 5c369b441f92..0463ae13f90f 100644 --- a/include/basic/sbmod.hxx +++ b/include/basic/sbmod.hxx @@ -55,7 +55,7 @@ class BASIC_DLLPUBLIC SbModule : public SbxObject std::vector< OUString > mModuleVariableNames; - BASIC_DLLPRIVATE static void implClearIfVarDependsOnDeletedBasic( SbxVariable* pVar, StarBASIC* pDeletedBasic ); + BASIC_DLLPRIVATE static void implClearIfVarDependsOnDeletedBasic(SbxVariable& rVar, StarBASIC* pDeletedBasic); SbModule(const SbModule&) = delete; SbModule& operator=(const SbModule&) = delete; diff --git a/include/canvas/canvastools.hxx b/include/canvas/canvastools.hxx index 0f3b6e81ea7f..8d0c4ed7e0e3 100644 --- a/include/canvas/canvastools.hxx +++ b/include/canvas/canvastools.hxx @@ -377,7 +377,7 @@ namespace canvas SAL_WARN("canvas", "numeric_cast detected data loss"); #endif throw css::uno::RuntimeException( - "numeric_cast detected data loss", + u"numeric_cast detected data loss"_ustr, nullptr ); } diff --git a/include/comphelper/documentconstants.hxx b/include/comphelper/documentconstants.hxx index 929a49458c87..c4372c200809 100644 --- a/include/comphelper/documentconstants.hxx +++ b/include/comphelper/documentconstants.hxx @@ -111,7 +111,7 @@ enum class SfxFilterFlags EXOTIC = 0x00200000, COMBINED = 0x00800000, - ENCRYPTION = 0x01000000, + ENCRYPTION = 0x01000000, // password encryption PASSWORDTOMODIFY = 0x02000000, GPGENCRYPTION = 0x04000000, PREFERED = 0x10000000, diff --git a/include/comphelper/random.hxx b/include/comphelper/random.hxx index 345d57c7158d..1fe4dc5fdf58 100644 --- a/include/comphelper/random.hxx +++ b/include/comphelper/random.hxx @@ -17,6 +17,8 @@ namespace comphelper::rng // These functions obey the SAL_RAND_REPEATABLE environment // variable: If it is set, use a fixed seed. +COMPHELPER_DLLPUBLIC void reseed(); + // note that uniform_int_distribution is inclusive of b, i.e. [a,b] while // uniform_real_distribution is exclusive of b, i.e. [a,b), std::nextafter may be your friend there diff --git a/include/connectivity/dbexception.hxx b/include/connectivity/dbexception.hxx index 7166ec2ef6c4..58705a3e0561 100644 --- a/include/connectivity/dbexception.hxx +++ b/include/connectivity/dbexception.hxx @@ -212,13 +212,13 @@ OOO_DLLPUBLIC_DBTOOLS OUString getStandardSQLState( StandardSQLState _eState ); @throws css::sdbc::SQLException */ -OOO_DLLPUBLIC_DBTOOLS void throwFunctionNotSupportedSQLException( +[[noreturn]] OOO_DLLPUBLIC_DBTOOLS void throwFunctionNotSupportedSQLException( const OUString& _rFunctionName, const css::uno::Reference< css::uno::XInterface >& _rxContext ); /// @throws css::uno::RuntimeException -OOO_DLLPUBLIC_DBTOOLS void throwFunctionNotSupportedRuntimeException( +[[noreturn]] OOO_DLLPUBLIC_DBTOOLS void throwFunctionNotSupportedRuntimeException( const OUString& _rFunctionName, const css::uno::Reference< css::uno::XInterface >& _rxContext ); @@ -227,7 +227,7 @@ OOO_DLLPUBLIC_DBTOOLS void throwFunctionNotSupportedRuntimeException( @throws css::sdbc::SQLException */ -OOO_DLLPUBLIC_DBTOOLS void throwFunctionSequenceException( +[[noreturn]] OOO_DLLPUBLIC_DBTOOLS void throwFunctionSequenceException( const css::uno::Reference< css::uno::XInterface >& Context, const css::uno::Any& Next = css::uno::Any() ); @@ -237,7 +237,7 @@ OOO_DLLPUBLIC_DBTOOLS void throwFunctionSequenceException( @throws css::sdbc::SQLException */ -OOO_DLLPUBLIC_DBTOOLS void throwInvalidIndexException( +[[noreturn]] OOO_DLLPUBLIC_DBTOOLS void throwInvalidIndexException( const css::uno::Reference< css::uno::XInterface >& Context, const css::uno::Any& Next = css::uno::Any() ); @@ -247,7 +247,7 @@ OOO_DLLPUBLIC_DBTOOLS void throwInvalidIndexException( @throws css::sdbc::SQLException */ -OOO_DLLPUBLIC_DBTOOLS void throwGenericSQLException( +[[noreturn]] OOO_DLLPUBLIC_DBTOOLS void throwGenericSQLException( const OUString& _rMsg, const css::uno::Reference< css::uno::XInterface >& _rxSource ); @@ -257,7 +257,7 @@ OOO_DLLPUBLIC_DBTOOLS void throwGenericSQLException( @throws css::sdbc::SQLException */ -OOO_DLLPUBLIC_DBTOOLS void throwGenericSQLException( +[[noreturn]] OOO_DLLPUBLIC_DBTOOLS void throwGenericSQLException( const OUString& _rMsg, const css::uno::Reference< css::uno::XInterface >& _rxSource, const css::uno::Any& _rNextException @@ -272,7 +272,7 @@ OOO_DLLPUBLIC_DBTOOLS void throwGenericSQLException( the context of the exception @throws css::sdbc::SQLException */ -OOO_DLLPUBLIC_DBTOOLS void throwFeatureNotImplementedSQLException( +[[noreturn]] OOO_DLLPUBLIC_DBTOOLS void throwFeatureNotImplementedSQLException( const OUString& _rFeatureName, const css::uno::Reference< css::uno::XInterface >& _rxContext, const css::uno::Any& _rNextException = css::uno::Any() @@ -286,7 +286,7 @@ OOO_DLLPUBLIC_DBTOOLS void throwFeatureNotImplementedSQLException( the context of the exception @throws css::uno::RuntimeException */ -OOO_DLLPUBLIC_DBTOOLS void throwFeatureNotImplementedRuntimeException( +[[noreturn]] OOO_DLLPUBLIC_DBTOOLS void throwFeatureNotImplementedRuntimeException( const OUString& _rFeatureName, const css::uno::Reference< css::uno::XInterface >& _rxContext ); @@ -298,7 +298,7 @@ OOO_DLLPUBLIC_DBTOOLS void throwFeatureNotImplementedRuntimeException( the context of the exception @throws css::sdbc::SQLException */ -OOO_DLLPUBLIC_DBTOOLS void throwInvalidColumnException( +[[noreturn]] OOO_DLLPUBLIC_DBTOOLS void throwInvalidColumnException( const OUString& _rColumnName, const css::uno::Reference< css::uno::XInterface >& _rxContext ); @@ -306,7 +306,7 @@ OOO_DLLPUBLIC_DBTOOLS void throwInvalidColumnException( /** @throws css::sdbc::SQLException */ -OOO_DLLPUBLIC_DBTOOLS void throwSQLException( +[[noreturn]] OOO_DLLPUBLIC_DBTOOLS void throwSQLException( const OUString& _rMessage, const OUString& _rSQLState, const css::uno::Reference< css::uno::XInterface >& _rxContext, @@ -316,7 +316,7 @@ OOO_DLLPUBLIC_DBTOOLS void throwSQLException( /** @throws css::sdbc::SQLException */ -OOO_DLLPUBLIC_DBTOOLS void throwSQLException( +[[noreturn]] OOO_DLLPUBLIC_DBTOOLS void throwSQLException( const OUString& _rMessage, StandardSQLState _eSQLState, const css::uno::Reference< css::uno::XInterface >& _rxContext, diff --git a/include/docmodel/theme/Theme.hxx b/include/docmodel/theme/Theme.hxx index 898cf3d787a7..c13f0549b7a8 100644 --- a/include/docmodel/theme/Theme.hxx +++ b/include/docmodel/theme/Theme.hxx @@ -58,7 +58,7 @@ private: public: FontScheme() - : maName("Office") + : maName(u"Office"_ustr) { } diff --git a/include/editeng/numitem.hxx b/include/editeng/numitem.hxx index 5005a20fa7a1..423a0e2aeda3 100644 --- a/include/editeng/numitem.hxx +++ b/include/editeng/numitem.hxx @@ -104,7 +104,7 @@ public: private: OUString sPrefix; OUString sSuffix; - std::optional<OUString> sListFormat; // Format string ">%1.%2<" can be used instead of prefix/suffix + std::optional<OUString> sListFormat; // Format string ">%1%.%2%<" can be used instead of prefix/suffix // Right now it is optional value to distinguish empty list format // and not set list format when we need to fallback to prefix/suffix. diff --git a/include/editeng/rsiditem.hxx b/include/editeng/rsiditem.hxx index 78ab9b8bface..64b4c1cc2b1f 100644 --- a/include/editeng/rsiditem.hxx +++ b/include/editeng/rsiditem.hxx @@ -32,6 +32,9 @@ public: virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; void dumpAsXml(xmlTextWriterPtr pWriter) const override; + +protected: + virtual ItemInstanceManager* getItemInstanceManager() const override; }; #endif // INCLUDED_EDITENG_RSIDITEM_HXX diff --git a/include/filter/msfilter/escherex.hxx b/include/filter/msfilter/escherex.hxx index b8845ae240a5..196dc7918f6e 100644 --- a/include/filter/msfilter/escherex.hxx +++ b/include/filter/msfilter/escherex.hxx @@ -1062,6 +1062,7 @@ class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable sal_uInt32 mnGroupLevel; SdrLayerID mnHellLayerId; + SdrLayerID mnHeaderFooterHellLayerId; bool mbEscherSpgr; bool mbEscherDg; @@ -1211,6 +1212,8 @@ public: void SetHellLayerId( SdrLayerID nId ) { mnHellLayerId = nId; } SdrLayerID GetHellLayerId() const { return mnHellLayerId; } + void SetHeaderFooterHellLayerId( SdrLayerID nId ) { mnHeaderFooterHellLayerId = nId; } + SdrLayerID GetHeaderFooterHellLayerId() const { return mnHeaderFooterHellLayerId; } private: EscherEx( const EscherEx& ) = delete; diff --git a/include/formula/FormulaCompiler.hxx b/include/formula/FormulaCompiler.hxx index 08710f561b5a..11a49f4680a0 100644 --- a/include/formula/FormulaCompiler.hxx +++ b/include/formula/FormulaCompiler.hxx @@ -344,6 +344,7 @@ protected: virtual void SetError(FormulaError nError); virtual FormulaTokenRef ExtendRangeReference( FormulaToken & rTok1, FormulaToken & rTok2 ); virtual bool HandleExternalReference(const FormulaToken& _aToken); + virtual bool HandleStringName(); virtual bool HandleRange(); virtual bool HandleColRowName(); virtual bool HandleDbData(); @@ -419,6 +420,15 @@ protected: bool mbComputeII; // whether to attempt computing implicit intersection ranges while building the RPN array. bool mbMatrixFlag; // whether the formula is a matrix formula (needed for II computation) + struct LambdaFunc + { + bool bInLambdaFunction = false; + short nBracketPos = 0; + short nParaPos = 0; + short nParaCount = 3; // minimum required parameter count: 3 + std::unordered_set<OUString> aNameSet; + } m_aLambda; + public: enum InitSymbols { diff --git a/include/formula/compiler.hxx b/include/formula/compiler.hxx index 3bb1ccdce126..c9e2e5375b01 100644 --- a/include/formula/compiler.hxx +++ b/include/formula/compiler.hxx @@ -61,6 +61,8 @@ #define SC_OPCODE_TABLE_REF_ITEM_THIS_ROW 35 #define SC_OPCODE_STOP_DIV 36 #define SC_OPCODE_SKIP 37 /* used to skip raw tokens during string compilation */ +#define SC_OPCODE_STRINGNAME 38 /* special OpCode for lambda function names */ +#define SC_OPCODE_LET 39 /*** error constants #... ***/ #define SC_OPCODE_START_ERRORS 40 @@ -514,7 +516,9 @@ #define SC_OPCODE_SORT 501 #define SC_OPCODE_SORTBY 502 #define SC_OPCODE_MAT_SEQUENCE 503 -#define SC_OPCODE_STOP_2_PAR 504 /* last function with two or more parameters' OpCode + 1 */ +#define SC_OPCODE_RANDARRAY 504 +#define SC_OPCODE_UNIQUE 505 +#define SC_OPCODE_STOP_2_PAR 506 /* last function with two or more parameters' OpCode + 1 */ #define SC_OPCODE_STOP_FUNCTION SC_OPCODE_STOP_2_PAR /* last function's OpCode + 1 */ #define SC_OPCODE_LAST_OPCODE_ID (SC_OPCODE_STOP_FUNCTION - 1) /* last OpCode */ diff --git a/include/formula/opcode.hxx b/include/formula/opcode.hxx index bf255bfc532c..8681e95639eb 100644 --- a/include/formula/opcode.hxx +++ b/include/formula/opcode.hxx @@ -38,6 +38,7 @@ enum OpCode : sal_uInt16 ocIfError = SC_OPCODE_IF_ERROR, ocIfNA = SC_OPCODE_IF_NA, ocChoose = SC_OPCODE_CHOOSE, + ocLet = SC_OPCODE_LET, // Parentheses and separators ocOpen = SC_OPCODE_OPEN, ocClose = SC_OPCODE_CLOSE, @@ -61,6 +62,7 @@ enum OpCode : sal_uInt16 ocTableRefItemTotals = SC_OPCODE_TABLE_REF_ITEM_TOTALS, ocTableRefItemThisRow = SC_OPCODE_TABLE_REF_ITEM_THIS_ROW, ocSkip = SC_OPCODE_SKIP, + ocStringName = SC_OPCODE_STRINGNAME, // Access commands ocDBArea = SC_OPCODE_DB_AREA, ocTableRef = SC_OPCODE_TABLE_REF, @@ -510,6 +512,8 @@ enum OpCode : sal_uInt16 ocSort = SC_OPCODE_SORT, ocSortBy = SC_OPCODE_SORTBY, ocMatSequence = SC_OPCODE_MAT_SEQUENCE, + ocRandArray = SC_OPCODE_RANDARRAY, + ocUnique = SC_OPCODE_UNIQUE, // internal stuff ocInternalBegin = SC_OPCODE_INTERNAL_BEGIN, ocTTT = SC_OPCODE_TTT, @@ -551,6 +555,7 @@ inline std::string OpCodeEnumToString(OpCode eCode) case ocMissing: return "Missing"; case ocBad: return "Bad"; case ocStringXML: return "StringXML"; + case ocStringName: return "StringName"; case ocSpaces: return "Spaces"; case ocWhitespace: return "Whitespace"; case ocMatRef: return "MatRef"; @@ -989,9 +994,12 @@ inline std::string OpCodeEnumToString(OpCode eCode) case ocEncodeURL: return "EncodeURL"; case ocFourier: return "Fourier"; case ocRandbetweenNV: return "RandbetweenNV"; + case ocRandArray: return "RandArray"; case ocFilter: return "Filter"; case ocSort: return "Sort"; case ocSortBy: return "SortBy"; + case ocUnique: return "Unique"; + case ocLet: return "Let"; case ocTTT: return "TTT"; case ocDebugVar: return "DebugVar"; case ocDataToken1: return "DataToken1"; diff --git a/include/formula/tokenarray.hxx b/include/formula/tokenarray.hxx index fbf2c186768a..98e1f4dbb17b 100644 --- a/include/formula/tokenarray.hxx +++ b/include/formula/tokenarray.hxx @@ -487,6 +487,7 @@ public: FormulaToken* AddExternal( const OUString& rStr, OpCode eOp = ocExternal ); FormulaToken* AddBad( const OUString& rStr ); /// ocBad with OUString FormulaToken* AddStringXML( const OUString& rStr ); /// ocStringXML with OUString, temporary during import + FormulaToken* AddStringName( const OUString& rStr ); /// ocStringName with OUString - Lambda functions virtual FormulaToken* MergeArray( ); @@ -639,6 +640,7 @@ public: FormulaToken* Next(); FormulaToken* NextNoSpaces(); FormulaToken* GetNextName(); + FormulaToken* GetNextStringName(); FormulaToken* GetNextReference(); FormulaToken* GetNextReferenceRPN(); FormulaToken* GetNextReferenceOrName(); diff --git a/include/fpicker/strings.hrc b/include/fpicker/strings.hrc index 5ff2a07a0c0b..004a06a53f5d 100644 --- a/include/fpicker/strings.hrc +++ b/include/fpicker/strings.hrc @@ -38,5 +38,18 @@ #define STR_FILEDLG_TYPE NC_("STR_FILEDLG_TYPE", "File ~type") #define STR_FILEDLG_SAVE NC_("STR_FILEDLG_SAVE", "Save") +#define STR_FILESAVE_AUTOEXTENSION NC_("STR_FILESAVE_AUTOEXTENSION", "Automatically adds the file extension to the end of the file name that corresponds to the selected file type.") +#define STR_FILESAVE_SAVEWITHPASSWORD NC_("STR_FILESAVE_SAVEWITHPASSWORD", "Protects the file with a password that must be entered before a user can open the file.") +#define STR_FILESAVE_CUSTOMIZEFILTER NC_("STR_FILESAVE_CUSTOMIZEFILTER", "Allows you to set the spreadsheet saving options for some types of data files.") +#define STR_FILEOPEN_READONLY NC_("STR_FILEOPEN_READONLY", "Opens the file in read-only mode.") +#define STR_FILEDLG_LINK_CB NC_("STR_FILEDLG_LINK_CB", "Inserts the selected graphic file as a link.") +#define STR_FILEDLG_PREVIEW_CB NC_("STR_FILEDLG_PREVIEW_CB", "Displays a preview of the selected graphic file.") +#define STR_FILESAVE_DOPLAY NC_("STR_FILESAVE_DOPLAY", "Plays the selected sound file. Click again to stop playing the sound file.") +#define STR_FILEOPEN_VERSION NC_("STR_FILEOPEN_VERSION", "If there are multiple versions of the selected file, select the version that you want to open.") +#define STR_FILESAVE_TEMPLATE NC_("STR_FILESAVE_TEMPLATE", "Select the paragraph style or outline level that you want to use to separate the source document into sub-documents.") +#define STR_FILEOPEN_IMAGE_TEMPLATE NC_("STR_FILEOPEN_IMAGE_TEMPLATE", "Select the frame style for the graphic.") +#define STR_FILEOPEN_IMAGE_ANCHOR NC_("STR_FILEOPEN_IMAGE_ANCHOR", "Select the frame style for the graphic.") +#define STR_FILESAVE_SELECTION NC_("STR_FILESAVE_SELECTION", "Exports only the selected graphic objects in %PRODUCTNAME Draw and Impress to another format. If this box is not checked, the entire document is exported.") + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/i18nutil/paper.hxx b/include/i18nutil/paper.hxx index b84d7b3af074..c097727cfa7c 100644 --- a/include/i18nutil/paper.hxx +++ b/include/i18nutil/paper.hxx @@ -147,7 +147,7 @@ public: static PaperInfo getSystemDefaultPaper(); static PaperInfo getDefaultPaperForLocale(const css::lang::Locale& rLocale); - static Paper fromPSName(const OString& rName); + static Paper fromPSName(std::string_view rName); static OString toPSName(Paper eType); static tools::Long sloppyFitPageDimension(tools::Long nDimension); diff --git a/include/oox/drawingml/color.hxx b/include/oox/drawingml/color.hxx index ea02ef8a03e4..dc8be778f665 100644 --- a/include/oox/drawingml/color.hxx +++ b/include/oox/drawingml/color.hxx @@ -122,6 +122,8 @@ public: static OUString getColorTransformationName( sal_Int32 nElement ); /** Translates between color transformation token names and the corresponding token */ static sal_Int32 getColorTransformationToken( std::u16string_view sName ); + /** Translates between ColorMap token names and the corresponding token */ + static sal_Int32 getColorMapToken(std::u16string_view sName); /// Compares this color with rOther. bool equals(const Color& rOther, const GraphicHelper& rGraphicHelper, ::Color nPhClr) const; diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx index 6937e9057b48..894d42ca89c3 100644 --- a/include/oox/drawingml/shape.hxx +++ b/include/oox/drawingml/shape.hxx @@ -266,7 +266,10 @@ public: // Allows preparation of a local Diagram helper && propagate an eventually // existing one to the data holder object later - SAL_DLLPRIVATE void prepareDiagramHelper(const std::shared_ptr< Diagram >& rDiagramPtr, const std::shared_ptr<::oox::drawingml::Theme>& rTheme); + SAL_DLLPRIVATE void prepareDiagramHelper( + const std::shared_ptr< Diagram >& rDiagramPtr, + const std::shared_ptr<::oox::drawingml::Theme>& rTheme, + bool bSelfCreated); SAL_DLLPRIVATE void propagateDiagramHelper(); // for Writer it is necessary to migrate an existing helper to a new Shape diff --git a/include/oox/helper/graphichelper.hxx b/include/oox/helper/graphichelper.hxx index 0d0b69216617..906d7330dff3 100644 --- a/include/oox/helper/graphichelper.hxx +++ b/include/oox/helper/graphichelper.hxx @@ -77,6 +77,8 @@ public: ::Color getSystemColor( sal_Int32 nToken, ::Color nDefaultRgb = API_RGB_TRANSPARENT ) const; /** Derived classes may implement to resolve a scheme color from the passed XML token identifier. */ virtual ::Color getSchemeColor( sal_Int32 nToken ) const; + /** Derived classes may implement to resolve a ColorMap token from the passed XML token identifier. */ + virtual void getSchemeColorToken(sal_Int32& nToken) const; /** Derived classes may implement to resolve a palette index to an RGB color. */ virtual ::Color getPaletteColor( sal_Int32 nPaletteIdx ) const; diff --git a/include/oox/helper/helper.hxx b/include/oox/helper/helper.hxx index f9bdd1cec9c2..4099204c1a5d 100644 --- a/include/oox/helper/helper.hxx +++ b/include/oox/helper/helper.hxx @@ -54,7 +54,7 @@ template<typename T> constexpr std::make_unsigned_t<T> make_unsigned(T value) { /** Expands to the 'index'-th element of a STATIC data array, or to 'def', if 'index' is out of the array limits. */ #define STATIC_ARRAY_SELECT( array, index, def ) \ - ((detail::make_unsigned(index) < SAL_N_ELEMENTS(array)) ? ((array)[static_cast<size_t>(index)]) : (def)) + ((detail::make_unsigned(index) < std::size(array)) ? ((array)[static_cast<size_t>(index)]) : (def)) // Common constants =========================================================== diff --git a/include/oox/ppt/pptimport.hxx b/include/oox/ppt/pptimport.hxx index fb718ddc70af..d4212f8140e2 100644 --- a/include/oox/ppt/pptimport.hxx +++ b/include/oox/ppt/pptimport.hxx @@ -74,6 +74,7 @@ public: virtual sal_Bool SAL_CALL filter( const css::uno::Sequence< css::beans::PropertyValue >& rDescriptor ) override; + void getSchemeColorToken(sal_Int32& nToken) const; ::Color getSchemeColor( sal_Int32 nToken ) const; virtual std::shared_ptr<::oox::drawingml::Theme> getCurrentThemePtr() const override; diff --git a/include/oox/ppt/presentationfragmenthandler.hxx b/include/oox/ppt/presentationfragmenthandler.hxx index 20fc521ae8c5..29e7bcf12bfc 100644 --- a/include/oox/ppt/presentationfragmenthandler.hxx +++ b/include/oox/ppt/presentationfragmenthandler.hxx @@ -57,6 +57,7 @@ private: ::oox::ppt::PowerPointImport& rFilter, const OUString& rMasterFragmentPath); void saveThemeToGrabBag(const oox::drawingml::ThemePtr& pThemePtr, sal_Int32 nThemeIdx); + void saveColorMapToGrabBag(const oox::drawingml::ClrMapPtr& pClrMapPtr); void importCustomSlideShow(std::vector<CustomShow>& rCustomShowList); static void importSlideNames(::oox::core::XmlFilterBase& rFilter, const std::vector<SlidePersistPtr>& rSlidePersist); diff --git a/include/osl/file.hxx b/include/osl/file.hxx index fcbabe96d674..81702bd847b3 100644 --- a/include/osl/file.hxx +++ b/include/osl/file.hxx @@ -1240,7 +1240,7 @@ public: */ RC sync() const { - OSL_PRECOND(_pData, "File::sync(): File not open"); + SAL_WARN_IF(!_pData, "sal.osl", "File::sync(): File not open"); return static_cast< RC >(osl_syncFile(_pData)); } diff --git a/include/rtl/random.h b/include/rtl/random.h index bc43d8ca5563..1833fa362ce0 100644 --- a/include/rtl/random.h +++ b/include/rtl/random.h @@ -53,15 +53,29 @@ enum __rtl_RandomError */ typedef enum __rtl_RandomError rtlRandomError; +/** Retrieve random bytes + @param[in] Pool use NULL, non-NULL Random Pools are deprecated + @param[in,out] Buffer a buffer to receive the random bytes. + @param[in] Bytes the number of bytes to write to the buffer. + @retval rtl_Random_E_None upon success. + */ +SAL_DLLPUBLIC rtlRandomError SAL_CALL rtl_random_getBytes ( + rtlRandomPool Pool, + void *Buffer, + sal_Size Bytes +) SAL_THROW_EXTERN_C(); + /** Create a Random Pool. @return initialized Random Pool, or NULL upon failure. + @deprecated Instead use rtl_random_getBytes with a NULL Pool */ SAL_DLLPUBLIC rtlRandomPool SAL_CALL rtl_random_createPool (void) SAL_THROW_EXTERN_C(); /** Destroy a Random Pool. @param[in] Pool a Random Pool. + @deprecated Instead use rtl_random_getBytes with a NULL Pool */ SAL_DLLPUBLIC void SAL_CALL rtl_random_destroyPool ( rtlRandomPool Pool @@ -73,7 +87,8 @@ SAL_DLLPUBLIC void SAL_CALL rtl_random_destroyPool ( @param[in] Buffer a buffer containing the bytes to add. @param[in] Bytes the number of bytes to read from the buffer. @retval rtl_Random_E_None upon success. - @deprecated This now does nothing. + @deprecated This now does nothing, instead use rtl_random_getBytes with a + NULL Pool */ SAL_DLLPUBLIC rtlRandomError SAL_CALL rtl_random_addBytes ( rtlRandomPool Pool, @@ -82,18 +97,6 @@ SAL_DLLPUBLIC rtlRandomError SAL_CALL rtl_random_addBytes ( ) SAL_THROW_EXTERN_C(); -/** Retrieve bytes from a Random Pool. - @param[in] Pool a Random Pool. - @param[in,out] Buffer a buffer to receive the random bytes. - @param[in] Bytes the number of bytes to write to the buffer. - @retval rtl_Random_E_None upon success. - */ -SAL_DLLPUBLIC rtlRandomError SAL_CALL rtl_random_getBytes ( - rtlRandomPool Pool, - void *Buffer, - sal_Size Bytes -) SAL_THROW_EXTERN_C(); - #ifdef __cplusplus } #endif diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox index a2240a89a803..6fffb03d7424 100644 --- a/include/sal/log-areas.dox +++ b/include/sal/log-areas.dox @@ -172,6 +172,7 @@ certain functionality. @li @c desktop.migration @li @c desktop.offacc @li @c desktop.splash +@li @c desktop.startuptime - Log area for start up measurement time @li @c desktop.test @li @c desktop.updater diff --git a/include/sal/types.h b/include/sal/types.h index a2ef256239e1..78f5f4639592 100644 --- a/include/sal/types.h +++ b/include/sal/types.h @@ -273,10 +273,10 @@ typedef void * sal_Handle; #endif /** Use this as markup for functions and methods whose return value must be - checked. + used. Compilers that support a construct of this nature will emit a compile - time warning on unchecked return value. + time warning on unused return value. */ #if defined LIBO_INTERNAL_ONLY && defined __cplusplus #define SAL_WARN_UNUSED_RESULT [[nodiscard]] @@ -288,6 +288,19 @@ typedef void * sal_Handle; # define SAL_WARN_UNUSED_RESULT #endif +/** Use this as markup for functions and methods whose return value may be + null and should not be dereferenced unconditionally. + + Compilers that support a construct of this nature will emit a compile + time warning on unconditional dereference of returned pointer. +*/ +#ifdef _MSC_VER +# define SAL_RET_MAYBENULL _Ret_maybenull_ +#else +# define SAL_RET_MAYBENULL +#endif + + /** Use this for pure virtual classes, e.g. class SAL_NO_VTABLE Foo { ... This hinders the compiler from setting a generic vtable stating that a pure virtual function was called and thus slightly reduces code size. diff --git a/include/sax/tools/converter.hxx b/include/sax/tools/converter.hxx index d797eace3042..bb97acc595ac 100644 --- a/include/sax/tools/converter.hxx +++ b/include/sax/tools/converter.hxx @@ -199,16 +199,16 @@ public: static bool convertDouble(double& rValue, std::string_view rString); /** convert number, 10th of degrees with range [0..3600] to SVG angle */ - static void convertAngle(OUStringBuffer& rBuffer, sal_Int16 nAngle, - SvtSaveOptions::ODFSaneDefaultVersion nVersion); + static void convert10thDegAngle(OUStringBuffer& rBuffer, sal_Int16 nAngle, + const bool isWrongOOo10thDegAngle); - /** convert SVG angle to number, 10th of degrees with range [0..3600] */ - static bool convertAngle(sal_Int16& rAngle, std::u16string_view rString, - bool isWrongOOo10thDegAngle); + /** convert SVG angle to number in 10th of degrees */ + static bool convert10thDegAngle(sal_Int16& rAngle, std::u16string_view rString, + bool isWrongOOo10thDegAngle); - /** convert SVG angle to number, 10th of degrees with range [0..3600] */ - static bool convertAngle(sal_Int16& rAngle, std::string_view rString, - bool isWrongOOo10thDegAngle); + /** convert SVG angle to number in 10th of degrees */ + static bool convert10thDegAngle(sal_Int16& rAngle, std::string_view rString, + bool isWrongOOo10thDegAngle); /** convert double to XMLSchema-2 "duration" string; negative durations allowed */ static void convertDuration(OUStringBuffer& rBuffer, diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx index 0805e55264e7..0a7f653b0180 100644 --- a/include/sfx2/basedlgs.hxx +++ b/include/sfx2/basedlgs.hxx @@ -105,8 +105,8 @@ private: public: SfxSingleTabDialogController(weld::Widget* pParent, const SfxItemSet* pOptionsSet, - const OUString& rUIXMLDescription = OUString("sfx/ui/singletabdialog.ui"), - const OUString& rID = OUString("SingleTabDialog")); + const OUString& rUIXMLDescription = u"sfx/ui/singletabdialog.ui"_ustr, + const OUString& rID = u"SingleTabDialog"_ustr); SfxSingleTabDialogController(weld::Widget* pParent, const SfxItemSet* pOptionsSet, const OUString& rContainerId, const OUString& rUIXMLDescription, diff --git a/include/sfx2/bindings.hxx b/include/sfx2/bindings.hxx index 2b85b4dbd065..2fac9d1048ef 100644 --- a/include/sfx2/bindings.hxx +++ b/include/sfx2/bindings.hxx @@ -101,7 +101,7 @@ friend class SfxBindings_Impl; private: SAL_DLLPRIVATE SfxPoolItemHolder Execute_Impl( sal_uInt16 nSlot, const SfxPoolItem **pArgs, sal_uInt16 nModi, - SfxCallMode nCall, const SfxPoolItem **pInternalArgs, bool bGlobalOnly=false); + SfxCallMode nCall, const SfxPoolItem **pInternalArgs); SAL_DLLPRIVATE void SetSubBindings_Impl( SfxBindings* ); SAL_DLLPRIVATE void UpdateSlotServer_Impl(); // Update SlotServer SAL_DLLPRIVATE std::optional<SfxItemSet> CreateSet_Impl(SfxStateCache& rCache, const SfxSlot* &pRealSlot, diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx index d4743ed00ef5..c602a940c6f2 100644 --- a/include/sfx2/dinfdlg.hxx +++ b/include/sfx2/dinfdlg.hxx @@ -244,16 +244,31 @@ private: std::unique_ptr<weld::Entry> m_xTitleEd; std::unique_ptr<weld::Entry> m_xThemaEd; std::unique_ptr<weld::Entry> m_xKeywordsEd; - std::unique_ptr<weld::Entry> m_xContributorEd; - std::unique_ptr<weld::Entry> m_xCoverageEd; - std::unique_ptr<weld::Entry> m_xIdentifierEd; - std::unique_ptr<weld::Entry> m_xPublisherEd; - std::unique_ptr<weld::Entry> m_xRelationEd; - std::unique_ptr<weld::Entry> m_xRightsEd; - std::unique_ptr<weld::Entry> m_xSourceEd; - std::unique_ptr<weld::Entry> m_xTypeEd; + std::unique_ptr<weld::ComboBox> m_xMoreTypes; + std::unique_ptr<weld::Entry> m_xMoreValue; std::unique_ptr<weld::TextView> m_xCommentEd; + DECL_LINK(MoreTypesHdl, weld::ComboBox&, void); + DECL_LINK(MoreValueHdl, weld::Entry&, void); + + OUString m_sMoreValue_Contributor; + OUString m_sMoreValue_Coverage; + OUString m_sMoreValue_Identifier; + OUString m_sMoreValue_Publisher; + OUString m_sMoreValue_Relation; + OUString m_sMoreValue_Rights; + OUString m_sMoreValue_Source; + OUString m_sMoreValue_Type; + + OUString m_sMoreValue_Contributor_Stored; + OUString m_sMoreValue_Coverage_Stored; + OUString m_sMoreValue_Identifier_Stored; + OUString m_sMoreValue_Publisher_Stored; + OUString m_sMoreValue_Relation_Stored; + OUString m_sMoreValue_Rights_Stored; + OUString m_sMoreValue_Source_Stored; + OUString m_sMoreValue_Type_Stored; + virtual bool FillItemSet( SfxItemSet* ) override; virtual void Reset( const SfxItemSet* ) override; diff --git a/include/sfx2/dispatch.hxx b/include/sfx2/dispatch.hxx index 48cb3605a8c0..17d2fa464e3b 100644 --- a/include/sfx2/dispatch.hxx +++ b/include/sfx2/dispatch.hxx @@ -132,12 +132,12 @@ public: bool IsActive( const SfxShell& rShell ); sal_uInt16 GetShellLevel( const SfxShell &rShell ); - SfxBindings* GetBindings() const; + SAL_RET_MAYBENULL SfxBindings* GetBindings() const; void Push( SfxShell& rShell ); void Pop( SfxShell& rShell, SfxDispatcherPopFlags nMode = SfxDispatcherPopFlags::NONE ); - SfxShell* GetShell(sal_uInt16 nIdx) const; + SAL_RET_MAYBENULL SfxShell* GetShell(sal_uInt16 nIdx) const; SfxViewFrame* GetFrame() const; SfxModule* GetModule() const; diff --git a/include/sfx2/docmacromode.hxx b/include/sfx2/docmacromode.hxx index 0816f310b45b..19ce18250175 100644 --- a/include/sfx2/docmacromode.hxx +++ b/include/sfx2/docmacromode.hxx @@ -265,6 +265,7 @@ namespace sfx2 bool hasMacroLibrary() const; bool hasUnsignedContentError() const; + bool hasInvalidSignaturesError() const; /** determines whether the given document storage has sub storages containing scripts or macros. diff --git a/include/sfx2/linkmgr.hxx b/include/sfx2/linkmgr.hxx index af6be44f58b1..1af8e7263197 100644 --- a/include/sfx2/linkmgr.hxx +++ b/include/sfx2/linkmgr.hxx @@ -130,7 +130,8 @@ public: void UpdateAllLinks(bool bAskUpdate, bool bUpdateGrfLinks, - weld::Window* pParentWin); + weld::Window* pParentWin, + OUString const & referer); // Call for list of links (eg for link-dialog) const SvBaseLinks& GetLinks() const { return aLinkTbl; } diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx index c4e88035fd96..3820558d6500 100644 --- a/include/sfx2/lokhelper.hxx +++ b/include/sfx2/lokhelper.hxx @@ -119,6 +119,10 @@ public: static void setDefaultLanguage(const OUString& rBcp47LanguageTag); /// Enable/Disable AT support for the given view. static void setAccessibilityState(int nId, bool nEnabled); + // Set the readonly state of the view. + static void setViewReadOnly(int nId, bool readOnly); + // In readonly view, can user add / modify comments or not. + static void setAllowChangeComments(int nId, bool allow); /// Get the language used by the loading view (used for all save operations). static const LanguageTag & getLoadLanguage(); /// Set the language used by the loading view (used for all save operations). diff --git a/include/sfx2/msg.hxx b/include/sfx2/msg.hxx index 86ecfd423644..88d9f68cf6ca 100644 --- a/include/sfx2/msg.hxx +++ b/include/sfx2/msg.hxx @@ -90,38 +90,41 @@ enum class SfxSlotKind struct SfxTypeAttrib { - sal_uInt16 nAID; - const char* pName; + sal_uInt16 nAID; + OUString aName; }; template<class T> SfxPoolItem* createSfxPoolItem() { return T::CreateDefault(); } + struct SfxType { - std::function<SfxPoolItem* ()> createSfxPoolItemFunc; + SfxPoolItem* (*createSfxPoolItemFunc)(); const std::type_info* pType; sal_uInt16 nAttribs; - SfxTypeAttrib aAttrib[1]; // variable length const std::type_info* Type() const{return pType;} std::unique_ptr<SfxPoolItem> CreateItem() const { return std::unique_ptr<SfxPoolItem>(createSfxPoolItemFunc()); } + inline const SfxTypeAttrib& getAttrib(sal_uInt16 idx) const; }; -struct SfxType0 +struct SfxTypeImpl : public SfxType +{ + SfxTypeAttrib aAttrib[1]; // variable length +}; + +// Some casting to work around the lack of zero-sized trailing arrays in c++ +inline const SfxTypeAttrib& SfxType::getAttrib(sal_uInt16 idx) const +{ return reinterpret_cast<const SfxTypeImpl*>(this)->aAttrib[idx]; } + +struct SfxType0 : public SfxType { - std::function<SfxPoolItem* ()> createSfxPoolItemFunc; - const std::type_info* pType; - sal_uInt16 nAttribs; - const std::type_info* Type() const { return pType;} }; -#define SFX_DECL_TYPE(n) struct SfxType##n \ +#define SFX_DECL_TYPE(n) struct SfxType##n : public SfxType \ { \ - std::function<SfxPoolItem* ()> createSfxPoolItemFunc; \ - const std::type_info* pType; \ - sal_uInt16 nAttribs; \ SfxTypeAttrib aAttrib[n]; \ } @@ -171,7 +174,7 @@ SFX_DECL_TYPE(23); // for SvxSearchItem struct SfxFormalArgument { const SfxType* pType; // Type of the parameter (SfxPoolItem subclass) - const char* pName; // Name of the sParameters + OUString aName; // Name of the sParameters sal_uInt16 nSlotId; // Slot-Id for identification of the Parameters std::unique_ptr<SfxPoolItem> CreateItem() const @@ -201,30 +204,7 @@ public: SfxDisableFlags nDisableFlags; // DisableFlags that need to be // present, so that the Slot // can be enabled - OUString pUnoName; // UnoName for the Slots - -public: - - template <size_t N> - SfxSlot(sal_uInt16 sId, SfxGroupId gId, SfxSlotMode flags, sal_uInt16 masterSlotId, - sal_uInt16 value, SfxExecFunc exec, SfxStateFunc state, const SfxType* type, - const SfxSlot* nextSlot, const SfxFormalArgument* firstArgDef, sal_uInt16 argDefCount, - SfxDisableFlags disableFlags, const char (&literal)[N]) - : nSlotId(sId) - , nGroupId(gId) - , nFlags(flags) - , nMasterSlotId(masterSlotId) - , nValue(value) - , fnExec(exec) - , fnState(state) - , pType(type) - , pNextSlot(nextSlot) - , pFirstArgDef(firstArgDef) - , nArgDefCount(argDefCount) - , nDisableFlags(disableFlags) - , pUnoName(literal) - { - } + OUString aUnoName; // UnoName for the Slots SfxSlotKind GetKind() const; sal_uInt16 GetSlotId() const; @@ -233,7 +213,7 @@ public: SfxGroupId GetGroupId() const; sal_uInt16 GetWhich( const SfxItemPool &rPool ) const; const SfxType* GetType() const { return pType; } - const OUString& GetUnoName() const { return pUnoName; } + const OUString& GetUnoName() const { return aUnoName; } SFX2_DLLPUBLIC OUString GetCommand() const; sal_uInt16 GetFormalArgumentCount() const { return nArgDefCount; } diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index e0b0d3f411a3..eececb850bd9 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -249,12 +249,12 @@ public: static OUString CreateShellID( const SfxObjectShell* pShell ); // Document-Shell Iterator - SAL_WARN_UNUSED_RESULT static SfxObjectShell* GetFirst( const std::function<bool ( const SfxObjectShell* )>& isObjectShell = nullptr, - bool bOnlyVisible = true ); - SAL_WARN_UNUSED_RESULT static SfxObjectShell* GetNext( const SfxObjectShell& rPrev, - const std::function<bool ( const SfxObjectShell* )>& isObjectShell = nullptr, - bool bOnlyVisible = true ); - SAL_WARN_UNUSED_RESULT static SfxObjectShell* Current(); + SAL_RET_MAYBENULL static SfxObjectShell* GetFirst( const std::function<bool ( const SfxObjectShell* )>& isObjectShell = nullptr, + bool bOnlyVisible = true ); + SAL_RET_MAYBENULL static SfxObjectShell* GetNext( const SfxObjectShell& rPrev, + const std::function<bool ( const SfxObjectShell* )>& isObjectShell = nullptr, + bool bOnlyVisible = true ); + SAL_RET_MAYBENULL static SfxObjectShell* Current(); static css::uno::Reference< css::uno::XInterface > GetCurrentComponent(); static void SetCurrentComponent( const css::uno::Reference< css::uno::XInterface >& _rxComponent ); diff --git a/include/sfx2/sfxdlg.hxx b/include/sfx2/sfxdlg.hxx index c4db62792f14..31bd0c3108ad 100644 --- a/include/sfx2/sfxdlg.hxx +++ b/include/sfx2/sfxdlg.hxx @@ -147,8 +147,6 @@ public: virtual VclPtr<VclAbstractDialog> CreateAboutDialog(weld::Window* _pParent) = 0; - virtual VclPtr<VclAbstractDialog> CreateWhatsNewDialog(weld::Window* _pParent, const bool bWelcome) = 0; - virtual VclPtr<VclAbstractDialog> CreateTipOfTheDayDialog(weld::Window* _pParent) = 0; virtual VclPtr<VclAbstractDialog> CreateToolbarmodeDialog(weld::Window* _pParent) = 0; diff --git a/include/sfx2/sfxhelp.hxx b/include/sfx2/sfxhelp.hxx index 212188063c53..e9b412fd4ea4 100644 --- a/include/sfx2/sfxhelp.hxx +++ b/include/sfx2/sfxhelp.hxx @@ -47,8 +47,7 @@ public: SfxHelp(); virtual ~SfxHelp() override; - virtual OUString GetHelpText(const OUString&, const vcl::Window* pWindow) override; - virtual OUString GetHelpText(const OUString&, const weld::Widget* pWindow) override; + virtual OUString GetHelpText(const OUString&) override; static OUString CreateHelpURL( const OUString& aCommandURL, const OUString& rModuleName ); static OUString GetDefaultHelpModule(); diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc index f863d7cb3233..617d4b2363a6 100644 --- a/include/sfx2/sfxsids.hrc +++ b/include/sfx2/sfxsids.hrc @@ -118,8 +118,7 @@ class SvxZoomItem; #define SID_DONATION (SID_SFX_START + 424) #define SID_GETINVOLVED (SID_SFX_START + 425) #define SID_WHATSNEW (SID_SFX_START + 426) // open ReleaseNotesURL -#define SID_WHATSNEWDLG (SID_SFX_START + 427) // show WhatsNewDlg -#define SID_HYPHENATIONMISSING (SID_SFX_START + 428) +#define SID_HYPHENATIONMISSING (SID_SFX_START + 427) #define SID_SHOW_LICENSE (SID_SFX_START + 1683) #define SID_SHOW_CREDITS (SID_SFX_START + 1711) @@ -345,7 +344,7 @@ class SvxZoomItem; #define SID_MODIFIER TypedWhichId<SfxUInt16Item>(SID_SFX_START + 669) #define SID_SETOPTIONS (SID_SFX_START + 670) #define SID_SOURCEVIEW (SID_SFX_START + 675) -#define SID_DOC_STARTPRESENTATION TypedWhichId<SfxBoolItem>(SID_SFX_START + 695) +#define SID_DOC_STARTPRESENTATION TypedWhichId<SfxUInt16Item>(SID_SFX_START + 695) #define SID_DDE_RECONNECT_ONLOAD TypedWhichId<SfxBoolItem>(SID_SFX_START + 696) #define SID_DOCTEMPLATE (SID_SFX_START + 538) diff --git a/include/sfx2/shell.hxx b/include/sfx2/shell.hxx index b454547970a5..420c8d578b95 100644 --- a/include/sfx2/shell.hxx +++ b/include/sfx2/shell.hxx @@ -367,7 +367,7 @@ public: The returned pointer is only valid in the immediate context of the method call. */ - SfxDispatcher* GetDispatcher() const; + SAL_RET_MAYBENULL SfxDispatcher* GetDispatcher() const; /** This method returns a pointer to the <SfxViewFrame> to which this SfxShell @@ -388,7 +388,7 @@ public: <SfxViewShell::GetViewFrame()const> */ - SfxViewFrame* GetFrame() const; + SAL_RET_MAYBENULL SfxViewFrame* GetFrame() const; virtual bool HasUIFeature(SfxShellFeature nFeature) const; void UIFeatureChanged(); diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc index a269b5335a36..35997819573d 100644 --- a/include/sfx2/strings.hrc +++ b/include/sfx2/strings.hrc @@ -260,6 +260,8 @@ #define STR_GET_INVOLVED_BUTTON NC_("STR_GET_INVOLVED_BUTTON", "Get involved") #define STR_DONATE_TEXT NC_("STR_DONATE_TEXT", "Your donations support our worldwide community.") #define STR_DONATE_BUTTON NC_("STR_DONATE_BUTTON", "Donate") +#define STR_WHATSNEW_TEXT NC_("STR_WHATSNEW", "You are running version %PRODUCTVERSION of %PRODUCTNAME for the first time. Do you want to learn what's new?") +#define STR_WHATSNEW_BUTTON NC_("STR_WHATSNEW_BUTTON", "Release Notes") #define STR_READONLY_DOCUMENT NC_("STR_READONLY_DOCUMENT", "This document is open in read-only mode.") #define STR_READONLY_PDF NC_("STR_READONLY_PDF", "This PDF is open in read-only mode to allow signing the existing file.") #define STR_CLASSIFIED_DOCUMENT NC_("STR_CLASSIFIED_DOCUMENT", "The classification label of this document is %1.") @@ -287,6 +289,7 @@ #define STR_MACROS_DISABLED_TITLE NC_("STR_MACROS_DISABLED_TITLE", "Macros disabled") #define STR_CONTAINS_MACROS NC_("STR_CONTAINS_MACROS", "Macros in this document are disabled due to the Macro Security settings.") #define STR_MACROS_DISABLED NC_("STR_MACROS_DISABLED", "Macros are disabled due to the Macro Security settings.") +#define STR_MACROS_DISABLED_SIGNATURE_INVALID NC_("STR_MACROS_DISABLED_SIGNATURE_INVALID", "Macros are signed, but at least one signature has problems.") #define STR_MACROS_DISABLED_CONTENT_UNSIGNED NC_("STR_MACROS_DISABLED_CONTENT_UNSIGNED", "Macros are signed, but the document (containing document events) is not signed.") #define STR_MACROS NC_("STR_MACROS", "Show Macros") #define STR_SECURITY_OPTIONS NC_("STR_MACROS", "Show Security Options") diff --git a/include/sfx2/tplpitem.hxx b/include/sfx2/tplpitem.hxx index d367daa8bb3e..d61981b44de8 100644 --- a/include/sfx2/tplpitem.hxx +++ b/include/sfx2/tplpitem.hxx @@ -34,7 +34,7 @@ public: SfxTemplateItem(); SfxTemplateItem( sal_uInt16 nWhich, OUString aStyle, - OUString aStyleIdentifier = "" ); + OUString aStyleIdentifier = u""_ustr ); const OUString& GetStyleName() const { return aStyle; } const OUString& GetStyleIdentifier() const { return aStyleIdentifier; } diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx index 3d0bf2fcc08a..ff942d4b27b1 100644 --- a/include/sfx2/viewfrm.hxx +++ b/include/sfx2/viewfrm.hxx @@ -63,9 +63,11 @@ class SFX2_DLLPUBLIC SfxViewFrame final : public SfxShell, public SfxListener SAL_DLLPRIVATE virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; DECL_DLLPRIVATE_LINK(GetInvolvedHandler, weld::Button&, void); DECL_DLLPRIVATE_LINK(DonationHandler, weld::Button&, void); + DECL_DLLPRIVATE_LINK(WhatsNewHandler, weld::Button&, void); DECL_DLLPRIVATE_LINK(MacroButtonHandler, weld::Button&, void); DECL_DLLPRIVATE_LINK(SecurityButtonHandler, weld::Button&, void); DECL_DLLPRIVATE_LINK(EventButtonHandler, weld::Button&, void); + DECL_DLLPRIVATE_LINK(ViewSignaturesButtonHandler, weld::Button&, void); DECL_DLLPRIVATE_LINK(SwitchReadOnlyHandler, weld::Button&, void); DECL_DLLPRIVATE_LINK(SignDocumentHandler, weld::Button&, void); DECL_DLLPRIVATE_LINK(HiddenTrackChangesHandler, weld::Button&, void); @@ -96,11 +98,11 @@ public: static SfxViewFrame* LoadDocumentIntoFrame( SfxObjectShell const & i_rDoc, const css::uno::Reference< css::frame::XFrame >& i_rFrameItem ); static SfxViewFrame* DisplayNewDocument( SfxObjectShell const & i_rDoc, const SfxRequest& i_rCreateDocRequest ); - SAL_WARN_UNUSED_RESULT static SfxViewFrame* Current(); - SAL_WARN_UNUSED_RESULT static SfxViewFrame* GetFirst( const SfxObjectShell* pDoc = nullptr, bool bOnlyVisible = true ); - SAL_WARN_UNUSED_RESULT static SfxViewFrame* GetNext( const SfxViewFrame& rPrev, const SfxObjectShell* pDoc = nullptr, bool bOnlyVisible = true ); + SAL_RET_MAYBENULL static SfxViewFrame* Current(); + SAL_RET_MAYBENULL static SfxViewFrame* GetFirst( const SfxObjectShell* pDoc = nullptr, bool bOnlyVisible = true ); + SAL_RET_MAYBENULL static SfxViewFrame* GetNext( const SfxViewFrame& rPrev, const SfxObjectShell* pDoc = nullptr, bool bOnlyVisible = true ); - SAL_WARN_UNUSED_RESULT SAL_DLLPRIVATE static SfxViewFrame* Get( const css::uno::Reference< css::frame::XController>& i_rController, const SfxObjectShell* i_pDoc ); + SAL_RET_MAYBENULL SAL_DLLPRIVATE static SfxViewFrame* Get( const css::uno::Reference< css::frame::XController>& i_rController, const SfxObjectShell* i_pDoc ); SAL_DLLPRIVATE void DoActivate(bool bMDI); SAL_DLLPRIVATE void DoDeactivate(bool bMDI, SfxViewFrame const *pOld); @@ -110,7 +112,7 @@ public: SfxBindings& GetBindings() { return *m_pBindings; } const SfxBindings& GetBindings() const { return *m_pBindings; } vcl::Window& GetWindow() const; - weld::Window* GetFrameWeld() const; + SAL_RET_MAYBENULL weld::Window* GetFrameWeld() const; SAL_DLLPRIVATE SfxProgress* GetProgress() const; diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index 3ebd2f4ec72f..71380213b9c9 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -204,14 +204,14 @@ protected: public: // Iteration - SAL_WARN_UNUSED_RESULT static SfxViewShell* GetFirst( bool bOnlyVisible = true, const std::function<bool ( const SfxViewShell& )>& isViewShell = nullptr ); - SAL_WARN_UNUSED_RESULT static SfxViewShell* GetNext( const SfxViewShell& rPrev, - bool bOnlyVisible = true, - const std::function<bool ( const SfxViewShell& )>& isViewShell = nullptr ); - SAL_WARN_UNUSED_RESULT static SfxViewShell* Current(); + SAL_RET_MAYBENULL static SfxViewShell* GetFirst( bool bOnlyVisible = true, const std::function<bool ( const SfxViewShell& )>& isViewShell = nullptr ); + SAL_RET_MAYBENULL static SfxViewShell* GetNext( const SfxViewShell& rPrev, + bool bOnlyVisible = true, + const std::function<bool ( const SfxViewShell& )>& isViewShell = nullptr ); + SAL_RET_MAYBENULL static SfxViewShell* Current(); SAL_WARN_UNUSED_RESULT static bool IsCurrentLokViewReadOnly(); - SAL_WARN_UNUSED_RESULT static SfxViewShell* Get( const css::uno::Reference< css::frame::XController>& i_rController ); + SAL_RET_MAYBENULL static SfxViewShell* Get( const css::uno::Reference< css::frame::XController>& i_rController ); // Initialize Constructors/Destructors SFX_DECL_INTERFACE(SFX_INTERFACE_SFXVIEWSH) @@ -274,6 +274,7 @@ public: // ILibreOfficeKitNotifier virtual void notifyWindow(vcl::LOKWindowId nLOKWindowId, const OUString& rAction, const std::vector<vcl::LOKPayloadItem>& rPayload = std::vector<vcl::LOKPayloadItem>()) const override; + virtual OString dumpNotifyState() const override; // Focus, KeyInput, Cursor virtual void ShowCursor( bool bOn = true ); diff --git a/include/sot/stg.hxx b/include/sot/stg.hxx index 519b7f701309..66b9c9ac613b 100644 --- a/include/sot/stg.hxx +++ b/include/sot/stg.hxx @@ -86,7 +86,7 @@ public: virtual SotClipboardFormatId GetFormat() = 0; virtual OUString GetUserName() = 0; virtual void FillInfoList( SvStorageInfoList* ) const = 0; - virtual bool CopyTo( BaseStorage* pDestStg ) const = 0; + virtual bool CopyTo( BaseStorage& rDestStg ) const = 0; virtual bool Commit() = 0; virtual bool Revert() = 0; virtual BaseStorageStream* OpenStream( const OUString & rEleName, @@ -173,7 +173,7 @@ public: virtual SotClipboardFormatId GetFormat() override; virtual OUString GetUserName() override; virtual void FillInfoList( SvStorageInfoList* ) const override; - virtual bool CopyTo( BaseStorage* pDestStg ) const override; + virtual bool CopyTo( BaseStorage& rDestStg ) const override; virtual bool Commit() final override; virtual bool Revert() override; virtual BaseStorageStream* OpenStream( const OUString & rEleName, @@ -279,7 +279,7 @@ public: virtual SotClipboardFormatId GetFormat() override; virtual OUString GetUserName() override; virtual void FillInfoList( SvStorageInfoList* ) const override; - virtual bool CopyTo( BaseStorage* pDestStg ) const override; + virtual bool CopyTo( BaseStorage& rDestStg ) const override; virtual bool Commit() final override; virtual bool Revert() override; virtual BaseStorageStream* OpenStream( const OUString & rEleName, diff --git a/include/svl/IndexedStyleSheets.hxx b/include/svl/IndexedStyleSheets.hxx index 685b958fa632..1934bc10af89 100644 --- a/include/svl/IndexedStyleSheets.hxx +++ b/include/svl/IndexedStyleSheets.hxx @@ -145,7 +145,8 @@ public: void Clear(StyleSheetDisposer& cleanup); void Reindex(); - void ReindexOnNameChange(const OUString& rOldName, const OUString& rNewName); + void ReindexOnNameChange(const SfxStyleSheetBase& style, const OUString& rOldName, + const OUString& rNewName); /** Warning: counting for n starts at 0, i.e., the 0th style sheet is the first that is found. */ SfxStyleSheetBase* GetNthStyleSheetThatMatchesPredicate(sal_Int32 n, diff --git a/include/svl/hint.hxx b/include/svl/hint.hxx index e8971934c7d4..3dd3db1763ea 100644 --- a/include/svl/hint.hxx +++ b/include/svl/hint.hxx @@ -61,6 +61,8 @@ enum class SfxHintId { BasicStart, BasicStop, +// SVX + FmDesignModeChanged, // SVX edit source EditSourceParasMoved, EditSourceSelectionChanged, @@ -119,6 +121,7 @@ enum class SfxHintId { SwNavigatorUpdateTracking, SwNavigatorSelectOutlinesWithSelections, SwPreGraphicArrived, + SwPostGraphicArrived, SwGraphicPieceArrived, SwLinkedGraphicStreamArrived, SwLegacyModify, @@ -155,6 +158,14 @@ enum class SfxHintId { SwTableHeadingChange, SwVirtPageNumHint, SwAutoFormatUsedHint, + SwFormatField, + SwFindRedline, + SwModifyChanged, + SwAttr, + SwDocumentDying, + SwRedlineDelText, + SwRedlineUnDelText, + SwMoveText, ThisIsAnSdrHint, ThisIsAnSfxEventHint @@ -195,6 +206,7 @@ inline std::basic_ostream<charT, traits> & operator <<( case SfxHintId::BasicInfoWanted: return stream << "BasicInfoWanted"; case SfxHintId::BasicStart: return stream << "BasicStart"; case SfxHintId::BasicStop: return stream << "BasicStop"; + case SfxHintId::FmDesignModeChanged: return stream << "FmDesignModeChanged"; case SfxHintId::EditSourceParasMoved: return stream << "EditSourceParasMoved"; case SfxHintId::EditSourceSelectionChanged: return stream << "EditSourceSelectionChanged"; case SfxHintId::ScDataChanged: return stream << "ScDataChanged"; @@ -243,6 +255,14 @@ inline std::basic_ostream<charT, traits> & operator <<( return stream << "SwNavigatorSelectOutlinesWithSelections"; case SfxHintId::SwCollectTextMarks: return stream << "SwCollectTextMarks"; case SfxHintId::SwCollectTextTOXMarksForLayout: return stream << "SwCollectTextTOXMarksForLayout"; + case SfxHintId::SwFormatField: return stream << "SwFormatField"; + case SfxHintId::SwFindRedline: return stream << "SwFindRedline"; + case SfxHintId::SwModifyChanged: return stream << "SwModifyChanged"; + case SfxHintId::SwAttr: return stream << "SwAttr"; + case SfxHintId::SwDocumentDying: return stream << "SwDocumentDying"; + case SfxHintId::SwRedlineDelText: return stream << "SwRedlineDelText"; + case SfxHintId::SwRedlineUnDelText: return stream << "SwRedlineUnDelText"; + case SfxHintId::SwMoveText: return stream << "SwMoveText"; case SfxHintId::ThisIsAnSdrHint: return stream << "SdrHint"; default: return stream << "unk(" << std::to_string(int(id)) << ")"; } diff --git a/include/svl/itemiter.hxx b/include/svl/itemiter.hxx index 13cf14b61012..93f1c2a89655 100644 --- a/include/svl/itemiter.hxx +++ b/include/svl/itemiter.hxx @@ -27,32 +27,51 @@ class SfxPoolItem; class SVL_DLLPUBLIC SfxItemIter { const SfxItemSet& m_rSet; - sal_uInt16 m_nStart; - sal_uInt16 m_nEnd; - sal_uInt16 m_nCurrent; + PoolItemMap::const_iterator maCurrent; public: - SfxItemIter(const SfxItemSet& rSet); + SfxItemIter(const SfxItemSet& rSet) + : m_rSet(rSet) + , maCurrent(rSet.m_aPoolItemMap.begin()) + { +#ifdef DBG_UTIL + const_cast<SfxItemSet&>(m_rSet).m_nRegisteredSfxItemIter++; +#endif + } + +#ifdef DBG_UTIL + ~SfxItemIter() { const_cast<SfxItemSet&>(m_rSet).m_nRegisteredSfxItemIter--; } +#endif - /// get item, or null if no items const SfxPoolItem* GetCurItem() const { - return m_rSet.m_nCount ? *(m_rSet.m_ppItems + m_nCurrent) : nullptr; + if (IsAtEnd()) + return nullptr; + + return maCurrent->second; + } + + sal_uInt16 GetCurWhich() const + { + if (IsAtEnd()) + return 0; + + return maCurrent->first; } - const SfxPoolItem* NextItem() { return (m_nCurrent < m_nEnd) ? ImplNextItem() : nullptr; } - bool IsAtEnd() const { return m_nCurrent == m_nEnd; } + const SfxPoolItem* NextItem() + { + if (IsAtEnd()) + return nullptr; - sal_uInt16 GetCurPos() const { return m_nCurrent; } - sal_uInt16 GetFirstPos() const { return m_nStart; } - sal_uInt16 GetLastPos() const { return m_nEnd; } + maCurrent++; + return GetCurItem(); + } + + bool IsAtEnd() const { return maCurrent == m_rSet.m_aPoolItemMap.end(); } SfxItemState GetItemState(bool bSrchInParent = true, const SfxPoolItem** ppItem = nullptr) const; - void ClearItem(); - -private: - const SfxPoolItem* ImplNextItem(); }; #endif diff --git a/include/svl/itemset.hxx b/include/svl/itemset.hxx index 21b146ee393e..2a3ba3c915fa 100644 --- a/include/svl/itemset.hxx +++ b/include/svl/itemset.hxx @@ -23,6 +23,7 @@ #include <cassert> #include <memory> #include <utility> +#include <unordered_map> #include <svl/svldllapi.h> #include <svl/poolitem.hxx> @@ -42,7 +43,7 @@ SVL_DLLPUBLIC void listSfxItemSetUsage(); // ItemSet/ItemPool helpers SfxPoolItem const* implCreateItemEntry(SfxItemPool& rPool, SfxPoolItem const* pSource, bool bPassingOwnership); -void implCleanupItemEntry(SfxPoolItem const* pSource); +void implCleanupItemEntry(const SfxPoolItem* pSource); // coverity[ missing_move_assignment : SUPPRESS] - don't report about missing move assignment class SAL_WARN_UNUSED SVL_DLLPUBLIC SfxPoolItemHolder @@ -75,26 +76,31 @@ public: sal_uInt16 Which() const { if(nullptr != m_pItem) return m_pItem->Which(); return 0; } }; +typedef std::unordered_map<sal_uInt16, const SfxPoolItem*> PoolItemMap; + class SAL_WARN_UNUSED SVL_DLLPUBLIC SfxItemSet { friend class SfxItemIter; friend class SfxWhichIter; + friend class SfxAllItemSet; // allow ItemSetTooling to access friend SfxPoolItem const* implCreateItemEntry(SfxItemPool&, SfxPoolItem const*, bool); - friend void implCleanupItemEntry(SfxPoolItem const*); + friend void implCleanupItemEntry(const SfxPoolItem*); SfxItemPool* m_pPool; ///< pool that stores the items const SfxItemSet* m_pParent; ///< derivation - sal_uInt16 m_nCount; ///< number of items sal_uInt16 m_nRegister; ///< number of items with NeedsSurrogateSupport - // bitfield (better packaging if a bool needs to be added) - bool m_bItemsFixed : 1; ///< true if this is a SfxItemSetFixed object, so does not *own* m_ppItems +#ifdef DBG_UTIL + sal_uInt16 m_nRegisteredSfxItemIter; +#endif - SfxPoolItem const** m_ppItems; ///< pointer to array of items, we allocate and free this unless m_bItemsFixed==true WhichRangesContainer m_aWhichRanges; ///< array of Which Ranges + // the set SfxPoolItems, indexed by WhichID + PoolItemMap m_aPoolItemMap; + // Notification-Callback mechanism for SwAttrSet in SW, functionPtr for callback std::function<void(const SfxPoolItem*, const SfxPoolItem*)> m_aCallback; @@ -107,56 +113,26 @@ protected: void setCallback(const std::function<void(const SfxPoolItem*, const SfxPoolItem*)> &func) { m_aCallback = func; } void clearCallback() { m_aCallback = nullptr; } - // container library interface support - // only for internal use (for now), thus protected - using const_iterator = SfxPoolItem const**; - - const_iterator begin() const noexcept { return m_ppItems; } - const_iterator end() const noexcept { return begin() + TotalCount(); } - - bool empty() const noexcept { return 0 == TotalCount(); } - sal_Int32 size() const noexcept { return TotalCount(); } - SfxPoolItem const* operator[](sal_Int32 idx) const noexcept - { - assert(idx >= 0 && idx < TotalCount() && "index out of range"); - return m_ppItems[idx]; - } - -friend class SfxAllItemSet; - -private: - SVL_DLLPRIVATE void RecreateRanges_Impl(const WhichRangesContainer& pNewRanges); - -public: - SfxPoolItem const** GetItems_Impl() const { return m_ppItems; } - -private: - const SfxItemSet& operator=(const SfxItemSet &) = delete; - -protected: virtual const SfxPoolItem* PutImpl( const SfxPoolItem&, bool bPassingOwnership ); const SfxPoolItem* PutImplAsTargetWhich( const SfxPoolItem&, sal_uInt16 nTargetWhich, bool bPassingOwnership ); - /** special constructor for SfxAllItemSet */ - enum class SfxAllItemSetFlag { Flag }; - SfxItemSet( SfxItemPool&, SfxAllItemSetFlag ); - /** special constructor for SfxItemSetFixed */ - SfxItemSet( SfxItemPool&, WhichRangesContainer&& ranges, SfxPoolItem const ** ppItems); - /** special constructor for SfxItemSetFixed copy constructor */ - SfxItemSet( const SfxItemSet& rOther, SfxPoolItem const ** ppMyItems ); +private: + SVL_DLLPRIVATE void RecreateRanges_Impl(const WhichRangesContainer& pNewRanges); + const SfxItemSet& operator=(const SfxItemSet &) = delete; public: SfxItemSet( const SfxItemSet& ); SfxItemSet( SfxItemSet&& ) noexcept; SfxItemSet( SfxItemPool& ); SfxItemSet( SfxItemPool&, WhichRangesContainer ranges ); - SfxItemSet( SfxItemPool& rPool, sal_uInt16 nWhichStart, sal_uInt16 nWhichEnd ) : SfxItemSet(rPool, WhichRangesContainer(nWhichStart, nWhichEnd)) {} template<sal_uInt16... WIDs> - SfxItemSet(SfxItemPool& pool, svl::Items_t<WIDs...> wids) - : SfxItemSet(pool, WhichRangesContainer(wids)) {} + static SfxItemSet makeFixedSfxItemSet(SfxItemPool& pool) + { + return SfxItemSet(pool, WhichRangesContainer(svl::Items_t<WIDs...>{})); + } virtual ~SfxItemSet(); @@ -166,11 +142,9 @@ public: SfxItemSet CloneAsValue(bool bItems = true, SfxItemPool *pToPool = nullptr) const; // Get number of items - sal_uInt16 Count() const { return m_nCount; } + sal_uInt16 Count() const { return m_aPoolItemMap.size(); } sal_uInt16 TotalCount() const { return m_aWhichRanges.TotalCount(); } - bool IsItemsFixed() const { return m_bItemsFixed; } - const SfxPoolItem& Get( sal_uInt16 nWhich, bool bSrchInParent = true ) const; template<class T> const T& Get( TypedWhichId<T> nWhich, bool bSrchInParent = true ) const @@ -200,7 +174,6 @@ public: return GetItem<T>(sal_uInt16(nWhich), bSearchInParent); } - /// Templatized static version of GetItem() to directly return the correct type if the SfxItemSet is available. template<class T> static const T* GetItem(const SfxItemSet* pItemSet, sal_uInt16 nWhich, bool bSearchInParent) { @@ -216,12 +189,6 @@ public: return GetItem<T>(pItemSet, static_cast<sal_uInt16>(nWhich), bSearchInParent); } - sal_uInt16 GetWhichByOffset(sal_uInt16 nOffset) const; - - // Optimised variant for those situations where we know exactly what our which ranges are, - // and we can determine the offset at compile time. - const SfxPoolItem& GetByOffset(sal_uInt16 nWhich, sal_uInt16 nOffset) const; - SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent = true, const SfxPoolItem **ppItem = nullptr) const { // use local helper, start value for looped-through SfxItemState value is SfxItemState::UNKNOWN @@ -256,10 +223,12 @@ public: { DisableOrInvalidateItem_ForWhichID(false, nWhich); } sal_uInt16 ClearItem( sal_uInt16 nWhich = 0); void ClearInvalidItems(); - inline void SetParent( const SfxItemSet* pNew ); + inline void SetParent( const SfxItemSet* pNew ) + { + m_pParent = pNew; + } // add, delete items, work on items -public: const SfxPoolItem* Put( const SfxPoolItem& rItem ) { return PutImpl(rItem, /*bPassingOwnership*/false); } const SfxPoolItem* Put( std::unique_ptr<SfxPoolItem> xItem ) @@ -306,35 +275,26 @@ public: void dumpAsXml(xmlTextWriterPtr pWriter) const; private: - // split version(s) of ClearSingleItemImpl for input types WhichID and Offset + // split version(s) of ClearSingleItemImpl for input type WhichID sal_uInt16 ClearSingleItem_ForWhichID( sal_uInt16 nWhich ); - sal_uInt16 ClearSingleItem_ForOffset( sal_uInt16 nOffset ); + void ClearSingleItem_PrepareRemove(const SfxPoolItem* pItem); // cleanup all Items, but do not reset/change m_ppItems array. That is // responsibility of the caller & allows specific resets sal_uInt16 ClearAllItemsImpl(); // Merge two given Item(entries) - void MergeItem_Impl(const SfxPoolItem **ppFnd1, const SfxPoolItem *pFnd2, bool bIgnoreDefaults); + void MergeItem_Impl(sal_uInt16 nWhich, const SfxPoolItem *pFnd2, bool bIgnoreDefaults); - // split version(s) of InvalidateItem/DisableItem for input types WhichID and Offset + // InvalidateItem/DisableItem for input types WhichID and Offset void DisableOrInvalidateItem_ForWhichID(bool bDsiable, sal_uInt16 nWhich); - void DisableOrInvalidateItem_ForOffset(bool bDisable, sal_uInt16 nOffset); - // split version(s) of GetItemStateImpl for input types WhichID and Offset + // GetItemStateImpl for input type WhichID SfxItemState GetItemState_ForWhichID( SfxItemState eState, sal_uInt16 nWhich, bool bSrchInParent, const SfxPoolItem **ppItem) const; - SfxItemState GetItemState_ForOffset( sal_uInt16 nOffset, const SfxPoolItem **ppItem) const; }; -inline void SfxItemSet::SetParent( const SfxItemSet* pNew ) -{ - m_pParent = pNew; -} - -class SVL_DLLPUBLIC SfxAllItemSet final : public SfxItemSet - // Handles all Ranges. Ranges are automatically modified by putting items. - +class SVL_DLLPUBLIC SfxAllItemSet final : public SfxItemSet { public: SfxAllItemSet( SfxItemPool &rPool ); @@ -347,41 +307,17 @@ private: }; -namespace svl::detail -{ -/** - * Determines the number of sal_uInt16s in a container of pairs of - * sal_uInt16s, each representing a range of sal_uInt16s, and total capacity of the ranges. - */ -template <sal_uInt16 WID1, sal_uInt16 WID2, sal_uInt16... Rest> -static constexpr sal_uInt16 CountRanges1() -{ - sal_uInt16 nCapacity = rangeSize(WID1, WID2); - if constexpr (sizeof...(Rest) > 0) - nCapacity += CountRanges1<Rest...>(); - return nCapacity; -}} - -// Split out the array because we need it to be initialised before we call -// the SfxItemSet constructor -template<sal_uInt16... WIDs> -struct SfxItemSetFixedStorage -{ - static constexpr sal_uInt16 NITEMS = svl::detail::CountRanges1<WIDs...>(); - const SfxPoolItem* m_aItems[NITEMS] {}; -}; - -// Allocate the items array inside the object, to reduce allocation cost. -// +// Was: Allocate the items array inside the object, to reduce allocation cost. +// NOTE: No longer needed with unordered_set, but there are 560+ places to +// replace/adapt, so keep it for now. +// To adapt, there is the static makeFixedSfxItemSet member in SfxItemSet. Did +// that in one place to check functionality (easy hack...?) template<sal_uInt16... WIDs> -class SfxItemSetFixed : public SfxItemSetFixedStorage<WIDs...>, public SfxItemSet +class SfxItemSetFixed : public SfxItemSet { public: SfxItemSetFixed( SfxItemPool& rPool) - : SfxItemSet(rPool, WhichRangesContainer(svl::Items_t<WIDs...>{}), - SfxItemSetFixedStorage<WIDs...>::m_aItems) {} - SfxItemSetFixed( const SfxItemSetFixed<WIDs...>& rOther ) - : SfxItemSet(rOther, SfxItemSetFixedStorage<WIDs...>::m_aItems) {} + : SfxItemSet(rPool, WhichRangesContainer(svl::Items_t<WIDs...>{})){}//, }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svl/sigstruct.hxx b/include/svl/sigstruct.hxx index 20cb0ebd2d0a..5b1609f7f9c1 100644 --- a/include/svl/sigstruct.hxx +++ b/include/svl/sigstruct.hxx @@ -53,9 +53,7 @@ struct SignatureReferenceInformation SignatureReferenceInformation() : nType(SignatureReferenceType::SAMEDOCUMENT), - ouURI(""), - nDigestID(css::xml::crypto::DigestID::SHA1), - ouDigestValue("") + nDigestID(css::xml::crypto::DigestID::SHA1) { } diff --git a/include/svl/style.hxx b/include/svl/style.hxx index 018da0a04e67..522ef2437c60 100644 --- a/include/svl/style.hxx +++ b/include/svl/style.hxx @@ -275,7 +275,7 @@ public: virtual SfxStyleSheetBase* Find( const OUString&, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All ); void Reindex(); - void ReindexOnNameChange(const OUString& rOldName, const OUString& rNewName); + void ReindexOnNameChange(const SfxStyleSheetBase& style, const OUString& rOldName, const OUString& rNewName); /** Add a style sheet. * Not an actual public function. Do not call it from non-subclasses. */ diff --git a/include/svl/whichranges.hxx b/include/svl/whichranges.hxx index 0ed5e56835c4..53413d8c4c9e 100644 --- a/include/svl/whichranges.hxx +++ b/include/svl/whichranges.hxx @@ -86,7 +86,7 @@ class SVL_DLLPUBLIC WhichRangesContainer mutable sal_uInt16 m_TotalCount = 0; // variables for buffering the last used WhichPair to allow fast answers - // in getOffsetFromWhich + // in doesContainWhich mutable sal_uInt16 m_aLastWhichPairOffset = INVALID_WHICHPAIR_OFFSET; mutable sal_uInt16 m_aLastWhichPairFirst = 0; mutable sal_uInt16 m_aLastWhichPairSecond = 0; @@ -167,12 +167,10 @@ public: void reset(); - // calculate and return the offset inside the fixed SfxPoolItem - // array of SfxItemPool - sal_uInt16 getOffsetFromWhich(sal_uInt16 nWhich) const; - - // extract the WhichID for given offset - sal_uInt16 getWhichFromOffset(sal_uInt16 nOffset) const; + // calculate and return if nWhich is member of one of + // the local WhichRanges and such contained in the + // defined range + bool doesContainWhich(sal_uInt16 nWhich) const; // Adds a range to which ranges, keeping the ranges in valid state (sorted, non-overlapping) SAL_WARN_UNUSED_RESULT WhichRangesContainer MergeRange(sal_uInt16 nFrom, sal_uInt16 nTo) const; diff --git a/include/svl/whiter.hxx b/include/svl/whiter.hxx index 155d02d7f3ab..f83126a8ccdb 100644 --- a/include/svl/whiter.hxx +++ b/include/svl/whiter.hxx @@ -20,8 +20,8 @@ #include <svl/svldllapi.h> #include <svl/whichranges.hxx> +#include <svl/itemset.hxx> -class SfxItemSet; class SfxPoolItem; enum class SfxItemState; @@ -35,18 +35,35 @@ class SVL_DLLPUBLIC SfxWhichIter const SfxItemSet& m_rItemSet; const WhichPair* m_pCurrentWhichPair; sal_uInt16 m_nOffsetFromStartOfCurrentWhichPair; - /// Offset into m_ppItems array in SfxItemSet - sal_uInt16 m_nItemsOffset; public: - SfxWhichIter(const SfxItemSet& rSet); + SfxWhichIter(const SfxItemSet& rSet) + : m_rItemSet(rSet) + , m_pCurrentWhichPair(rSet.m_aWhichRanges.begin()) + , m_nOffsetFromStartOfCurrentWhichPair(0) + { + } sal_uInt16 GetCurWhich() const; sal_uInt16 NextWhich(); sal_uInt16 FirstWhich(); - SfxItemState GetItemState(bool bSrchInParent = true, - const SfxPoolItem** ppItem = nullptr) const; - void ClearItem(); + + SfxItemState GetItemState(bool bSrchInParent = true, const SfxPoolItem** ppItem = nullptr) const + { + const sal_uInt16 nWhich(GetCurWhich()); + if (0 == nWhich) + return SfxItemState::UNKNOWN; + return m_rItemSet.GetItemState_ForWhichID(SfxItemState::UNKNOWN, nWhich, bSrchInParent, + ppItem); + } + + void ClearItem() + { + const sal_uInt16 nWhich(GetCurWhich()); + if (0 == nWhich) + return; + const_cast<SfxItemSet&>(m_rItemSet).ClearSingleItem_ForWhichID(nWhich); + } }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svtools/editbrowsebox.hxx b/include/svtools/editbrowsebox.hxx index 9dcc6440bb81..8acd3fd760c9 100644 --- a/include/svtools/editbrowsebox.hxx +++ b/include/svtools/editbrowsebox.hxx @@ -829,6 +829,8 @@ namespace svt void SetDate(const Date& rDate); + virtual void SetEditableReadOnly(bool bReadOnly) override; + virtual void dispose() override; private: std::unique_ptr<weld::MenuButton> m_xMenuButton; diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx index 8acc70aa14c1..a7a0a581f941 100644 --- a/include/svtools/ruler.hxx +++ b/include/svtools/ruler.hxx @@ -691,8 +691,12 @@ private: SVT_DLLPRIVATE bool ImplDoHitTest( const Point& rPosition, RulerSelection* pHitTest, bool bRequiredStyle = false, - RulerIndentStyle nRequiredStyle = RulerIndentStyle::Top ) const; - SVT_DLLPRIVATE bool ImplDocHitTest( const Point& rPos, RulerType eDragType, RulerSelection* pHitTest ) const; + RulerIndentStyle nRequiredStyle = RulerIndentStyle::Top, + tools::Long nTolerance = 1 ) const; + SVT_DLLPRIVATE bool ImplDocHitTest( const Point& rPos, + RulerType eDragType, + RulerSelection* pHitTest, + tools::Long nTolerance = 1 ) const; SVT_DLLPRIVATE bool ImplStartDrag( RulerSelection const * pHitTest, sal_uInt16 nModifier ); SVT_DLLPRIVATE void ImplDrag( const Point& rPos ); SVT_DLLPRIVATE void ImplEndDrag(); @@ -743,7 +747,8 @@ public: void SetExtraType( RulerExtra eNewExtraType, sal_uInt16 nStyle = 0 ); bool StartDocDrag( const MouseEvent& rMEvt, - RulerType eDragType ); + RulerType eDragType, + tools::Long nTolerance = 1 ); RulerType GetDragType() const { return meDragType; } tools::Long GetDragPos() const { return mnDragPos; } sal_uInt16 GetDragAryPos() const { return mnDragAryPos; } diff --git a/include/svx/ClassificationField.hxx b/include/svx/ClassificationField.hxx index e2b5a71ab775..4e2633d0392b 100644 --- a/include/svx/ClassificationField.hxx +++ b/include/svx/ClassificationField.hxx @@ -36,7 +36,7 @@ public: OUString msIdentifier; //< The identifier of this entry (from example.xml). ClassificationResult(ClassificationType eType, OUString sName, - OUString sAbbreviatedName, OUString sIdentifier = "") + OUString sAbbreviatedName, OUString sIdentifier = u""_ustr) : meType(eType) , msName(std::move(sName)) , msAbbreviatedName(std::move(sAbbreviatedName)) diff --git a/include/svx/annotation/Annotation.hxx b/include/svx/annotation/Annotation.hxx index 5ec5e2ec3c34..f7917b608e9c 100644 --- a/include/svx/annotation/Annotation.hxx +++ b/include/svx/annotation/Annotation.hxx @@ -20,6 +20,8 @@ #include <comphelper/compbase.hxx> #include <cppuhelper/propertysetmixin.hxx> #include <svx/annotation/Annotation.hxx> +#include <svx/annotation/TextAPI.hxx> +#include <vcl/bitmapex.hxx> class SdrUndoAction; class SfxViewShell; @@ -29,6 +31,7 @@ namespace sdr::annotation { class Annotation; +/** Type of the annotation / comment change. */ enum class CommentNotificationType { Add, @@ -36,10 +39,47 @@ enum class CommentNotificationType Remove }; +/** LOKit notify for a view */ SVXCORE_DLLPUBLIC void LOKCommentNotify(CommentNotificationType nType, const SfxViewShell* pViewShell, Annotation& rAnnotation); + +/** LOKit notify for all views */ SVXCORE_DLLPUBLIC void LOKCommentNotifyAll(CommentNotificationType nType, Annotation& rAnnotation); +/** Type of the annotation (that is supported) */ +enum class AnnotationType +{ + None, + Square, + Polygon, + Circle, + Ink, + Highlight, + Line, + FreeText, + Stamp +}; + +/** Annotation data that is used at annotation creation */ +struct CreationInfo +{ + AnnotationType meType = AnnotationType::None; + + std::vector<basegfx::B2DPolygon> maPolygons; + basegfx::B2DRectangle maRectangle; + + float mnWidth = 0.0f; + + bool mbFillColor = false; + Color maFillColor = COL_TRANSPARENT; + + bool mbColor = false; + Color maColor = COL_TRANSPARENT; + + BitmapEx maBitmapEx; +}; + +/** Data of an annotation */ struct SVXCORE_DLLPUBLIC AnnotationData { css::geometry::RealPoint2D m_Position; @@ -53,6 +93,11 @@ struct SVXCORE_DLLPUBLIC AnnotationData void set(Annotation& rAnnotation); }; +/** Annotation object, responsible for handling of the annotation. + * + * Implements the XAnnotation UNO API, handles undo/redo and notifications () + * + **/ class SVXCORE_DLLPUBLIC Annotation : public ::comphelper::WeakComponentImplHelper<css::office::XAnnotation>, public ::cppu::PropertySetMixin<css::office::XAnnotation> @@ -70,8 +115,9 @@ protected: OUString m_Author; OUString m_Initials; css::util::DateTime m_DateTime; + rtl::Reference<sdr::annotation::TextApiObject> m_TextRange; - bool m_bIsFreeText = false; + CreationInfo maCreationInfo; std::unique_ptr<SdrUndoAction> createUndoAnnotation(); @@ -84,13 +130,14 @@ public: virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const& type) override; virtual void SAL_CALL acquire() noexcept override { - ::comphelper::WeakComponentImplHelper<css::office::XAnnotation>::acquire(); + comphelper::WeakComponentImplHelper<css::office::XAnnotation>::acquire(); } virtual void SAL_CALL release() noexcept override { - ::comphelper::WeakComponentImplHelper<css::office::XAnnotation>::release(); + comphelper::WeakComponentImplHelper<css::office::XAnnotation>::release(); } + // Changes without triggering notification broadcast css::geometry::RealPoint2D GetPosition() const { return m_Position; } void SetPosition(const css::geometry::RealPoint2D& rValue) { m_Position = rValue; } @@ -106,20 +153,30 @@ public: css::util::DateTime GetDateTime() const { return m_DateTime; } void SetDateTime(const css::util::DateTime& rValue) { m_DateTime = rValue; } - virtual OUString GetText() = 0; - virtual void SetText(OUString const& rText) = 0; + virtual css::uno::Reference<css::text::XText> SAL_CALL getTextRange() override; + + // override WeakComponentImplHelperBase::disposing() + // This function is called upon disposing the component, + // if your component needs special work when it becomes + // disposed, do it here. + virtual void disposing(std::unique_lock<std::mutex>& rGuard) override; + + OUString GetText(); + void SetText(OUString const& rText); + rtl::Reference<sdr::annotation::TextApiObject> getTextApiObject() { return m_TextRange; } SdrModel* GetModel() const; SdrPage const* getPage() const { return mpPage; } SdrPage* getPage() { return mpPage; } + // Unique ID of the annotation sal_uInt32 GetId() const { return m_nId; } - void setIsFreeText(bool value) { m_bIsFreeText = value; } - - bool isFreeText() const { return m_bIsFreeText; } + CreationInfo const& getCreationInfo() { return maCreationInfo; } + void setCreationInfo(CreationInfo const& rCreationInfo) { maCreationInfo = rCreationInfo; } }; +/** Vector of annotations */ typedef std::vector<rtl::Reference<Annotation>> AnnotationVector; } // namespace sdr::annotation diff --git a/include/svx/annotation/AnnotationObject.hxx b/include/svx/annotation/AnnotationObject.hxx new file mode 100644 index 000000000000..e372fec1f56a --- /dev/null +++ b/include/svx/annotation/AnnotationObject.hxx @@ -0,0 +1,59 @@ +/* -*- 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/. + */ + +#pragma once + +#include <svx/svxdllapi.h> + +#include <svx/annotation/Annotation.hxx> +#include <svx/svdorect.hxx> + +namespace sdr::annotation +{ +/** Annotation data that contains the annotation unique ID and author's ID */ +struct SVXCORE_DLLPUBLIC AnnotationViewData +{ + sal_Int32 nIndex = -1; + sal_uInt16 nAuthorIndex = 0; +}; + +/** Annotation (sdr) object, which represents an annotation inside the document */ +class SVXCORE_DLLPUBLIC AnnotationObject final : public SdrRectObj +{ +private: + virtual ~AnnotationObject() override; + + sdr::annotation::AnnotationViewData maViewData; + +public: + AnnotationObject(SdrModel& rSdrModel); + AnnotationObject(SdrModel& rSdrModel, AnnotationObject const& rSource); + AnnotationObject(SdrModel& rSdrModel, tools::Rectangle const& rRectangle, + sdr::annotation::AnnotationViewData const& aAnnotationViewData); + + rtl::Reference<SdrObject> CloneSdrObject(SdrModel& rTargetModel) const override; + + SdrObjKind GetObjIdentifier() const override; + OUString TakeObjNameSingul() const override; + OUString TakeObjNamePlural() const override; + + void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; + + void ApplyAnnotationName(); + + bool HasTextEdit() const override; + + bool hasSpecialDrag() const override { return true; } + + bool beginSpecialDrag(SdrDragStat& /*rDrag*/) const override { return false; } +}; + +} // end sdr::annotation + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/annotation/IAnnotationPopup.hxx b/include/svx/annotation/IAnnotationPopup.hxx new file mode 100644 index 000000000000..8a705ef1e935 --- /dev/null +++ b/include/svx/annotation/IAnnotationPopup.hxx @@ -0,0 +1,37 @@ +/* -*- 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/. + */ + +#pragma once + +#include <svx/svxdllapi.h> + +#include <svx/annotation/Annotation.hxx> + +namespace sdr::annotation +{ +class SVXCORE_DLLPUBLIC IAnnotationPopup +{ +protected: + rtl::Reference<sdr::annotation::Annotation> mxAnnotation; + +public: + IAnnotationPopup(rtl::Reference<sdr::annotation::Annotation> const& pAnnotation) + : mxAnnotation(pAnnotation) + { + } + + virtual ~IAnnotationPopup() {} + + virtual void openPopup() = 0; + virtual void closePopup() = 0; +}; + +} // end sdr::annotation + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/annotation/ObjectAnnotationData.hxx b/include/svx/annotation/ObjectAnnotationData.hxx new file mode 100644 index 000000000000..4530df2fb61c --- /dev/null +++ b/include/svx/annotation/ObjectAnnotationData.hxx @@ -0,0 +1,40 @@ +/* -*- 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/. + */ + +#pragma once + +#include <svx/svxdllapi.h> +#include <svx/annotation/Annotation.hxx> +#include <svx/annotation/IAnnotationPopup.hxx> + +namespace sdr::annotation +{ +/** Contains the annotation data specific for a SdrObject (which represents an annotation) */ +class ObjectAnnotationData +{ +public: + /// Does the (sdr) object represent an annotation + bool mbIsAnnotation : 1 = false; + + /// The annotation + rtl::Reference<sdr::annotation::Annotation> mxAnnotation; + + /// Object handling the pop-up window + std::unique_ptr<sdr::annotation::IAnnotationPopup> mpAnnotationPopup; + + /// Open popup for the annotation + void openPopup() + { + if (mbIsAnnotation && mpAnnotationPopup) + mpAnnotationPopup->openPopup(); + } +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/annotation/TextAPI.hxx b/include/svx/annotation/TextAPI.hxx new file mode 100644 index 000000000000..c227b4a803c5 --- /dev/null +++ b/include/svx/annotation/TextAPI.hxx @@ -0,0 +1,56 @@ +/* -*- 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 . + */ + +#pragma once + +#include <editeng/unotext.hxx> +#include <rtl/ref.hxx> +#include <editeng/outliner.hxx> +#include <svx/svxdllapi.h> + +class SdrModel; + +namespace sdr::annotation +{ +class TextAPIEditSource; + +class SVXCORE_DLLPUBLIC TextApiObject final : public SvxUnoText +{ +public: + static rtl::Reference<TextApiObject> create(SdrModel* pModel); + + virtual ~TextApiObject() noexcept override; + + /// @throws css::uno::RuntimeException + void dispose(); + + std::optional<OutlinerParaObject> CreateText(); + void SetText(OutlinerParaObject const& rText); + OUString GetText() const; + + static TextApiObject* getImplementation(const css::uno::Reference<css::text::XText>&); + +private: + std::unique_ptr<TextAPIEditSource> mpSource; + TextApiObject(std::unique_ptr<TextAPIEditSource> pEditSource); +}; + +} // namespace sdr::annotation + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/diagram/IDiagramHelper.hxx b/include/svx/diagram/IDiagramHelper.hxx index e93056f70049..67142c26e2a7 100644 --- a/include/svx/diagram/IDiagramHelper.hxx +++ b/include/svx/diagram/IDiagramHelper.hxx @@ -80,11 +80,15 @@ private: // a newly created oox::drawingml::Theme object bool mbForceThemePtrRecreation; // false + // if true, content was self-created using addTo/addShape + // and the layouting stuff + bool mbSelfCreated; + protected: void anchorToSdrObjGroup(SdrObjGroup& rTarget); public: - IDiagramHelper(); + IDiagramHelper(bool bSelfCreated); virtual ~IDiagramHelper(); // re-create XShapes @@ -111,6 +115,10 @@ public: bool UseDiagramModelData() const { return mbUseDiagramModelData; } bool ForceThemePtrRecreation() const { return mbForceThemePtrRecreation; }; + // get/set SelfCreated flag + bool isSelfCreated() const { return mbSelfCreated; } + void setSelfCreated() { mbSelfCreated = true; } + static void AddAdditionalVisualization(const SdrObjGroup& rTarget, SdrHdlList& rHdlList); }; diff --git a/include/svx/fmview.hxx b/include/svx/fmview.hxx index a1a08de5e56b..e601047eff00 100644 --- a/include/svx/fmview.hxx +++ b/include/svx/fmview.hxx @@ -53,8 +53,8 @@ namespace com::sun::star::form { class SVXCORE_DLLPUBLIC FmFormView : public E3dView { - rtl::Reference<FmXFormView> pImpl; - FmFormShell* pFormShell; + rtl::Reference<FmXFormView> m_pImpl; + FmFormShell* m_pFormShell; void Init(); @@ -128,11 +128,11 @@ public: SVX_DLLPRIVATE void ChangeDesignMode(bool bDesign); - SVX_DLLPRIVATE FmXFormView* GetImpl() const { return pImpl.get(); } - SVX_DLLPRIVATE FmFormShell* GetFormShell() const { return pFormShell; } + SVX_DLLPRIVATE FmXFormView* GetImpl() const { return m_pImpl.get(); } + SVX_DLLPRIVATE FmFormShell* GetFormShell() const { return m_pFormShell; } struct FormShellAccess { friend class FmFormShell; private: FormShellAccess() { } }; - void SetFormShell( FmFormShell* pShell, FormShellAccess ) { pFormShell = pShell; } + void SetFormShell( FmFormShell* pShell, FormShellAccess ) { m_pFormShell = pShell; } struct ImplAccess { friend class FmXFormView; private: ImplAccess() { } }; void SetMoveOutside( bool _bMoveOutside, ImplAccess ) { E3dView::SetMoveOutside( _bMoveOutside ); } diff --git a/include/svx/gridctrl.hxx b/include/svx/gridctrl.hxx index 27d7f25c7cf2..09c2a609a483 100644 --- a/include/svx/gridctrl.hxx +++ b/include/svx/gridctrl.hxx @@ -161,6 +161,7 @@ enum class DbGridControlNavigationBarState class FmXGridSourcePropListener; class DisposeListenerGridBridge; +class DbGridControl; // NavigationBar class NavigationBar final : public InterimItemWindow @@ -195,21 +196,26 @@ class NavigationBar final : public InterimItemWindow std::shared_ptr<weld::ButtonPressRepeater> m_xPrevRepeater; std::shared_ptr<weld::ButtonPressRepeater> m_xNextRepeater; + Size m_aLastAllocSize; + sal_Int32 m_nCurrentPos; bool m_bPositioning; // protect PositionDataSource against recursion public: - NavigationBar(vcl::Window* pParent); + NavigationBar(DbGridControl* pParent); virtual ~NavigationBar() override; virtual void dispose() override; + DECL_LINK(SizeAllocHdl, const Size&, void); + // Status methods for Controls void InvalidateAll(sal_Int32 nCurrentPos, bool bAll = false); void InvalidateState(DbGridControlNavigationBarState nWhich) {SetState(nWhich);} void SetState(DbGridControlNavigationBarState nWhich); bool GetState(DbGridControlNavigationBarState nWhich) const; - sal_uInt16 ArrangeControls(); + void SetPointFontAndZoom(const vcl::Font& rFont, const Fraction& rZoom); + sal_uInt16 GetPreferredWidth() const; private: @@ -278,6 +284,8 @@ private: osl::Mutex m_aDestructionSafety; osl::Mutex m_aAdjustSafety; + Idle m_aRearrangeIdle; + css::util::Date m_aNullDate; // NullDate of the Numberformatter; @@ -552,6 +560,8 @@ public: css::accessibility::XAccessible > CreateAccessibleCell( sal_Int32 nRow, sal_uInt16 nColumnId ) override; + void RearrangeAtIdle(); + protected: void RecalcRows(sal_Int32 nNewTopRow, sal_uInt16 nLinesOnScreen, bool bUpdateCursor); bool SeekCursor(sal_Int32 nRow, bool bAbsolute = false); @@ -588,6 +598,7 @@ protected: protected: void ImplInitWindow( const InitWindowFacet _eInitWhat ); DECL_DLLPRIVATE_LINK(OnDelete, void*, void); + DECL_DLLPRIVATE_LINK(RearrangeHdl, Timer*, void); DECL_DLLPRIVATE_LINK(OnAsyncAdjust, void*, void); // if the param is != NULL, AdjustRows will be called, else AdjustDataSource diff --git a/include/svx/hdft.hxx b/include/svx/hdft.hxx index 8eadfa366e66..6890e23fc78b 100644 --- a/include/svx/hdft.hxx +++ b/include/svx/hdft.hxx @@ -113,8 +113,8 @@ class SVX_DLLPUBLIC DeleteHeaderDialog final : public weld::MessageDialogControl { public: DeleteHeaderDialog(weld::Widget* pParent) - : MessageDialogController(pParent, "svx/ui/deleteheaderdialog.ui", - "DeleteHeaderDialog") + : MessageDialogController(pParent, u"svx/ui/deleteheaderdialog.ui"_ustr, + u"DeleteHeaderDialog"_ustr) { } }; @@ -123,8 +123,8 @@ class SVX_DLLPUBLIC DeleteFooterDialog final : public weld::MessageDialogControl { public: DeleteFooterDialog(weld::Widget* pParent) - : MessageDialogController(pParent, "svx/ui/deletefooterdialog.ui", - "DeleteFooterDialog") + : MessageDialogController(pParent, u"svx/ui/deletefooterdialog.ui"_ustr, + u"DeleteFooterDialog"_ustr) { } }; diff --git a/include/svx/nbdtmg.hxx b/include/svx/nbdtmg.hxx index 894304e4c37d..8979b736e40c 100644 --- a/include/svx/nbdtmg.hxx +++ b/include/svx/nbdtmg.hxx @@ -145,7 +145,7 @@ class SVX_DLLPUBLIC NBOTypeMgrBase }; -class BulletsTypeMgr final : public NBOTypeMgrBase +class SVX_DLLPUBLIC BulletsTypeMgr final : public NBOTypeMgrBase { friend class OutlineTypeMgr; friend class NumberingTypeMgr; @@ -161,6 +161,7 @@ class BulletsTypeMgr final : public NBOTypeMgrBase virtual sal_uInt16 GetNBOIndexForNumRule(SvxNumRule& aNum,sal_uInt16 mLevel,sal_uInt16 nFromIndex=0) override; virtual void ReplaceNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel) override; virtual void ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt16 mLevel, bool isDefault=false,bool isResetSize=false) override; + void ApplyCustomRule(SvxNumRule& aNum, std::u16string_view sBullet, std::u16string_view sFont, sal_uInt16 mLevel,bool isResetSize=false); virtual OUString GetDescription(sal_uInt16 nIndex, bool isDefault) override; virtual bool IsCustomized(sal_uInt16 nIndex) override; static BulletsTypeMgr& GetInstance(); diff --git a/include/svx/numvset.hxx b/include/svx/numvset.hxx index 059d6b7bc558..d3b6e71a69e1 100644 --- a/include/svx/numvset.hxx +++ b/include/svx/numvset.hxx @@ -40,6 +40,7 @@ namespace com::sun::star { enum class NumberingPageType { + DOCBULLET, BULLET, SINGLENUM, OUTLINE, @@ -55,6 +56,9 @@ class SVX_DLLPUBLIC SvxNumValueSet : public ValueSet css::uno::Reference<css::text::XNumberingFormatter> xFormatter; css::lang::Locale aLocale; + // Pair of bullet chars (first), and their respective font (second) + std::vector<std::pair<OUString, OUString>> maCustomBullets; + css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue> > aNumSettings; @@ -82,6 +86,9 @@ public: css::uno::Reference<css::text::XNumberingFormatter> const & xFormatter, const css::lang::Locale& rLocale); + std::vector<std::pair<OUString, OUString>> GetCustomBullets() { return maCustomBullets; } + void SetCustomBullets(std::vector<std::pair<OUString, OUString>> aCustomBullets); + virtual FactoryFunction GetUITestFactory() const override; }; diff --git a/include/svx/sidebar/AreaPropertyPanelBase.hxx b/include/svx/sidebar/AreaPropertyPanelBase.hxx index 92e2d2c39289..eca8220a0812 100644 --- a/include/svx/sidebar/AreaPropertyPanelBase.hxx +++ b/include/svx/sidebar/AreaPropertyPanelBase.hxx @@ -102,7 +102,6 @@ public: private: void Initialize(); - virtual void HandleContextChange(const vcl::EnumContext& rContext) override; protected: const css::uno::Reference<css::frame::XFrame>& mxFrame; @@ -177,6 +176,8 @@ protected: // MCGR: Preserve ColorStops until we have a UI to edit these basegfx::BColorStops createColorStops(); + + virtual void HandleContextChange(const vcl::EnumContext& rContext) override; }; } // end of namespace svx::sidebar diff --git a/include/svx/strings.hrc b/include/svx/strings.hrc index 13f896f04eeb..2b46e77b6b66 100644 --- a/include/svx/strings.hrc +++ b/include/svx/strings.hrc @@ -1464,14 +1464,13 @@ #define RID_SVXSTR_SAVE_MODIFIED_IMAGE NC_("RID_SVXSTR_SAVE_MODIFIED_IMAGE", "The image has been modified. By default the original image will be saved.\nDo you want to save the modified version instead?") #define RID_SUBSETSTR_BASIC_LATIN NC_("RID_SUBSETMAP", "Basic Latin") -#define RID_SUBSETSTR_LATIN_1_SUPPLEMENT NC_("RID_SUBSETMAP", "C1 Controls and Latin-1 Supplement") +#define RID_SUBSETSTR_LATIN_1_SUPPLEMENT NC_("RID_SUBSETMAP", "Latin-1 Supplement") #define RID_SUBSETSTR_LATIN_EXTENDED_A NC_("RID_SUBSETMAP", "Latin Extended-A") #define RID_SUBSETSTR_LATIN_EXTENDED_B NC_("RID_SUBSETMAP", "Latin Extended-B") #define RID_SUBSETSTR_IPA_EXTENSIONS NC_("RID_SUBSETMAP", "IPA Extensions") #define RID_SUBSETSTR_SPACING_MODIFIERS NC_("RID_SUBSETMAP", "Spacing Modifier Letters") #define RID_SUBSETSTR_COMB_DIACRITICAL NC_("RID_SUBSETMAP", "Combining Diacritical Marks") -#define RID_SUBSETSTR_BASIC_GREEK NC_("RID_SUBSETMAP", "Basic Greek") -#define RID_SUBSETSTR_GREEK_SYMS_COPTIC NC_("RID_SUBSETMAP", "Greek Symbols And Coptic") +#define RID_SUBSETSTR_GREEK NC_("RID_SUBSETMAP", "Greek and Coptic") #define RID_SUBSETSTR_CYRILLIC NC_("RID_SUBSETMAP", "Cyrillic") #define RID_SUBSETSTR_ARMENIAN NC_("RID_SUBSETMAP", "Armenian") #define RID_SUBSETSTR_BASIC_HEBREW NC_("RID_SUBSETMAP", "Basic Hebrew") @@ -1571,7 +1570,7 @@ #define RID_SUBSETSTR_THAANA NC_("RID_SUBSETMAP", "Thaana") #define RID_SUBSETSTR_ETHIOPIC NC_("RID_SUBSETMAP", "Ethiopic") #define RID_SUBSETSTR_CHEROKEE NC_("RID_SUBSETMAP", "Cherokee") -#define RID_SUBSETSTR_CANADIAN_ABORIGINAL NC_("RID_SUBSETMAP", "Canadian Aboriginal Syllables") +#define RID_SUBSETSTR_CANADIAN_ABORIGINAL NC_("RID_SUBSETMAP", "Unified Canadian Aboriginal Syllables") #define RID_SUBSETSTR_MONGOLIAN NC_("RID_SUBSETMAP", "Mongolian") #define RID_SUBSETSTR_MISC_MATH_SYMS_A NC_("RID_SUBSETMAP", "Miscellaneous Mathematical Symbols-A") #define RID_SUBSETSTR_SUPPL_ARROWS_A NC_("RID_SUBSETMAP", "Supplemental Arrows-A") @@ -1638,7 +1637,7 @@ #define RID_SUBSETSTR_MAHJONG_TILES NC_("RID_SUBSETMAP", "Mahjong Tiles") #define RID_SUBSETSTR_DOMINO_TILES NC_("RID_SUBSETMAP", "Domino Tiles") #define RID_SUBSETSTR_SAMARITAN NC_("RID_SUBSETMAP", "Samaritan") -#define RID_SUBSETSTR_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED NC_("RID_SUBSETMAP", "Canadian Aboriginal Syllabics Extended") +#define RID_SUBSETSTR_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED NC_("RID_SUBSETMAP", "Unified Canadian Aboriginal Syllabics Extended") #define RID_SUBSETSTR_TAI_THAM NC_("RID_SUBSETMAP", "Tai Tham") #define RID_SUBSETSTR_VEDIC_EXTENSIONS NC_("RID_SUBSETMAP", "Vedic Extensions") #define RID_SUBSETSTR_LISU NC_("RID_SUBSETMAP", "Lisu") @@ -1780,7 +1779,7 @@ #define RID_SUBSETSTR_OLD_UYGHUR NC_("RID_SUBSETMAP", "Old Uyghur") #define RID_SUBSETSTR_TANGSA NC_("RID_SUBSETMAP", "Tangsa") #define RID_SUBSETSTR_TOTO NC_("RID_SUBSETMAP", "Toto") -#define RID_SUBSETSTR_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED_A NC_("RID_SUBSETMAP", "Canadian Aboriginal Syllabics Extended-A") +#define RID_SUBSETSTR_UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS_EXTENDED_A NC_("RID_SUBSETMAP", "Unified Canadian Aboriginal Syllabics Extended-A") #define RID_SUBSETSTR_VITHKUQI NC_("RID_SUBSETMAP", "Vithkuqi") #define RID_SUBSETSTR_ZNAMENNY_MUSICAL_NOTATION NC_("RID_SUBSETMAP", "Znamenny Musical Notation") #define RID_SUBSETSTR_ARABIC_EXTENDED_C NC_("RID_SUBSETMAP", "Arabic Extended-C") @@ -1790,6 +1789,7 @@ #define RID_SUBSETSTR_KAKTOVIK_NUMERALS NC_("RID_SUBSETMAP", "Kaktovik Numerals") #define RID_SUBSETSTR_KAWI NC_("RID_SUBSETMAP", "Kawi") #define RID_SUBSETSTR_NAG_MUNDARI NC_("RID_SUBSETMAP", "Nag Mundari") +#define RID_SUBSETSTR_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_I NC_("RID_SUBSETMAP", "CJK Unified Ideographs Extension I") #define RID_SVXSTR_FRAMEDIR_LTR NC_("RID_SVXSTR_FRAMEDIR_LTR", "Left-to-right (LTR)") #define RID_SVXSTR_FRAMEDIR_RTL NC_("RID_SVXSTR_FRAMEDIR_RTL", "Right-to-left (RTL)") diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx index edcc0678b676..e9e97c4ca5ac 100644 --- a/include/svx/svdmrkv.hxx +++ b/include/svx/svdmrkv.hxx @@ -85,6 +85,7 @@ enum class ImpGetDescriptionOptions }; class ImplMarkingOverlay; +class MarkingSelectionOverlay; class MarkingSubSelectionOverlay; class SVXCORE_DLLPUBLIC SdrMarkView : public SdrSnapView @@ -96,6 +97,7 @@ class SVXCORE_DLLPUBLIC SdrMarkView : public SdrSnapView std::unique_ptr<ImplMarkingOverlay> mpMarkPointsOverlay; std::unique_ptr<ImplMarkingOverlay> mpMarkGluePointsOverlay; + std::unique_ptr<MarkingSelectionOverlay> mpMarkingSelectionOverlay; std::unique_ptr<MarkingSubSelectionOverlay> mpMarkingSubSelectionOverlay; protected: @@ -258,17 +260,6 @@ protected: public: // all available const methods for read access to selection const SdrMarkList& GetMarkedObjectList() const { return maSdrViewSelection.GetMarkedObjectList(); } - // returns SAL_MAX_SIZE if not found - size_t TryToFindMarkedObject(const SdrObject* pObj) const { return GetMarkedObjectList().FindObject(pObj); } - SdrPageView* GetSdrPageViewOfMarkedByIndex(size_t nNum) const { return GetMarkedObjectList().GetMark(nNum)->GetPageView(); } - SdrMark* GetSdrMarkByIndex(size_t nNum) const { return GetMarkedObjectList().GetMark(nNum); } - SdrObject* GetMarkedObjectByIndex(size_t nNum) const { return GetMarkedObjectList().GetMark(nNum)->GetMarkedSdrObj(); } - size_t GetMarkedObjectCount() const { return GetMarkedObjectList().GetMarkCount(); } - void SortMarkedObjects() const { GetMarkedObjectList().ForceSort(); } - bool AreObjectsMarked() const { return 0 != GetMarkedObjectList().GetMarkCount(); } - OUString const & GetDescriptionOfMarkedObjects() const { return GetMarkedObjectList().GetMarkDescription(); } - OUString const & GetDescriptionOfMarkedPoints() const { return GetMarkedObjectList().GetPointMarkDescription(); } - OUString const & GetDescriptionOfMarkedGluePoints() const { return GetMarkedObjectList().GetGluePointMarkDescription(); } // Get a list of all those links which are connected to marked nodes, // but which are not marked themselves. @@ -449,7 +440,7 @@ public: const Point& GetRef2() const { return maRef2; } SAL_DLLPRIVATE void SetRef2(const Point& rPt); /// Get access to the view shell owning this draw view, if any. - virtual SfxViewShell* GetSfxViewShell() const; + SAL_RET_MAYBENULL virtual SfxViewShell* GetSfxViewShell() const; }; diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 2951d41e8904..1dd8dd52eb59 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -87,7 +87,7 @@ namespace basegfx namespace sdr { class ObjectUser; } namespace sdr::properties { class BaseProperties; } namespace sdr::contact { class ViewContact; } - +namespace sdr::annotation { class ObjectAnnotationData; } namespace com::sun::star::drawing { class XShape; } namespace svx::diagram { class IDiagramHelper; } @@ -359,6 +359,11 @@ public: virtual void SetDecorative(bool isDecorative); virtual bool IsDecorative() const; + // Object representing an annotation + bool isAnnotationObject() const; + void setAsAnnotationObject(bool bSetAnnotation); + std::unique_ptr<sdr::annotation::ObjectAnnotationData>& getAnnotationData(); + // for group objects bool IsGroupObject() const; virtual SdrObjList* GetSubList() const; @@ -732,10 +737,10 @@ public: bool IsMoveProtect() const { return m_bMovProt;} void SetResizeProtect(bool bProt); bool IsResizeProtect() const { return m_bSizProt;} - void SetPrintable(bool bPrn); - bool IsPrintable() const { return !m_bNoPrint;} - void SetVisible(bool bVisible); - bool IsVisible() const { return mbVisible;} + virtual void SetPrintable(bool isPrintable); + virtual bool IsPrintable() const; + virtual void SetVisible(bool isVisible); + virtual bool IsVisible() const; void SetMarkProtect(bool bProt); bool IsMarkProtect() const { return m_bMarkProt;} virtual bool IsSdrTextObj() const { return false; } @@ -895,6 +900,8 @@ protected: // #i25616# bool mbSupportTextIndentingOnLineWidthChange : 1; + std::unique_ptr<sdr::annotation::ObjectAnnotationData> mpAnnotationData; + virtual ~SdrObject() override; virtual std::unique_ptr<sdr::properties::BaseProperties> CreateObjectSpecificProperties() = 0; diff --git a/include/svx/svdobjkind.hxx b/include/svx/svdobjkind.hxx index d25eba0a0027..1517bbeba4aa 100644 --- a/include/svx/svdobjkind.hxx +++ b/include/svx/svdobjkind.hxx @@ -53,6 +53,7 @@ enum class SdrObjKind : sal_uInt16 CustomShape = 33, /// custom shape Media = 34, /// media shape Table = 35, /// table + Annotation = 36, /// annotation object OLE2Applet = 100, OLE2Plugin = 101, diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx index ec2c94ab3f45..88296f4a2629 100644 --- a/include/svx/svdograf.hxx +++ b/include/svx/svdograf.hxx @@ -79,14 +79,14 @@ private: SAL_DLLPRIVATE virtual std::unique_ptr<sdr::properties::BaseProperties> CreateObjectSpecificProperties() override; SAL_DLLPRIVATE void ImpSetAttrToGrafInfo(); // Copy values from the pool - GraphicAttr aGrafInfo; + GraphicAttr m_aGrafInfo; - OUString aFileName; // If it's a Link, the filename can be found in here - OUString aFilterName; + OUString m_aFileName; // If it's a Link, the filename can be found in here + OUString m_aFilterName; std::unique_ptr<GraphicObject> mpGraphicObject; // In order to speed up output of bitmaps, especially rotated ones std::unique_ptr<GraphicObject> mpReplacementGraphicObject; - SdrGraphicLink* pGraphicLink; // And here a pointer for linked graphics - bool bMirrored:1; // True: the graphic is horizontal, which means it's mirrored along the y-axis + SdrGraphicLink* m_pGraphicLink; // And here a pointer for linked graphics + bool m_bMirrored:1; // True: the graphic is horizontal, which means it's mirrored along the y-axis // Flag for allowing text animation. Default is true. bool mbGrafAnimationAllowed:1; @@ -157,7 +157,7 @@ public: void ReleaseGraphicLink(); bool IsLinkedGraphic() const; - const OUString& GetFileName() const { return aFileName;} + const OUString& GetFileName() const { return m_aFileName;} void StartAnimation(); @@ -192,7 +192,7 @@ public: SAL_DLLPRIVATE virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; - bool IsMirrored() const { return bMirrored;} + bool IsMirrored() const { return m_bMirrored;} SAL_DLLPRIVATE void SetMirrored( bool _bMirrored ); virtual bool shouldKeepAspectRatio() const override { return true; } diff --git a/include/svx/svdovirt.hxx b/include/svx/svdovirt.hxx index 17c869313067..ca5f6858ecaa 100644 --- a/include/svx/svdovirt.hxx +++ b/include/svx/svdovirt.hxx @@ -61,6 +61,10 @@ public: const SdrObject& GetReferencedObj() const; virtual void NbcSetAnchorPos(const Point& rAnchorPos) override; + virtual void SetPrintable(bool isPrintable) override; + virtual bool IsPrintable() const override; + virtual void SetVisible(bool isVisible) override; + virtual bool IsVisible() const override; virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; virtual SdrInventor GetObjInventor() const override; virtual SdrObjKind GetObjIdentifier() const override; diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx index c8c7eecddd5c..d6e68943e0ac 100644 --- a/include/svx/svdpage.hxx +++ b/include/svx/svdpage.hxx @@ -555,11 +555,14 @@ public: void dumpAsXml(xmlTextWriterPtr pWriter) const override; - virtual void createAnnotation(rtl::Reference<sdr::annotation::Annotation>& /*xAnnotation*/) { assert(false); } - virtual void addAnnotation(rtl::Reference<sdr::annotation::Annotation> const& /*xAnnotation*/, int /*nIndex*/) { assert(false); } - virtual void removeAnnotation(rtl::Reference<sdr::annotation::Annotation> const& /*xAnnotation*/) { assert(false); } - - std::vector<rtl::Reference<sdr::annotation::Annotation>> const& getAnnotations() const { return maAnnotations; } + // Annotations + virtual rtl::Reference<sdr::annotation::Annotation> createAnnotation(); + virtual void addAnnotation(rtl::Reference<sdr::annotation::Annotation> const& xAnnotation, int nIndex = -1); + virtual void addAnnotationNoNotify(rtl::Reference<sdr::annotation::Annotation> const& xAnnotation, int nIndex = -1); + virtual void removeAnnotation(rtl::Reference<sdr::annotation::Annotation> const& xAnnotation); + virtual void removeAnnotationNoNotify(rtl::Reference<sdr::annotation::Annotation> const& xAnnotation); + + std::vector<rtl::Reference<sdr::annotation::Annotation>> const& getAnnotations() const; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdundo.hxx b/include/svx/svdundo.hxx index 80c7ae4560b3..bc15932fd81c 100644 --- a/include/svx/svdundo.hxx +++ b/include/svx/svdundo.hxx @@ -60,7 +60,7 @@ namespace svx { namespace diagram { class SVXCORE_DLLPUBLIC SdrUndoAction : public SfxUndoAction { protected: - SdrModel& rMod; + SdrModel& m_rMod; ViewShellId m_nViewShellId; protected: @@ -155,17 +155,17 @@ class SVXCORE_DLLPUBLIC SdrUndoAttrObj : public SdrUndoObj // FIXME: Or should we better remember the StyleSheetNames? rtl::Reference< SfxStyleSheet > mxUndoStyleSheet; rtl::Reference< SfxStyleSheet > mxRedoStyleSheet; - bool bStyleSheet; - bool bHaveToTakeRedoSet; + bool m_bStyleSheet; + bool m_bHaveToTakeRedoSet; // When assigning TextItems to a drawing object with text: - std::optional<OutlinerParaObject> pTextUndo; + std::optional<OutlinerParaObject> m_pTextUndo; // #i8508# // The text rescue mechanism needs also to be implemented for redo actions. - std::optional<OutlinerParaObject> pTextRedo; + std::optional<OutlinerParaObject> m_pTextRedo; // If we have a group object: - std::unique_ptr<SdrUndoGroup> pUndoGroup; + std::unique_ptr<SdrUndoGroup> m_pUndoGroup; protected: // Helper to ensure StyleSheet is in pool (provided by SdrModel from SdrObject) @@ -211,10 +211,10 @@ public: class SVXCORE_DLLPUBLIC SdrUndoGeoObj : public SdrUndoObj { - std::unique_ptr<SdrObjGeoData> pUndoGeo; - std::unique_ptr<SdrObjGeoData> pRedoGeo; + std::unique_ptr<SdrObjGeoData> m_pUndoGeo; + std::unique_ptr<SdrObjGeoData> m_pRedoGeo; // If we have a group object: - std::unique_ptr<SdrUndoGroup> pUndoGroup; + std::unique_ptr<SdrUndoGroup> m_pUndoGroup; /// If we have a table object, should its layout change? bool mbSkipChangeLayout; @@ -594,7 +594,7 @@ class SVXCORE_DLLPUBLIC SdrUndoDelPage final : public SdrUndoPageList { // When deleting a MasterPage, we remember all relations of the // Character Page with the MasterPage in this UndoGroup. - std::unique_ptr<SdrUndoGroup> pUndoGroup; + std::unique_ptr<SdrUndoGroup> m_pUndoGroup; std::unique_ptr<SfxPoolItem> mpFillBitmapItem; bool mbHasFillBitmap; diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx index f775c1099917..aa73fb57e5c2 100644 --- a/include/svx/svxdlg.hxx +++ b/include/svx/svxdlg.hxx @@ -377,7 +377,7 @@ public: virtual VclPtr<AbstractSvxNewDictionaryDialog> CreateSvxNewDictionaryDialog(weld::Window* pParent) = 0; virtual VclPtr<VclAbstractDialog> CreateSvxEditDictionaryDialog(weld::Window* pParent, const OUString& rName) = 0; virtual VclPtr<AbstractSvxNameDialog> CreateSvxNameDialog(weld::Window* pParent, - const OUString& rName, const OUString& rDesc, const OUString& rTitle = "" ) = 0; + const OUString& rName, const OUString& rDesc, const OUString& rTitle = u""_ustr ) = 0; // #i68101# virtual VclPtr<AbstractSvxObjectNameDialog> CreateSvxObjectNameDialog(weld::Window* pParent, const OUString& rName) = 0; diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index b4e1a91d386a..68d02d4a86fc 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -185,6 +185,7 @@ class XFillGradientItem; #define FN_BUL_NUM_RULE_INDEX TypedWhichId<SfxUInt16Item>(FN_EDIT + 120) // achieving num rule index #define FN_NUM_NUM_RULE_INDEX TypedWhichId<SfxUInt16Item>(FN_EDIT + 121) #define FN_OUTLINE_RULE_INDEX TypedWhichId<SfxUInt16Item>(FN_EDIT + 122) +#define FN_BUL_GET_DOC_BULLETS TypedWhichId<SfxStringListItem>(FN_EDIT + 123) #define FN_INSERT (SID_SW_START + 300) // 20300 #define FN_DELETE_BOOKMARK TypedWhichId<SfxStringItem>(FN_INSERT + 1) @@ -1058,8 +1059,12 @@ class XFillGradientItem; #define SID_CHAR_DLG_FOR_PARAGRAPH ( SID_SVX_START + 1210 ) #define SID_SET_DOCUMENT_LANGUAGE TypedWhichId<SfxBoolItem>( SID_SVX_START + 1211 ) +#define SID_ATTR_BULLET_CHAR TypedWhichId<SfxStringItem>(SID_SVX_START + 1212) +#define SID_ATTR_BULLET_FONT TypedWhichId<SfxStringItem>(SID_SVX_START + 1213) +#define SID_ATTR_BULLET_INDEX TypedWhichId<SfxUInt16Item>(SID_SVX_START + 1214) + // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id -#define SID_SVX_FIRSTFREE ( SID_SVX_START + 1211 + 1 ) +#define SID_SVX_FIRSTFREE ( SID_SVX_START + 1214 + 1 ) // Overflow check for slot IDs diff --git a/include/svx/xflboxy.hxx b/include/svx/xflboxy.hxx index 54d354b52268..acc8fb7fdea7 100644 --- a/include/svx/xflboxy.hxx +++ b/include/svx/xflboxy.hxx @@ -23,10 +23,10 @@ #include <svl/intitem.hxx> #include <svx/svxdllapi.h> -class SVXCORE_DLLPUBLIC XFillBmpPosOffsetXItem final : public SfxUInt16Item +class SVXCORE_DLLPUBLIC XFillBmpPosOffsetXItem final : public SfxInt32Item { public: - XFillBmpPosOffsetXItem( sal_uInt16 nOffPosX = 0 ); + XFillBmpPosOffsetXItem( sal_Int32 nOffPosX = 0 ); SVX_DLLPRIVATE virtual XFillBmpPosOffsetXItem* Clone( SfxItemPool* pPool = nullptr ) const override; @@ -36,10 +36,10 @@ public: OUString &rText, const IntlWrapper& ) const override; }; -class SVXCORE_DLLPUBLIC XFillBmpPosOffsetYItem final : public SfxUInt16Item +class SVXCORE_DLLPUBLIC XFillBmpPosOffsetYItem final : public SfxInt32Item { public: - XFillBmpPosOffsetYItem( sal_uInt16 nOffPosY = 0 ); + XFillBmpPosOffsetYItem( sal_Int32 nOffPosY = 0 ); SVX_DLLPRIVATE virtual XFillBmpPosOffsetYItem* Clone( SfxItemPool* pPool = nullptr ) const override; diff --git a/include/systools/curlinit.hxx b/include/systools/curlinit.hxx index 4b226c7a4218..7c6f8d07deaf 100644 --- a/include/systools/curlinit.hxx +++ b/include/systools/curlinit.hxx @@ -37,7 +37,7 @@ static void InitCurl_easy(CURL* const pCURL) rc = curl_easy_setopt(pCURL, CURLOPT_CAINFO, path); if (rc != CURLE_OK) // only if OOM? { - throw css::uno::RuntimeException("CURLOPT_CAINFO failed"); + throw css::uno::RuntimeException(u"CURLOPT_CAINFO failed"_ustr); } #endif diff --git a/include/systools/opensslinit.hxx b/include/systools/opensslinit.hxx index 48b38cf67512..be9cd43c58d5 100644 --- a/include/systools/opensslinit.hxx +++ b/include/systools/opensslinit.hxx @@ -36,7 +36,7 @@ static char const* GetCABundleFile() } } - throw css::uno::RuntimeException("no OpenSSL CA certificate bundle found"); + throw css::uno::RuntimeException(u"no OpenSSL CA certificate bundle found"_ustr); } #endif diff --git a/include/test/container/xnamecontainer.hxx b/include/test/container/xnamecontainer.hxx index 5cc4bab1250c..259064e9c382 100644 --- a/include/test/container/xnamecontainer.hxx +++ b/include/test/container/xnamecontainer.hxx @@ -26,7 +26,7 @@ class OOO_DLLPUBLIC_TEST XNameContainer public: // removes default entry XNameContainer() - : m_aName("XNameContainer") + : m_aName(u"XNameContainer"_ustr) { } // removes given entry diff --git a/include/test/sheet/xnamedranges.hxx b/include/test/sheet/xnamedranges.hxx index 90b8ab6c2fcb..a8188e3d4549 100644 --- a/include/test/sheet/xnamedranges.hxx +++ b/include/test/sheet/xnamedranges.hxx @@ -26,7 +26,7 @@ class OOO_DLLPUBLIC_TEST XNamedRanges public: // remove default entry XNamedRanges() - : maNameToRemove("initial1") + : maNameToRemove(u"initial1"_ustr) { } diff --git a/include/test/table/xcellrange.hxx b/include/test/table/xcellrange.hxx index 94db1130b21e..e91941eb2708 100644 --- a/include/test/table/xcellrange.hxx +++ b/include/test/table/xcellrange.hxx @@ -23,7 +23,7 @@ class OOO_DLLPUBLIC_TEST XCellRange { public: XCellRange() - : m_aRangeName("A1:A1") + : m_aRangeName(u"A1:A1"_ustr) { } XCellRange(OUString aRangeName) diff --git a/include/test/testinteractionhandler.hxx b/include/test/testinteractionhandler.hxx index 1cfdec663d33..01a3726cf42d 100644 --- a/include/test/testinteractionhandler.hxx +++ b/include/test/testinteractionhandler.hxx @@ -47,7 +47,7 @@ public: virtual OUString SAL_CALL getImplementationName() override { - return "com.sun.star.comp.uui.TestInteractionHandler"; + return u"com.sun.star.comp.uui.TestInteractionHandler"_ustr; } virtual sal_Bool SAL_CALL supportsService(OUString const & rServiceName) override @@ -57,11 +57,11 @@ public: virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override { - return { "com.sun.star.task.InteractionHandler", + return { u"com.sun.star.task.InteractionHandler"_ustr, // added to indicate support for configuration.backend.MergeRecoveryRequest - "com.sun.star.configuration.backend.InteractionHandler", + u"com.sun.star.configuration.backend.InteractionHandler"_ustr, // for backwards compatibility - "com.sun.star.uui.InteractionHandler" }; + u"com.sun.star.uui.InteractionHandler"_ustr }; } virtual void SAL_CALL initialize(css::uno::Sequence<css::uno::Any> const & /*rArguments*/) override diff --git a/include/test/unoapi_property_testers.hxx b/include/test/unoapi_property_testers.hxx index 4d83e8179ce4..70160280dd89 100644 --- a/include/test/unoapi_property_testers.hxx +++ b/include/test/unoapi_property_testers.hxx @@ -145,7 +145,7 @@ testStringProperty(css::uno::Reference<css::beans::XPropertySet> const& xPropert */ void OOO_DLLPUBLIC_TEST testStringOptionalProperty(css::uno::Reference<css::beans::XPropertySet> const& xPropertySet, - const OUString& name, const OUString& rValue = OUString("StringValue")); + const OUString& name, const OUString& rValue = u"StringValue"_ustr); /** @brief Tester for read-only property type 'string' of a @see com::sun::star::beans::XPropertySet. * diff --git a/include/test/util/xsearchable.hxx b/include/test/util/xsearchable.hxx index 0f78ceb18cb1..ffd4e44fede6 100644 --- a/include/test/util/xsearchable.hxx +++ b/include/test/util/xsearchable.hxx @@ -21,7 +21,7 @@ class OOO_DLLPUBLIC_TEST XSearchable { public: XSearchable(OUString aString, sal_Int32 nCount) : maSearchString(std::move(aString)), mnCount(nCount) {} - XSearchable() : maSearchString("SearchString"), mnCount(1) {} + XSearchable() : maSearchString(u"SearchString"_ustr), mnCount(1) {} virtual ~XSearchable(); void testFindFirst(); diff --git a/include/toolkit/controls/unocontrols.hxx b/include/toolkit/controls/unocontrols.hxx index 1fba20389a8b..7c5c424fe276 100644 --- a/include/toolkit/controls/unocontrols.hxx +++ b/include/toolkit/controls/unocontrols.hxx @@ -70,7 +70,7 @@ public: // appropriately ( e.g. NULL if non GraphicObject scheme ) or a valid // object if the rURL points to a valid object static css::uno::Reference< css::graphic::XGraphic > getGraphicAndGraphicObjectFromURL_nothrow( css::uno::Reference< css::graphic::XGraphicObject >& xOutGraphicObject, const OUString& _rURL ); - static css::uno::Reference< css::graphic::XGraphic > getGraphicFromURL_nothrow( const OUString& _rURL ); + static css::uno::Reference< css::graphic::XGraphic > getGraphicFromURL_nothrow( const OUString& _rURL, OUString const & referer ); }; diff --git a/include/tools/datetimeutils.hxx b/include/tools/datetimeutils.hxx index 3df6229cb574..deb7d7ee4f4c 100644 --- a/include/tools/datetimeutils.hxx +++ b/include/tools/datetimeutils.hxx @@ -14,12 +14,14 @@ // This function converts a 'DateTime' object to an 'OString' object TOOLS_DLLPUBLIC OString DateTimeToOString(const DateTime& rDateTime); +// This function converts a 'DateTime' object to an 'OUString' object +TOOLS_DLLPUBLIC OUString DateTimeToOUString(const DateTime& rDateTime); // This function converts a 'Date' object to an 'OString' object in ISO-8601 representation TOOLS_DLLPUBLIC OString DateToOString(const Date& rDate); -// This function converts a 'Date' object to an 'OString' object in DD/MM/YYYY format -TOOLS_DLLPUBLIC OString DateToDDMMYYYYOString(const Date& rDate); +// This function converts a 'Date' object to an 'OUString' object in DD/MM/YYYY format +TOOLS_DLLPUBLIC OUString DateToDDMMYYYYOUString(const Date& rDate); #endif diff --git a/include/tools/ref.hxx b/include/tools/ref.hxx index 5b8af3fa0c52..65e987ca9c2c 100644 --- a/include/tools/ref.hxx +++ b/include/tools/ref.hxx @@ -33,7 +33,7 @@ namespace tools { /** T must be a class that extends SvRefBase */ template<typename T> class SAL_DLLPUBLIC_RTTI SvRef final { public: - SvRef(): pObj(nullptr) {} + constexpr SvRef(): pObj(nullptr) {} SvRef(SvRef&& rObj) noexcept { diff --git a/include/unotools/VersionConfig.hxx b/include/unotools/VersionConfig.hxx index 3918dfd2e514..e109a96e4c3a 100644 --- a/include/unotools/VersionConfig.hxx +++ b/include/unotools/VersionConfig.hxx @@ -9,13 +9,8 @@ */ #pragma once -#include <officecfg/Setup.hxx> #include <unotools/configmgr.hxx> #include <o3tl/string_view.hxx> -#include <rtl/ustring.hxx> -#include <sal/log.hxx> - -#include <com/sun/star/lang/IllegalArgumentException.hpp> namespace utl { diff --git a/include/unotools/confignode.hxx b/include/unotools/confignode.hxx index 946825aa4821..b38e3306ef74 100644 --- a/include/unotools/confignode.hxx +++ b/include/unotools/confignode.hxx @@ -81,11 +81,6 @@ namespace utl */ OConfigurationNode openNode(const OUString& _rPath) const noexcept; - OConfigurationNode openNode( const char* _pAsciiPath ) const - { - return openNode( OUString::createFromAscii( _pAsciiPath ) ); - } - /** create a new child node If the object represents a set node, this method may be used to create a new child. For non-set-nodes, the @@ -112,11 +107,6 @@ namespace utl */ css::uno::Any getNodeValue(const OUString& _rPath) const noexcept; - css::uno::Any getNodeValue( const char* _pAsciiPath ) const - { - return getNodeValue( OUString::createFromAscii( _pAsciiPath ) ); - } - /** write a node value<p/> The value given is written into the node specified by the given relative path.<br/> In opposite to <method>getNodeValue</method>, _rName must refer to a leaf in the configuration tree, not an inner @@ -125,11 +115,6 @@ namespace utl */ bool setNodeValue(const OUString& _rPath, const css::uno::Any& _rValue) const noexcept; - bool setNodeValue( const char* _pAsciiPath, const css::uno::Any& _rValue ) const - { - return setNodeValue( OUString::createFromAscii( _pAsciiPath ), _rValue ); - } - /// return the names of the existing children css::uno::Sequence< OUString > getNodeNames() const noexcept; diff --git a/include/unotools/configvaluecontainer.hxx b/include/unotools/configvaluecontainer.hxx index a123dba58867..34a01f7c7c59 100644 --- a/include/unotools/configvaluecontainer.hxx +++ b/include/unotools/configvaluecontainer.hxx @@ -73,7 +73,7 @@ namespace utl As this class is intended to manipulate objects it does not hold itself (see the various registerXXX methods), it needs to guard these access for multi threading safety.<br/> The mutex given here is locked whenever such an access occurs. - @param _pConfigLocation + @param _rConfigLocation is an ASCII string describing the configurations node path @param _nAccessFlags specifies different aspects of the configuration aspect to be created, e.g. it's update mode etc.<br/> @@ -84,7 +84,7 @@ namespace utl OConfigurationValueContainer( const css::uno::Reference< css::uno::XComponentContext >& _rxORB, std::mutex& _rAccessSafety, - const char* _pConfigLocation, + const OUString& _rConfigLocation, const sal_Int32 _nLevels ); @@ -98,7 +98,7 @@ namespace utl <p>Usually, in your derived class you simply add a member of the correct type of the configuration value, and then call this method with the address of this member.</p> - @param _pRelativePathAscii + @param _rRelativePathAscii is a relative (ASCII) path of the node which should be "mirrored" into the accessor. @param _pContainer points to the accessors location in memory. Usually, this is simply an address of your derived class @@ -106,7 +106,7 @@ namespace utl is the type of your accessor. This type must be supported by the configuration. */ void registerExchangeLocation( - const char* _pRelativePathAscii, + const OUString& _rRelativePathAscii, void* _pContainer, const css::uno::Type& _rValueType ); diff --git a/include/unotools/fontdefs.hxx b/include/unotools/fontdefs.hxx index ef03e8887a4b..55b70808ceae 100644 --- a/include/unotools/fontdefs.hxx +++ b/include/unotools/fontdefs.hxx @@ -49,7 +49,7 @@ class UNLESS_MERGELIBS(UNOTOOLS_DLLPUBLIC) ConvertChar { public: const sal_Unicode* mpCvtTab; - const char* mpSubsFontName; + OUString maSubsFontName; sal_Unicode (*mpCvtFunc)( sal_Unicode ); sal_Unicode RecodeChar( sal_Unicode c ) const; void RecodeString( OUString& rStra, sal_Int32 nIndex, sal_Int32 nLen ) const; diff --git a/include/vbahelper/vbaaccesshelper.hxx b/include/vbahelper/vbaaccesshelper.hxx index 36f24d3a4f71..cf163e90ac45 100644 --- a/include/vbahelper/vbaaccesshelper.hxx +++ b/include/vbahelper/vbaaccesshelper.hxx @@ -41,7 +41,7 @@ namespace ooo::vba inline css::uno::Reference< css::lang::XMultiServiceFactory > getVBAServiceFactory( SfxObjectShell const * pShell ) { css::uno::Any aUnoVar; - if ( !pShell || ! pShell->GetBasicManager()->GetGlobalUNOConstant( "VBAGlobals", aUnoVar ) ) + if ( !pShell || ! pShell->GetBasicManager()->GetGlobalUNOConstant( u"VBAGlobals"_ustr, aUnoVar ) ) throw css::lang::IllegalArgumentException(); css::uno::Reference< css::lang::XMultiServiceFactory > xVBAFactory( aUnoVar, css::uno::UNO_QUERY_THROW ); return xVBAFactory; diff --git a/include/vbahelper/vbacollectionimpl.hxx b/include/vbahelper/vbacollectionimpl.hxx index 9afcf08a3aa5..d70f531e113f 100644 --- a/include/vbahelper/vbacollectionimpl.hxx +++ b/include/vbahelper/vbacollectionimpl.hxx @@ -245,7 +245,7 @@ protected: virtual css::uno::Any getItemByStringIndex( const OUString& sIndex ) { if ( !m_xNameAccess.is() ) - throw css::uno::RuntimeException("ScVbaCollectionBase string index access not supported by this object" ); + throw css::uno::RuntimeException(u"ScVbaCollectionBase string index access not supported by this object"_ustr ); if( mbIgnoreCase ) { @@ -266,11 +266,11 @@ protected: virtual css::uno::Any getItemByIntIndex( const sal_Int32 nIndex ) { if ( !m_xIndexAccess.is() ) - throw css::uno::RuntimeException("ScVbaCollectionBase numeric index access not supported by this object" ); + throw css::uno::RuntimeException(u"ScVbaCollectionBase numeric index access not supported by this object"_ustr ); if ( nIndex <= 0 ) { throw css::lang::IndexOutOfBoundsException( - "index is 0 or negative" ); + u"index is 0 or negative"_ustr ); } // need to adjust for vba index ( for which first element is 1 ) return createCollectionObject( m_xIndexAccess->getByIndex( nIndex - 1 ) ); @@ -307,7 +307,7 @@ public: sal_Int32 nIndex = 0; if ( !( Index1 >>= nIndex ) ) { - throw css::lang::IndexOutOfBoundsException( "Couldn't convert index to Int32" ); + throw css::lang::IndexOutOfBoundsException( u"Couldn't convert index to Int32"_ustr ); } return getItemByIntIndex( nIndex ); @@ -321,7 +321,7 @@ public: // XDefaultMethod OUString SAL_CALL getDefaultMethodName( ) override { - return "Item"; + return u"Item"_ustr; } // XEnumerationAccess virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override = 0; diff --git a/include/vbahelper/vbahelperinterface.hxx b/include/vbahelper/vbahelperinterface.hxx index c0aa106329c7..6d4b78979a2c 100644 --- a/include/vbahelper/vbahelperinterface.hxx +++ b/include/vbahelper/vbahelperinterface.hxx @@ -82,7 +82,7 @@ public: // The application could certainly be passed around in the context - seems // to make sense css::uno::Reference< css::container::XNameAccess > xNameAccess( mxContext, css::uno::UNO_QUERY_THROW ); - return xNameAccess->getByName( "Application" ); + return xNameAccess->getByName( u"Application"_ustr ); } // XServiceInfo Methods diff --git a/include/vbahelper/vbapropvalue.hxx b/include/vbahelper/vbapropvalue.hxx index ee6443f08a34..fe7cbf1bd12b 100644 --- a/include/vbahelper/vbapropvalue.hxx +++ b/include/vbahelper/vbapropvalue.hxx @@ -51,7 +51,7 @@ public: virtual css::uno::Any SAL_CALL getValue() override; virtual void SAL_CALL setValue( const css::uno::Any& _value ) override; - OUString SAL_CALL getDefaultPropertyName() override { return "Value"; } + OUString SAL_CALL getDefaultPropertyName() override { return u"Value"_ustr; } }; #endif //SC_VBA_PROPVALULE_HXX diff --git a/include/vbahelper/vbareturntypes.hxx b/include/vbahelper/vbareturntypes.hxx index 96bb168abc01..2d066d797cb4 100644 --- a/include/vbahelper/vbareturntypes.hxx +++ b/include/vbahelper/vbareturntypes.hxx @@ -37,7 +37,7 @@ namespace ooo::vba DefaultReturnHelper( const T1& nValue ) : mnValue( nValue ) {} virtual void SAL_CALL setValue( T1 nValue ) override { mnValue = nValue; } virtual T1 SAL_CALL getValue() override { return mnValue; } - OUString SAL_CALL getDefaultPropertyName( ) override { return "Value"; } + OUString SAL_CALL getDefaultPropertyName( ) override { return u"Value"_ustr; } }; typedef DefaultReturnHelper< sal_Int32, ov::msforms::XReturnInteger > ReturnInteger_BASE; diff --git a/include/vcl/EnumContext.hxx b/include/vcl/EnumContext.hxx index f852fea96068..790d938bd6e9 100644 --- a/include/vcl/EnumContext.hxx +++ b/include/vcl/EnumContext.hxx @@ -129,6 +129,8 @@ public: sal_Int32 GetCombinedContext_DI() const; Application GetApplication() const; + Context GetContext() const {return meContext;} + SAL_DLLPRIVATE Application GetApplication_DI() const; bool operator == (const EnumContext& rOther) const; diff --git a/include/vcl/IDialogRenderable.hxx b/include/vcl/IDialogRenderable.hxx index 386ed1e865c8..d92eb88ed25c 100644 --- a/include/vcl/IDialogRenderable.hxx +++ b/include/vcl/IDialogRenderable.hxx @@ -41,6 +41,9 @@ public: /// Emits a LOK_CALLBACK_INVALIDATE_TILES. virtual void notifyInvalidation(tools::Rectangle const *) const = 0; + + /// Debugging + virtual OString dumpNotifyState() const = 0; }; } // namespace vcl diff --git a/include/vcl/ctrl.hxx b/include/vcl/ctrl.hxx index 3f838aba1a70..4e61822abf7a 100644 --- a/include/vcl/ctrl.hxx +++ b/include/vcl/ctrl.hxx @@ -230,6 +230,8 @@ public: /// Notify the LOK client about an invalidated area. virtual void LogicInvalidate( const tools::Rectangle* pRectangle ) override; + + virtual void FlashWindow() const override {}; }; #endif // INCLUDED_VCL_CTRL_HXX diff --git a/include/vcl/filter/PDFiumLibrary.hxx b/include/vcl/filter/PDFiumLibrary.hxx index 3c087cf7b11c..d90da7286020 100644 --- a/include/vcl/filter/PDFiumLibrary.hxx +++ b/include/vcl/filter/PDFiumLibrary.hxx @@ -37,6 +37,7 @@ #include <vcl/pdf/PDFAnnotAActionType.hxx> class SvMemoryStream; +class BitmapEx; namespace vcl::pdf { @@ -80,6 +81,8 @@ public: virtual int getWidth() = 0; virtual int getHeight() = 0; virtual PDFBitmapType getFormat() = 0; + /// Convert the bitmap buffer to a BitmapEx + virtual BitmapEx createBitmapFromBuffer() = 0; }; class VCL_DLLPUBLIC PDFiumAnnotation diff --git a/include/vcl/glyphitemcache.hxx b/include/vcl/glyphitemcache.hxx index ffe9bb7eb0c4..79f05e606550 100644 --- a/include/vcl/glyphitemcache.hxx +++ b/include/vcl/glyphitemcache.hxx @@ -53,6 +53,11 @@ public: const OUString& text, sal_Int32 nIndex, sal_Int32 nLen, tools::Long nLogicWidth = 0, const vcl::text::TextLayoutCache* layoutCache = nullptr); + const SalLayoutGlyphs* GetLayoutGlyphs(const VclPtr<const OutputDevice>& outputDevice, + const OUString& text, sal_Int32 nIndex, sal_Int32 nLen, + sal_Int32 nDrawMinCharPos, sal_Int32 nDrawEndCharPos, + tools::Long nLogicWidth = 0, + const vcl::text::TextLayoutCache* layoutCache = nullptr); void clear(); /// Normally, we cannot cache glyphs when doing font fallback, because the font fallbacks diff --git a/include/vcl/help.hxx b/include/vcl/help.hxx index 7dc848a42e0c..b4bacc9a476f 100644 --- a/include/vcl/help.hxx +++ b/include/vcl/help.hxx @@ -65,10 +65,9 @@ public: virtual bool Start(const OUString& rHelpId, weld::Widget* pWidget = nullptr); virtual void SearchKeyword( const OUString& rKeyWord ); - virtual OUString GetHelpText(const OUString& aHelpURL, const weld::Widget* pWidget); virtual bool Start(const OUString& rHelpId, const vcl::Window* pWindow); - virtual OUString GetHelpText(const OUString& aHelpURL, const vcl::Window* pWindow); + virtual OUString GetHelpText(const OUString& aHelpURL); static void EnableContextHelp(); static void DisableContextHelp(); diff --git a/include/vcl/imaprect.hxx b/include/vcl/imaprect.hxx index 89cb52d80bbe..8abe1ed39960 100644 --- a/include/vcl/imaprect.hxx +++ b/include/vcl/imaprect.hxx @@ -25,7 +25,7 @@ class Fraction; -class UNLESS_MERGELIBS(VCL_DLLPUBLIC) IMapRectangleObject final : public IMapObject +class VCL_DLLPUBLIC IMapRectangleObject final : public IMapObject { tools::Rectangle aRect; diff --git a/include/vcl/jsdialog/executor.hxx b/include/vcl/jsdialog/executor.hxx index b60c035d587a..ef667a70ce26 100644 --- a/include/vcl/jsdialog/executor.hxx +++ b/include/vcl/jsdialog/executor.hxx @@ -126,6 +126,11 @@ public: { rNotebook.m_aLeavePageHdl.Call(rPage); } + + static bool activate_link(weld::LinkButton& rLinkButton) + { + return rLinkButton.signal_activate_link(); + } }; namespace jsdialog diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx index 71869689dc55..79a91a629783 100644 --- a/include/vcl/metaact.hxx +++ b/include/vcl/metaact.hxx @@ -510,6 +510,8 @@ private: std::vector<sal_Bool> maKashidaAry; sal_Int32 mnIndex; sal_Int32 mnLen; + sal_Int32 mnLayoutContextIndex = -1; + sal_Int32 mnLayoutContextLen = -1; SAL_DLLPRIVATE virtual ~MetaTextArrayAction() override; @@ -526,6 +528,9 @@ public: std::span<const sal_Bool> pKashidaAry, sal_Int32 nIndex, sal_Int32 nLen ); + MetaTextArrayAction(const Point& rStartPt, OUString aStr, KernArraySpan pDXAry, + std::span<const sal_Bool> pKashidaAry, sal_Int32 nIndex, sal_Int32 nLen, + sal_Int32 nLayoutContextIndex, sal_Int32 nLayoutContextLen); SAL_DLLPRIVATE virtual void Execute( OutputDevice* pOut ) override; @@ -538,12 +543,22 @@ public: const OUString& GetText() const { return maStr; } sal_Int32 GetIndex() const { return mnIndex; } sal_Int32 GetLen() const { return mnLen; } + sal_Int32 GetLayoutContextIndex() const { return mnLayoutContextIndex; } + sal_Int32 GetLayoutContextLen() const { return mnLayoutContextLen; } const KernArray& GetDXArray() const { return maDXAry; } const std::vector<sal_Bool> & GetKashidaArray() const { return maKashidaAry; } void SetPoint(const Point& rPt) { maStartPt = rPt; } void SetText(const OUString& rStr) { maStr = rStr; } void SetIndex(sal_Int32 rIndex) { mnIndex = rIndex; } void SetLen(sal_Int32 rLen) { mnLen = rLen; } + void SetLayoutContextIndex(sal_Int32 nLayoutContextIndex) + { + mnLayoutContextIndex = nLayoutContextIndex; + } + void SetLayoutContextLen(sal_Int32 nLayoutContextLen) + { + mnLayoutContextLen = nLayoutContextLen; + } SAL_DLLPRIVATE void SetDXArray(KernArray aArray); SAL_DLLPRIVATE void SetKashidaArray(std::vector<sal_Bool> aArray); }; diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 5ed43d0cf299..2fddb3c3f24a 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -21,6 +21,7 @@ #include <sal/config.h> +#include <comphelper/flagguard.hxx> #include <tools/gen.hxx> #include <tools/ref.hxx> #include <tools/solar.h> @@ -159,6 +160,12 @@ class OutputDevice; namespace vcl { typedef OutputDevice RenderContext; + + struct TextArrayMetrics + { + std::optional<tools::Rectangle> aBounds; + double nWidth = 0.0; + }; } VCL_DLLPUBLIC void InvertFocusRect(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect); @@ -260,6 +267,8 @@ private: mutable bool mbRefPoint : 1; mutable bool mbEnableRTL : 1; + bool mbNoFontScaling = false; // Used only by D2DWriteTextOutRenderer + protected: mutable std::shared_ptr<vcl::font::PhysicalFontCollection> mxFontCollection; mutable std::shared_ptr<ImplFontCache> mxFontCache; @@ -342,6 +351,8 @@ public: /// request XSpriteCanvas render interface css::uno::Reference< css::rendering::XSpriteCanvas > GetSpriteCanvas() const; + auto ScopedNoFontScaling() { return comphelper::FlagRestorationGuard(mbNoFontScaling, true); } + protected: /** Acquire a graphics device that the output device uses to draw on. @@ -1054,10 +1065,23 @@ public: sal_Int32 nLen, SalLayoutFlags flags = SalLayoutFlags::NONE, const SalLayoutGlyphs* pLayoutCache = nullptr); - double GetTextArray( const OUString& rStr, KernArray* pDXAry, - sal_Int32 nIndex = 0, sal_Int32 nLen = -1, bool bCaret = false, - vcl::text::TextLayoutCache const* = nullptr, - SalLayoutGlyphs const*const pLayoutCache = nullptr) const; + vcl::TextArrayMetrics GetTextArray(const OUString& rStr, KernArray* pDXAry, + sal_Int32 nIndex = 0, sal_Int32 nLen = -1, + bool bCaret = false, + vcl::text::TextLayoutCache const* = nullptr, + SalLayoutGlyphs const* const pLayoutCache = nullptr) const; + + void DrawPartialTextArray(const Point& rStartPt, const OUString& rStr, KernArraySpan aKernArray, + std::span<const sal_Bool> pKashidaAry, sal_Int32 nIndex, + sal_Int32 nLen, sal_Int32 nPartIndex, sal_Int32 nPartLen, + SalLayoutFlags flags = SalLayoutFlags::NONE, + const SalLayoutGlyphs* pLayoutCache = nullptr); + vcl::TextArrayMetrics GetPartialTextArray(const OUString& rStr, KernArray* pDXAry, + sal_Int32 nIndex, sal_Int32 nLen, + sal_Int32 nPartIndex, sal_Int32 nPartLen, + bool bCaret = false, + const vcl::text::TextLayoutCache* = nullptr, + const SalLayoutGlyphs* pLayoutCache = nullptr) const; SAL_DLLPRIVATE void GetCaretPositions( const OUString&, KernArray& rCaretXArray, sal_Int32 nIndex, sal_Int32 nLen, @@ -1145,11 +1169,12 @@ public: // i60594 // validate kashida positions against the current font // returns count of invalid kashida positions - sal_Int32 ValidateKashidas( const OUString& rTxt, sal_Int32 nIdx, sal_Int32 nLen, - sal_Int32 nKashCount, // number of suggested kashida positions (in) - const sal_Int32* pKashidaPos, // suggested kashida positions (in) - sal_Int32* pKashidaPosDropped // invalid kashida positions (out) - ) const; + sal_Int32 + ValidateKashidas(const OUString& rTxt, sal_Int32 nIdx, sal_Int32 nLen, sal_Int32 nPartIdx, + sal_Int32 nPartLen, + std::span<const sal_Int32> pKashidaPos, // suggested kashida positions (in) + std::vector<sal_Int32>* pKashidaPosDropped // invalid kashida positions (out) + ) const; static void BeginFontSubstitution(); static void EndFontSubstitution(); @@ -1220,14 +1245,14 @@ public: SAL_DLLPRIVATE void ReMirror( vcl::Region &rRegion ) const; SAL_DLLPRIVATE bool ImplIsRecordLayout() const; virtual bool HasMirroredGraphics() const; - std::unique_ptr<SalLayout> - ImplLayout( const OUString&, sal_Int32 nIndex, sal_Int32 nLen, - const Point& rLogicPos = Point(0,0), tools::Long nLogicWidth=0, - KernArraySpan aKernArray = KernArraySpan(), - std::span<const sal_Bool> pKashidaArray={}, - SalLayoutFlags flags = SalLayoutFlags::NONE, - vcl::text::TextLayoutCache const* = nullptr, - const SalLayoutGlyphs* pGlyphs = nullptr) const; + std::unique_ptr<SalLayout> ImplLayout( + const OUString&, sal_Int32 nIndex, sal_Int32 nLen, const Point& rLogicPos = Point(0, 0), + tools::Long nLogicWidth = 0, KernArraySpan aKernArray = KernArraySpan(), + std::span<const sal_Bool> pKashidaArray = {}, SalLayoutFlags flags = SalLayoutFlags::NONE, + vcl::text::TextLayoutCache const* = nullptr, const SalLayoutGlyphs* pGlyphs = nullptr, + std::optional<sal_Int32> nDrawOriginCluster = std::nullopt, + std::optional<sal_Int32> nDrawMinCharPos = std::nullopt, + std::optional<sal_Int32> nDrawEndCharPos = std::nullopt) const; SAL_DLLPRIVATE vcl::text::ImplLayoutArgs ImplPrepareLayoutArgs( OUString&, const sal_Int32 nIndex, const sal_Int32 nLen, double nPixelWidth, diff --git a/include/vcl/pdf/PDFAnnotationMarker.hxx b/include/vcl/pdf/PDFAnnotationMarker.hxx index c4be54d69318..d1217c65c3af 100644 --- a/include/vcl/pdf/PDFAnnotationMarker.hxx +++ b/include/vcl/pdf/PDFAnnotationMarker.hxx @@ -14,19 +14,29 @@ #include <tools/color.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/point/b2dpoint.hxx> +#include <vcl/bitmapex.hxx> namespace vcl::pdf { +/** PDF Annotation marker + * + * All units in 100th mm. + */ struct VCL_DLLPUBLIC PDFAnnotationMarker { - PDFAnnotationMarker() - : mnWidth(0.0f) - , maFillColor(COL_TRANSPARENT) - { - } + float mnWidth = 0.0; + Color maFillColor = COL_TRANSPARENT; +}; - float mnWidth; - Color maFillColor; +/** Stamp annotation marker - arbitrary bitmap as annotation */ +struct VCL_DLLPUBLIC PDFAnnotationMarkerStamp : public PDFAnnotationMarker +{ + BitmapEx maBitmapEx; +}; + +/** Free text annotation marker - showing text of the annotation in the document */ +struct VCL_DLLPUBLIC PDFAnnotationMarkerFreeText : public PDFAnnotationMarker +{ }; struct VCL_DLLPUBLIC PDFAnnotationMarkerCircle : public PDFAnnotationMarker diff --git a/include/vcl/pdf/PDFNote.hxx b/include/vcl/pdf/PDFNote.hxx new file mode 100644 index 000000000000..95fab08c2207 --- /dev/null +++ b/include/vcl/pdf/PDFNote.hxx @@ -0,0 +1,40 @@ +/* -*- 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/. + */ + +#pragma once + +#include <sal/types.h> +#include <tools/gen.hxx> +#include <tools/color.hxx> +#include <basegfx/polygon/b2dpolygon.hxx> + +#include <vcl/dllapi.h> +#include <vcl/pdf/PDFAnnotationSubType.hxx> + +#include <com/sun/star/util/DateTime.hpp> + +#include <vector> + +namespace vcl::pdf +{ +struct PDFNote +{ + vcl::pdf::PDFAnnotationSubType meType = vcl::pdf::PDFAnnotationSubType::Text; + + OUString maTitle; // optional title for the popup containing the note + OUString maContents; // contents of the note + css::util::DateTime maModificationDate; + std::vector<basegfx::B2DPolygon> maPolygons; + Color maAnnotationColor; + Color maInteriorColor; + float mfWidth = 0.0; +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/pdfextoutdevdata.hxx b/include/vcl/pdfextoutdevdata.hxx index 670ff234e2bd..e6bf7e5aed08 100644 --- a/include/vcl/pdfextoutdevdata.hxx +++ b/include/vcl/pdfextoutdevdata.hxx @@ -346,7 +346,7 @@ public: number of page the note is on (as returned by NewPage) or -1 in which case the current page is used */ - void CreateNote( const tools::Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr = -1 ); + void CreateNote( const tools::Rectangle& rRect, const vcl::pdf::PDFNote& rNote, sal_Int32 nPageNr = -1 ); /** begin a new logical structure element diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx index f4599154e465..044d18dece10 100644 --- a/include/vcl/pdfwriter.hxx +++ b/include/vcl/pdfwriter.hxx @@ -60,16 +60,7 @@ namespace vcl class PDFExtOutDevData; class PDFWriterImpl; -struct PDFNote -{ - OUString Title; // optional title for the popup containing the note - OUString Contents; // contents of the note - css::util::DateTime maModificationDate; - bool isFreeText = false; - std::vector<basegfx::B2DPolygon> maPolygons; - Color annotColor; - Color interiorColor; -}; +namespace pdf { struct PDFNote; } class VCL_DLLPUBLIC PDFOutputStream { @@ -790,11 +781,9 @@ The following structure describes the permissions used in PDF security FontStrikeout eStrikeout, FontLineStyle eUnderline, FontLineStyle eOverline ); - void DrawTextArray( const Point& rStartPt, const OUString& rStr, - KernArraySpan aKernArray, - std::span<const sal_Bool> pKashidaAry, - sal_Int32 nIndex, - sal_Int32 nLen ); + void DrawTextArray(const Point& rStartPt, const OUString& rStr, KernArraySpan aKernArray, + std::span<const sal_Bool> pKashidaAry, sal_Int32 nIndex, sal_Int32 nLen, + sal_Int32 nLayoutContextIndex, sal_Int32 nLayoutContextLen); void DrawStretchText( const Point& rStartPt, sal_Int32 nWidth, const OUString& rStr, sal_Int32 nIndex, sal_Int32 nLen ); @@ -1060,7 +1049,7 @@ The following structure describes the permissions used in PDF security number of page the note is on (as returned by NewPage) or -1 in which case the current page is used */ - void CreateNote( const tools::Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr ); + void CreateNote( const tools::Rectangle& rRect, const vcl::pdf::PDFNote& rNote, sal_Int32 nPageNr ); /** begin a new logical structure element diff --git a/include/vcl/rendercontext/SalLayoutFlags.hxx b/include/vcl/rendercontext/SalLayoutFlags.hxx index 576a4abd8fbd..3424fa2a1de4 100644 --- a/include/vcl/rendercontext/SalLayoutFlags.hxx +++ b/include/vcl/rendercontext/SalLayoutFlags.hxx @@ -33,10 +33,11 @@ enum class SalLayoutFlags DisableLigatures = 0x0200, ForFallback = 0x2000, GlyphItemsOnly = 0x4000, + UnclusteredGlyphs = 0x8000, }; namespace o3tl { -template <> struct typed_flags<SalLayoutFlags> : is_typed_flags<SalLayoutFlags, 0x6277> +template <> struct typed_flags<SalLayoutFlags> : is_typed_flags<SalLayoutFlags, 0xE277> { }; } diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx index e21091385bc7..402a50df6d96 100644 --- a/include/vcl/settings.hxx +++ b/include/vcl/settings.hxx @@ -205,6 +205,14 @@ enum class ToolbarIconSize Size32 = 3, }; +/** Text selection behavior when selecting an entry in an editable combobox. */ +enum class ComboBoxTextSelectionMode +{ + SelectText, // select the whole text of the new entry + CursorToStart, // don't select text, put text cursor to start of text + CursorToEnd // don't select text, put text cursor to end of text +}; + #define STYLE_CURSOR_NOBLINKTIME SAL_MAX_UINT64 class VCL_DLLPUBLIC StyleSettings @@ -627,6 +635,9 @@ public: // the default LineWidth for ListBox UI previews (LineStyle, LineDash, LineStartEnd). Default is 1. static sal_uInt16 GetListBoxPreviewDefaultLineWidth(); + void SetComboBoxTextSelectionMode(ComboBoxTextSelectionMode eMode); + ComboBoxTextSelectionMode GetComboBoxTextSelectionMode() const; + // defines if previews which contain potentially transparent objects (e.g. the dash/line/LineStartEnd previews and others) // use the default transparent visualization background (checkered background) as it has got standard in graphic programs nowadays void SetPreviewUsesCheckeredBackground(bool bNew); diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index d5f1739be1ae..2725642763c0 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -1326,7 +1326,7 @@ public: const std::vector<vcl::LOKPayloadItem>& rPayload = std::vector<vcl::LOKPayloadItem>()) const override; virtual void libreOfficeKitViewCallback(int nType, const OString& pPayload) const override; virtual void notifyInvalidation(tools::Rectangle const *) const override; - + virtual OString dumpNotifyState() const override; private: DECL_DLLPRIVATE_STATIC_LINK( Application, PostEventHandler, void*, void ); diff --git a/include/vcl/textfilter.hxx b/include/vcl/textfilter.hxx index 0113b28bcedc..bab09107e835 100644 --- a/include/vcl/textfilter.hxx +++ b/include/vcl/textfilter.hxx @@ -22,7 +22,7 @@ public: virtual OUString filter(const OUString& rText); - TextFilter(OUString aForbiddenChars = OUString(" ")); + TextFilter(OUString aForbiddenChars = u" "_ustr); virtual ~TextFilter(); }; diff --git a/include/vcl/toolkit/combobox.hxx b/include/vcl/toolkit/combobox.hxx index 89565cac8652..9e676601f8a8 100644 --- a/include/vcl/toolkit/combobox.hxx +++ b/include/vcl/toolkit/combobox.hxx @@ -31,15 +31,44 @@ #define COMBOBOX_ENTRY_NOTFOUND (SAL_MAX_INT32) #define COMBOBOX_MAX_ENTRIES (SAL_MAX_INT32 - 1) +class ImplBtn; +class ImplListBox; class ImplListBoxWindow; +class ImplListBoxFloatingWindow; class UserDrawEvent; +struct ComboBoxBounds; /// A widget used to choose from a list of items and which has an entry. class VCL_DLLPUBLIC ComboBox : public Edit { private: - struct SAL_DLLPRIVATE Impl; - std::unique_ptr<Impl> m_pImpl; + VclPtr<Edit> m_pSubEdit; + VclPtr<ImplListBox> m_pImplLB; + VclPtr<ImplBtn> m_pBtn; + VclPtr<ImplListBoxFloatingWindow> m_pFloatWin; + sal_uInt16 m_nDDHeight; + sal_Unicode m_cMultiSep; + bool m_isDDAutoSize : 1; + bool m_isSyntheticModify : 1; + bool m_isKeyBoardModify : 1; + bool m_isMatchCase : 1; + sal_Int32 m_nMaxWidthChars; + sal_Int32 m_nWidthInChars; + Link<ComboBox&, void> m_SelectHdl; + + void ImplInitComboBoxData(); + void ImplUpdateFloatSelection(); + ComboBoxBounds calcComboBoxDropDownComponentBounds( + const Size &rOutSize, const Size &rBorderOutSize) const; + + DECL_LINK(ImplSelectHdl, LinkParamNone*, void); + DECL_LINK(ImplCancelHdl, LinkParamNone*, void); + DECL_LINK(ImplDoubleClickHdl, ImplListBoxWindow*, void); + DECL_LINK(ImplClickBtnHdl, void*, void); + DECL_LINK(ImplPopupModeEndHdl, FloatingWindow*, void); + DECL_LINK(ImplSelectionChangedHdl, sal_Int32, void); + DECL_LINK(ImplAutocompleteHdl, Edit&, void); + DECL_LINK(ImplListItemSelectHdl , LinkParamNone*, void); protected: using Window::ImplInit; diff --git a/include/vcl/toolkit/fixed.hxx b/include/vcl/toolkit/fixed.hxx index f4c410c974af..313e717c5a2f 100644 --- a/include/vcl/toolkit/fixed.hxx +++ b/include/vcl/toolkit/fixed.hxx @@ -53,7 +53,7 @@ protected: virtual vcl::Window* getAccessibleRelationLabelFor() const override; public: - explicit FixedText( vcl::Window* pParent, WinBits nStyle = 0 ); + explicit FixedText(vcl::Window* pParent, WinBits nStyle = 0, WindowType eType = WindowType::FIXEDTEXT); virtual ~FixedText() override; virtual void dispose() override; diff --git a/include/vcl/vclevent.hxx b/include/vcl/vclevent.hxx index c60e89d8364e..bd6a473fa149 100644 --- a/include/vcl/vclevent.hxx +++ b/include/vcl/vclevent.hxx @@ -121,7 +121,6 @@ enum class VclEventId TabpageRemovedAll, ToolboxActivate, ToolboxAllItemsChanged, - ToolboxButtonStateChanged, // pData = itempos ToolboxClick, ToolboxDeactivate, ToolboxDoubleClick, diff --git a/include/vcl/vcllayout.hxx b/include/vcl/vcllayout.hxx index c946f6f67884..58ca11b876ef 100644 --- a/include/vcl/vcllayout.hxx +++ b/include/vcl/vcllayout.hxx @@ -22,6 +22,7 @@ #include <basegfx/point/b2dpoint.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/range/b2drectangle.hxx> +#include <comphelper/flagguard.hxx> #include <i18nlangtag/languagetag.hxx> #include <tools/gen.hxx> #include <tools/degree.hxx> @@ -97,6 +98,16 @@ public: virtual sal_Int32 GetTextBreak(double nMaxWidth, double nCharExtra, int nFactor) const = 0; virtual double FillDXArray( std::vector<double>* pDXArray, const OUString& rStr ) const = 0; virtual double GetTextWidth() const { return FillDXArray( nullptr, {} ); } + + virtual double FillPartialDXArray(std::vector<double>* pDXArray, const OUString& rStr, + sal_Int32 skipStart, sal_Int32 amt) const + = 0; + + virtual double GetPartialTextWidth(sal_Int32 skipStart, sal_Int32 amt) const + { + return FillPartialDXArray(nullptr, {}, skipStart, amt); + } + virtual void GetCaretPositions( std::vector<double>& rCaretPositions, const OUString& rStr ) const = 0; virtual bool IsKashidaPosValid ( int /*nCharPos*/, int /*nNextCharPos*/ ) const = 0; // i60594 @@ -110,6 +121,9 @@ public: virtual SalLayoutGlyphs GetGlyphs() const; + auto ScopedFontScaling(bool v) { return comphelper::FlagRestorationGuard(mbScaleFont, v); } + bool ScaleFont() const { return mbScaleFont; } + protected: // used by layout engines SalLayout(); @@ -118,9 +132,13 @@ private: SalLayout(const SalLayout&) = delete; SalLayout& operator=(const SalLayout&) = delete; + bool mbScaleFont = true; // Used only by D2DWriteTextOutRenderer + protected: int mnMinCharPos; int mnEndCharPos; + int mnDrawMinCharPos = std::numeric_limits<int>::min(); + int mnDrawEndCharPos = std::numeric_limits<int>::max(); LanguageTag maLanguageTag; Degree10 mnOrientation; diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 8b9495e9e4e8..c3a688d84be0 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -889,6 +889,10 @@ public: virtual void set_max_mru_count(int nCount) = 0; virtual OUString get_mru_entries() const = 0; virtual void set_mru_entries(const OUString& rEntries) = 0; + + // Backwards compatibility, should be avoided to allow + // UI consistency. + virtual void set_max_drop_down_rows(int nRows) = 0; }; enum class ColumnToggleType @@ -1665,6 +1669,8 @@ class VCL_DLLPUBLIC RadioButton : virtual public CheckButton class VCL_DLLPUBLIC LinkButton : virtual public Widget { + friend class ::LOKTrigger; + Link<LinkButton&, bool> m_aActivateLinkHdl; protected: diff --git a/include/vcl/weldutils.hxx b/include/vcl/weldutils.hxx index 222e96a63158..3807c83c478a 100644 --- a/include/vcl/weldutils.hxx +++ b/include/vcl/weldutils.hxx @@ -68,12 +68,12 @@ public: // css::awt::XWindow void SAL_CALL setPosSize(sal_Int32, sal_Int32, sal_Int32, sal_Int32, sal_Int16) override { - throw css::uno::RuntimeException("not implemented"); + throw css::uno::RuntimeException(u"not implemented"_ustr); } css::awt::Rectangle SAL_CALL getPosSize() override { - throw css::uno::RuntimeException("not implemented"); + throw css::uno::RuntimeException(u"not implemented"_ustr); } void SAL_CALL setVisible(sal_Bool bVisible) override { m_pWeldWidget->set_visible(bVisible); } diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index c71c0891c572..c78c214a5b60 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -694,7 +694,7 @@ private: // retrieves the list of owner draw decorated windows for this window hierarchy SAL_DLLPRIVATE ::std::vector<VclPtr<vcl::Window> >& ImplGetOwnerDrawList(); - SAL_DLLPRIVATE vcl::Window* ImplGetTopmostFrameWindow(); + SAL_DLLPRIVATE vcl::Window* ImplGetTopmostFrameWindow() const; SAL_DLLPRIVATE bool ImplStopDnd(); SAL_DLLPRIVATE void ImplStartDnd(); @@ -1119,7 +1119,7 @@ public: /// Dumps itself and potentially its children to a property tree, to be written easily to JSON. virtual void DumpAsPropertyTree(tools::JsonWriter&); - + /// Use OS specific way to bring user attention to current window virtual void FlashWindow() const; /** @name Accessibility diff --git a/include/vcl/wintypes.hxx b/include/vcl/wintypes.hxx index c025e83b0afe..d0d6208d735b 100644 --- a/include/vcl/wintypes.hxx +++ b/include/vcl/wintypes.hxx @@ -99,7 +99,8 @@ enum class WindowType : sal_uInt16 HEADERBAR , VERTICALTABCONTROL , PROGRESSBAR , - LAST = PROGRESSBAR, + LINK_BUTTON, + LAST = LINK_BUTTON, // only used in vclxtoolkit.cxx TOOLKIT_FRAMEWINDOW = 0x1000, TOOLKIT_SYSTEMCHILDWINDOW = 0x1001, diff --git a/include/xmloff/xmlevent.hxx b/include/xmloff/xmlevent.hxx index 163437f51af0..86601c415bb9 100644 --- a/include/xmloff/xmlevent.hxx +++ b/include/xmloff/xmlevent.hxx @@ -50,14 +50,10 @@ struct XMLEventName OUString m_aName; XMLEventName() : m_nPrefix( 0 ) {} - XMLEventName( sal_uInt16 n, const char *p ) : - m_nPrefix( n ), - m_aName( OUString::createFromAscii(p) ) - {} - XMLEventName( sal_uInt16 n, OUString s ) : + XMLEventName( sal_uInt16 n, const OUString& s ) : m_nPrefix( n ), - m_aName(std::move( s )) + m_aName( s ) {} bool operator<( const XMLEventName& r ) const @@ -75,9 +71,9 @@ struct XMLEventName */ struct XMLEventNameTranslation { - const char* sAPIName; + OUString sAPIName; sal_uInt16 nPrefix; // namespace prefix - const char* sXMLName; + OUString sXMLName; }; /// a translation table for the events defined in the XEventsSupplier service diff --git a/include/xmloff/xmlexp.hxx b/include/xmloff/xmlexp.hxx index f6a6e8748054..24db3601b3c3 100644 --- a/include/xmloff/xmlexp.hxx +++ b/include/xmloff/xmlexp.hxx @@ -649,9 +649,6 @@ public: // The constructor prints a start tag that has the common attributes // of the XMLExport instance attached. SvXMLElementExport( SvXMLExport& rExp, sal_uInt16 nPrefix, - const char *pName, - bool bIgnWSOutside, bool bIgnWSInside ); - SvXMLElementExport( SvXMLExport& rExp, sal_uInt16 nPrefix, const OUString& rName, bool bIgnWSOutside, bool bIgnWSInside ); SvXMLElementExport( SvXMLExport& rExp, sal_uInt16 nPrefix, |