configure.ac | 2 desktop/source/deployment/registry/configuration/dp_configuration.cxx | 36 ------ include/rtl/xmlencode.hxx | 55 ++++++++++ include/vcl/pdfwriter.hxx | 2 sd/source/filter/html/htmlex.cxx | 5 sw/source/filter/html/css1atr.cxx | 3 sw/source/filter/html/htmlfldw.cxx | 3 sw/source/ui/dialog/uiregionsw.cxx | 13 ++ vcl/source/gdi/pdfwriter_impl.cxx | 39 ------- 9 files changed, 82 insertions(+), 76 deletions(-)
New commits: commit 127e685b66bdfd79c186ac79a66b92ccef3bef07 Author: Andras Timar <[email protected]> AuthorDate: Wed Apr 12 23:30:37 2023 +0200 Commit: Andras Timar <[email protected]> CommitDate: Sun Apr 23 16:29:24 2023 +0200 Bump version to 22.05.13.1 Change-Id: I72a5b6418812c74ac47e4ccc4e82ff2238ad7eb6 diff --git a/configure.ac b/configure.ac index ebc592b173bb..89f1710abd16 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,7 @@ dnl in order to create a configure script. # several non-alphanumeric characters, those are split off and used only for the # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea. -AC_INIT([Collabora Office],[22.05.12.3],[],[],[https://collaboraoffice.com/]) +AC_INIT([Collabora Office],[22.05.13.1],[],[],[https://collaboraoffice.com/]) dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just fine if it is installed dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails hard commit 80c423520baa94cd3546e02cb383946a7d448ce9 Author: Szymon Kłos <[email protected]> AuthorDate: Fri Apr 7 19:03:55 2023 +0200 Commit: Andras Timar <[email protected]> CommitDate: Sun Apr 23 16:29:23 2023 +0200 lok: Hide file linking in section this is followup for 6f56317 Change-Id: I87227b3e665a6d15378ee294556bcd2f95801e6b diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index 94ed8bf40a8e..bcc821a9973b 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -397,6 +397,19 @@ SwEditRegionDlg::SwEditRegionDlg(weld::Window* pParent, SwWrtShell& rWrtSh) m_xTree->show(); bDontCheckPasswd = false; + + if(comphelper::LibreOfficeKit::isActive()) + { + m_xBuilder->weld_label("label8")->hide(); // Link + m_xFileCB->hide(); + m_xDDECB->hide(); + m_xDDECommandFT->hide(); + m_xFileNameFT->hide(); + m_xFileNameED->hide(); + m_xFilePB->hide(); + m_xSubRegionFT->hide(); + m_xSubRegionED->hide(); + } } bool SwEditRegionDlg::CheckPasswd(weld::Toggleable* pBox) commit 4cb0100ae7ad6850276b96ca9d6a4f6074db1d2f Author: Szymon Kłos <[email protected]> AuthorDate: Fri Apr 7 09:48:41 2023 +0200 Commit: Andras Timar <[email protected]> CommitDate: Sun Apr 23 16:29:23 2023 +0200 Make encodeForXml accessible for other modules and share similar code Change-Id: I7729a46d40845893f577c273c1ab340f69ebb51b diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index 4b388414a778..d049b6e92833 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -30,6 +30,7 @@ #include <rtl/string.hxx> #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> +#include <rtl/xmlencode.hxx> #include <cppuhelper/exc_hlp.hxx> #include <cppuhelper/supportsservice.hxx> #include <ucbhelper/content.hxx> @@ -564,39 +565,6 @@ BackendImpl::PackageImpl::isRegistered_( } -OUString encodeForXml( OUString const & text ) -{ - // encode conforming xml: - sal_Int32 len = text.getLength(); - OUStringBuffer buf; - for ( sal_Int32 pos = 0; pos < len; ++pos ) - { - sal_Unicode c = text[ pos ]; - switch (c) { - case '<': - buf.append( "<" ); - break; - case '>': - buf.append( ">" ); - break; - case '&': - buf.append( "&" ); - break; - case '\'': - buf.append( "'" ); - break; - case '\"': - buf.append( """ ); - break; - default: - buf.append( c ); - break; - } - } - return buf.makeStringAndClear(); -} - - OUString replaceOrigin( OUString const & url, std::u16string_view destFolder, Reference< XCommandEnvironment > const & xCmdEnv, Reference< XComponentContext > const & xContext, bool & out_replaced) { @@ -649,7 +617,7 @@ OUString replaceOrigin( if (origin.isEmpty()) { // encode only once origin = OUStringToOString( - encodeForXml( url.copy( 0, url.lastIndexOf( '/' ) ) ), + rtl::encodeForXml( url.subView( 0, url.lastIndexOf( '/' ) ) ), // xxx todo: encode always for UTF-8? => lookup doc-header? RTL_TEXTENCODING_UTF8 ); } diff --git a/include/rtl/xmlencode.hxx b/include/rtl/xmlencode.hxx new file mode 100644 index 000000000000..487c4ee94749 --- /dev/null +++ b/include/rtl/xmlencode.hxx @@ -0,0 +1,55 @@ +/* -*- 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/. + */ + +#ifndef INCLUDED_RTL_XMLENCODE_HXX +#define INCLUDED_RTL_XMLENCODE_HXX + +#include "rtl/ustring.hxx" + +namespace rtl +{ +inline OUString encodeForXml(std::u16string_view rStr) +{ + // encode conforming xml: + sal_Int32 len = rStr.length(); + OUStringBuffer buf; + for (sal_Int32 pos = 0; pos < len; ++pos) + { + sal_Unicode c = rStr[pos]; + switch (c) + { + case '<': + buf.append("<"); + break; + case '>': + buf.append(">"); + break; + case '&': + buf.append("&"); + break; + case '\'': + buf.append("'"); + break; + case '\"': + buf.append("""); + break; + default: + buf.append(c); + break; + } + } + + return buf.makeStringAndClear(); +} + +} /* Namespace */ + +#endif // INCLUDED_RTL_XMLENCODE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx index c14df91a0522..4236d2f3ea21 100644 --- a/include/vcl/pdfwriter.hxx +++ b/include/vcl/pdfwriter.hxx @@ -1214,8 +1214,6 @@ The following structure describes the permissions used in PDF security static OString GetDateTime(); }; -VCL_DLLPUBLIC void escapeStringXML( const OUString& rStr, OUString &rValue); - } #endif // INCLUDED_VCL_PDFWRITER_HXX diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 3e06c07fed38..aeb4360ed589 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/ucb/SimpleFileAccess.hpp> +#include <rtl/xmlencode.hxx> #include <sal/log.hxx> #include <rtl/tencinfo.h> #include <comphelper/processfactory.hxx> @@ -288,10 +289,10 @@ OUString HtmlState::SetLink( const OUString& aLink, const OUString& aTarget ) if (!aLink.isEmpty()) { - aStr += "<a href=\"" + aLink; + aStr += "<a href=\"" + rtl::encodeForXml(aLink); if (!aTarget.isEmpty()) { - aStr += "\" target=\"" + aTarget; + aStr += "\" target=\"" + rtl::encodeForXml(aTarget); } aStr += "\">"; mbLink = true; diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index f3d9a22c5140..44833c00e6a7 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -94,6 +94,7 @@ #include <o3tl/unit_conversion.hxx> #include <rtl/strbuf.hxx> +#include <rtl/xmlencode.hxx> #include <osl/diagnose.h> using namespace css; @@ -1075,7 +1076,7 @@ void SwHTMLWriter::PrepareFontList( const SvxFontItem& rFontItem, while( nStrPos != -1 ) { OUString aName = rName.getToken( 0, ';', nStrPos ); - aName = comphelper::string::strip(aName, ' '); + aName = rtl::encodeForXml(comphelper::string::strip(aName, ' ')); if( aName.isEmpty() ) continue; diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx index dbe4fe8d9092..fa069112a13d 100644 --- a/sw/source/filter/html/htmlfldw.cxx +++ b/sw/source/filter/html/htmlfldw.cxx @@ -21,6 +21,7 @@ #include <comphelper/string.hxx> #include <svtools/htmlkywd.hxx> #include <svtools/htmlout.hxx> +#include <rtl/xmlencode.hxx> #include <osl/diagnose.h> #include <fmtfld.hxx> #include <doc.hxx> @@ -510,7 +511,7 @@ Writer& OutHTML_SwFormatField( Writer& rWrt, const SfxPoolItem& rHt ) OString sOut = "<" OOO_STRING_SVTOOLS_HTML_comment " " + - OUStringToOString(sComment, static_cast<SwHTMLWriter&>(rWrt).m_eDestEnc) + + OUStringToOString(rtl::encodeForXml(sComment), static_cast<SwHTMLWriter&>(rWrt).m_eDestEnc) + " -->"; rWrt.Strm().WriteOString( sOut ); } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 647f861d31e8..8002d382ba28 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -50,6 +50,7 @@ #include <rtl/digest.h> #include <rtl/uri.hxx> #include <rtl/ustrbuf.hxx> +#include <rtl/xmlencode.hxx> #include <sal/log.hxx> #include <svl/urihelper.hxx> #include <tools/fract.hxx> @@ -5285,43 +5286,11 @@ sal_Int32 PDFWriterImpl::emitOutputIntent() return nOIObject; } -// formats the string for the XML stream -void escapeStringXML(const OUString& rStr, OUString &rValue) +static void lcl_assignMeta(std::u16string_view aValue, OString& aMeta) { - const sal_Unicode* pUni = rStr.getStr(); - int nLen = rStr.getLength(); - for( ; nLen; nLen--, pUni++ ) + if (!aValue.empty()) { - switch( *pUni ) - { - case u'&': - rValue += "&"; - break; - case u'<': - rValue += "<"; - break; - case u'>': - rValue += ">"; - break; - case u'\'': - rValue += "'"; - break; - case u'"': - rValue += """; - break; - default: - rValue += OUStringChar( *pUni ); - break; - } - } -} - -static void lcl_assignMeta(const OUString& aValue, OString& aMeta) -{ - if (!aValue.isEmpty()) - { - OUString aTempString; - escapeStringXML(aValue, aTempString); + OUString aTempString = rtl::encodeForXml(aValue); aMeta = OUStringToOString(aTempString, RTL_TEXTENCODING_UTF8); } }
