Adapt the remaining OUString functions to std string_view
...for LIBO_INTERNAL_ONLY. These had been missed by 1b43cceaea2084a0489db68cd0113508f34b6643 "Make many OUString functions take std::u16string_view parameters" because they did not match the multi-overload pattern that was addressed there, but they nevertheless benefit from being changed just as well (witness e.g. the various resulting changes from copy() to subView()). This showed a conversion from OStringChar to std::string_view to be missing (while the corresponding conversion form OUStringChar to std::u16string_view was already present). The improvement to loplugin:stringadd became necessary to fix > [CPT] compilerplugins/clang/test/stringadd.cxx > error: 'error' diagnostics expected but not seen: > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd] > File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd] > 2 errors generated. Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
parent
0c06e77c12
commit
35e471bb4d
@ -48,7 +48,7 @@ void FrameGrabber::disposePipeline()
|
||||
}
|
||||
}
|
||||
|
||||
FrameGrabber::FrameGrabber( const OUString &rURL ) :
|
||||
FrameGrabber::FrameGrabber( std::u16string_view rURL ) :
|
||||
FrameGrabber_BASE()
|
||||
{
|
||||
gchar *pPipelineStr;
|
||||
@ -87,7 +87,7 @@ FrameGrabber::~FrameGrabber()
|
||||
disposePipeline();
|
||||
}
|
||||
|
||||
FrameGrabber* FrameGrabber::create( const OUString &rURL )
|
||||
FrameGrabber* FrameGrabber::create( std::u16string_view rURL )
|
||||
{
|
||||
return new FrameGrabber( rURL );
|
||||
}
|
||||
|
@ -19,6 +19,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include "gstplayer.hxx"
|
||||
#include <com/sun/star/media/XFrameGrabber.hpp>
|
||||
#include <cppuhelper/implbase.hxx>
|
||||
@ -39,7 +43,7 @@ public:
|
||||
const FrameGrabber& operator=(const FrameGrabber&) =delete;
|
||||
|
||||
// static create method instead of public Ctor
|
||||
static FrameGrabber* create( const OUString &rURL );
|
||||
static FrameGrabber* create( std::u16string_view rURL );
|
||||
|
||||
virtual ~FrameGrabber() override;
|
||||
|
||||
@ -52,7 +56,7 @@ public:
|
||||
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
|
||||
|
||||
private:
|
||||
explicit FrameGrabber( const OUString &aURL );
|
||||
explicit FrameGrabber( std::u16string_view aURL );
|
||||
};
|
||||
|
||||
} // avmedia::gst
|
||||
|
@ -527,7 +527,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message )
|
||||
return GST_BUS_PASS;
|
||||
}
|
||||
|
||||
void Player::preparePlaybin( const OUString& rURL, GstElement *pSink )
|
||||
void Player::preparePlaybin( std::u16string_view rURL, GstElement *pSink )
|
||||
{
|
||||
if (mpPlaybin != nullptr)
|
||||
{
|
||||
|
@ -19,6 +19,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include <osl/conditn.hxx>
|
||||
#include "gstcommon.hxx"
|
||||
|
||||
@ -42,7 +46,7 @@ public:
|
||||
explicit Player();
|
||||
virtual ~Player() override;
|
||||
|
||||
void preparePlaybin( const OUString& rURL, GstElement *pSink );
|
||||
void preparePlaybin( std::u16string_view rURL, GstElement *pSink );
|
||||
bool create( const OUString& rURL );
|
||||
void processMessage( GstMessage *message );
|
||||
GstBusSyncReply processSyncMessage( GstMessage *message );
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include <rtl/ustrbuf.hxx>
|
||||
|
||||
#include <set>
|
||||
#include <string_view>
|
||||
|
||||
#include <vcl/textdata.hxx>
|
||||
#include <basic/codecompletecache.hxx>
|
||||
@ -58,7 +59,7 @@ class ModulWindowLayout;
|
||||
// tools Strings limited to 64K).
|
||||
// defined in baside2b.cxx
|
||||
OUString getTextEngineText (ExtTextEngine&);
|
||||
void setTextEngineText (ExtTextEngine&, OUString const&);
|
||||
void setTextEngineText (ExtTextEngine&, std::u16string_view);
|
||||
|
||||
class EditorWindow final : public vcl::Window, public SfxListener
|
||||
{
|
||||
|
@ -121,7 +121,7 @@ OUString getTextEngineText (ExtTextEngine& rEngine)
|
||||
return aText;
|
||||
}
|
||||
|
||||
void setTextEngineText (ExtTextEngine& rEngine, OUString const& aStr)
|
||||
void setTextEngineText (ExtTextEngine& rEngine, std::u16string_view aStr)
|
||||
{
|
||||
rEngine.SetText(OUString());
|
||||
OString aUTF8Str = OUStringToOString( aStr, RTL_TEXTENCODING_UTF8 );
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <image.hxx>
|
||||
#include <codegen.hxx>
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
|
||||
SbiImage::SbiImage()
|
||||
: bError(false)
|
||||
@ -459,7 +460,7 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer )
|
||||
for( size_t i = 0; i < mvStringOffsets.size(); i++ )
|
||||
{
|
||||
sal_uInt16 nOff = static_cast<sal_uInt16>(mvStringOffsets[ i ]);
|
||||
OString aStr(OUStringToOString(OUString(pStrings.get() + nOff), eCharSet));
|
||||
OString aStr(OUStringToOString(std::u16string_view(pStrings.get() + nOff), eCharSet));
|
||||
memcpy( pByteStrings.get() + nOff, aStr.getStr(), (aStr.getLength() + 1) * sizeof( char ) );
|
||||
}
|
||||
r.WriteUInt32( nStringSize );
|
||||
|
@ -20,6 +20,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
|
||||
#include <tools/stream.hxx>
|
||||
#include <o3tl/typed_flags_set.hxx>
|
||||
|
||||
@ -58,7 +60,7 @@ class SbiStream
|
||||
public:
|
||||
SbiStream();
|
||||
~SbiStream();
|
||||
ErrCode const & Open( const OString&, StreamMode, SbiStreamFlags, short );
|
||||
ErrCode const & Open( std::string_view, StreamMode, SbiStreamFlags, short );
|
||||
ErrCode const & Close();
|
||||
ErrCode Read(OString&, sal_uInt16 = 0, bool bForceReadingPerByte=false);
|
||||
ErrCode const & Read( char& );
|
||||
@ -96,7 +98,7 @@ public:
|
||||
void SetChannel( short n ) { nChan = n; }
|
||||
short GetChannel() const { return nChan;}
|
||||
void ResetChannel() { nChan = 0; }
|
||||
void Open( short, const OString&, StreamMode, SbiStreamFlags, short );
|
||||
void Open( short, std::string_view, StreamMode, SbiStreamFlags, short );
|
||||
void Close();
|
||||
void Read(OString&);
|
||||
char Read();
|
||||
|
@ -421,7 +421,7 @@ void UCBStream::SetSize( sal_uInt64 )
|
||||
|
||||
|
||||
ErrCode const & SbiStream::Open
|
||||
( const OString& rName, StreamMode nStrmMode, SbiStreamFlags nFlags, short nL )
|
||||
( std::string_view rName, StreamMode nStrmMode, SbiStreamFlags nFlags, short nL )
|
||||
{
|
||||
nMode = nFlags;
|
||||
nLen = nL;
|
||||
@ -631,7 +631,7 @@ ErrCode SbiIoSystem::GetError()
|
||||
return n;
|
||||
}
|
||||
|
||||
void SbiIoSystem::Open(short nCh, const OString& rName, StreamMode nMode, SbiStreamFlags nFlags, short nLen)
|
||||
void SbiIoSystem::Open(short nCh, std::string_view rName, StreamMode nMode, SbiStreamFlags nFlags, short nLen)
|
||||
{
|
||||
nError = ERRCODE_NONE;
|
||||
if( nCh >= CHANNELS || !nCh )
|
||||
|
@ -63,6 +63,7 @@
|
||||
#include <com/sun/star/bridge/oleautomation/XAutomationObject.hpp>
|
||||
#include <memory>
|
||||
#include <random>
|
||||
#include <string_view>
|
||||
#include <o3tl/char16_t2wchar_t.hxx>
|
||||
|
||||
using namespace comphelper;
|
||||
@ -2575,7 +2576,7 @@ static OUString implSetupWildcard(const OUString& rFileParam, SbiRTLData& rRTLDa
|
||||
return aPathStr;
|
||||
}
|
||||
|
||||
static bool implCheckWildcard(const OUString& rName, SbiRTLData const& rRTLData)
|
||||
static bool implCheckWildcard(std::u16string_view rName, SbiRTLData const& rRTLData)
|
||||
{
|
||||
bool bMatch = true;
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <config_features.h>
|
||||
|
||||
#include <math.h>
|
||||
#include <string_view>
|
||||
|
||||
#include <o3tl/float_int_conversion.hxx>
|
||||
#include <tools/debug.hxx>
|
||||
@ -1499,7 +1500,7 @@ bool SbxValue::LoadData( SvStream& r, sal_uInt16 )
|
||||
}
|
||||
else
|
||||
{
|
||||
write_uInt16_lenPrefixed_uInt8s_FromOUString(r, OUString(), RTL_TEXTENCODING_ASCII_US);
|
||||
write_uInt16_lenPrefixed_uInt8s_FromOUString(r, std::u16string_view(), RTL_TEXTENCODING_ASCII_US);
|
||||
}
|
||||
break;
|
||||
case SbxERROR:
|
||||
|
@ -124,7 +124,7 @@ protected:
|
||||
{
|
||||
if (m_aReferenceFile.is_open())
|
||||
m_aReferenceFile.close();
|
||||
OString sReferenceFile = OUStringToOString(m_directories.getPathFromSrc(getReferenceDirName()) + sFileName, RTL_TEXTENCODING_UTF8);
|
||||
OString sReferenceFile = OUStringToOString(OUString(m_directories.getPathFromSrc(getReferenceDirName()) + sFileName), RTL_TEXTENCODING_UTF8);
|
||||
m_aReferenceFile.open(sReferenceFile.getStr(), std::ios_base::in);
|
||||
CPPUNIT_ASSERT_MESSAGE(OString("Can't open reference file: " + sReferenceFile).getStr(), m_aReferenceFile.is_open());
|
||||
}
|
||||
@ -132,7 +132,7 @@ protected:
|
||||
{
|
||||
if (m_aDumpFile.is_open())
|
||||
m_aDumpFile.close();
|
||||
OString sDumpFile = OUStringToOString(m_directories.getPathFromSrc(getReferenceDirName()) + sFileName, RTL_TEXTENCODING_UTF8);
|
||||
OString sDumpFile = OUStringToOString(OUString(m_directories.getPathFromSrc(getReferenceDirName()) + sFileName), RTL_TEXTENCODING_UTF8);
|
||||
m_aDumpFile.open(sDumpFile.getStr(), std::ios_base::out | std::ofstream::binary | std::ofstream::trunc);
|
||||
CPPUNIT_ASSERT_MESSAGE(OString("Can't open dump file: " + sDumpFile).getStr(), m_aDumpFile.is_open());
|
||||
}
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <libxml/xpathInternals.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <string_view>
|
||||
|
||||
using uno::Reference;
|
||||
using beans::XPropertySet;
|
||||
@ -170,7 +171,7 @@ void Chart2GeometryTest::registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx)
|
||||
}
|
||||
}
|
||||
|
||||
static OString OU2O(const OUString& sOUSource)
|
||||
static OString OU2O(std::u16string_view sOUSource)
|
||||
{
|
||||
return rtl::OUStringToOString(sOUSource, RTL_TEXTENCODING_UTF8);
|
||||
}
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include <test/xmltesttools.hxx>
|
||||
|
||||
#include <fstream>
|
||||
#include <string_view>
|
||||
|
||||
class Chart2XShapeTest : public ChartTest, public XmlTestTools
|
||||
{
|
||||
@ -49,7 +50,7 @@ private:
|
||||
|
||||
namespace
|
||||
{
|
||||
bool checkDumpAgainstFile(const OUString& rDump, const OUString& aFilePath)
|
||||
bool checkDumpAgainstFile(const OUString& rDump, std::u16string_view aFilePath)
|
||||
{
|
||||
OString aOFile = OUStringToOString(aFilePath, RTL_TEXTENCODING_UTF8);
|
||||
|
||||
|
@ -40,6 +40,7 @@
|
||||
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
|
||||
namespace com::sun::star::accessibility { class XAccessible; }
|
||||
namespace com::sun::star::accessibility { class XAccessibleContext; }
|
||||
@ -426,7 +427,7 @@ private:
|
||||
|
||||
//executeDispatch methods
|
||||
void executeDispatch_ObjectProperties();
|
||||
void executeDispatch_FormatObject( const OUString& rDispatchCommand );
|
||||
void executeDispatch_FormatObject( std::u16string_view rDispatchCommand );
|
||||
void executeDlg_ObjectProperties( const OUString& rObjectCID );
|
||||
bool executeDlg_ObjectProperties_withoutUndoGuard( const OUString& rObjectCID, bool bSuccessOnUnchanged );
|
||||
|
||||
|
@ -650,7 +650,7 @@ OUString lcl_getObjectCIDForCommand( std::string_view rDispatchCommand, const un
|
||||
}
|
||||
// anonymous namespace
|
||||
|
||||
void ChartController::executeDispatch_FormatObject(const OUString& rDispatchCommand)
|
||||
void ChartController::executeDispatch_FormatObject(std::u16string_view rDispatchCommand)
|
||||
{
|
||||
uno::Reference< XChartDocument > xChartDocument( getModel(), uno::UNO_QUERY );
|
||||
OString aCommand( OUStringToOString( rDispatchCommand, RTL_TEXTENCODING_ASCII_US ) );
|
||||
|
@ -356,7 +356,7 @@ FileStream &operator<<(FileStream& o, const OStringBuffer& s) {
|
||||
return o;
|
||||
}
|
||||
|
||||
FileStream & operator <<(FileStream & out, OUString const & s) {
|
||||
FileStream & operator <<(FileStream & out, std::u16string_view s) {
|
||||
return out << OUStringToOString(s, RTL_TEXTENCODING_UTF8);
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ OString scopedCppName(OString const & type, bool ns_alias)
|
||||
}
|
||||
|
||||
OString translateUnoToCppType(
|
||||
codemaker::UnoType::Sort sort, OUString const & nucleus)
|
||||
codemaker::UnoType::Sort sort, std::u16string_view nucleus)
|
||||
{
|
||||
OStringBuffer buf;
|
||||
if (sort <= codemaker::UnoType::Sort::Any) {
|
||||
@ -75,7 +75,7 @@ OString translateUnoToCppType(
|
||||
buf.append(cppTypes[static_cast<int>(sort)]);
|
||||
} else {
|
||||
if (sort == codemaker::UnoType::Sort::Interface
|
||||
&& nucleus == "com.sun.star.uno.XInterface")
|
||||
&& nucleus == u"com.sun.star.uno.XInterface")
|
||||
{
|
||||
buf.append("::css::uno::XInterface");
|
||||
} else {
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <cstdlib>
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <string_view>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
@ -164,7 +165,7 @@ public:
|
||||
void dump(CppuOptions const & options);
|
||||
|
||||
void dumpFile(
|
||||
OUString const & uri, OUString const & name, bool hpp,
|
||||
std::u16string_view uri, OUString const & name, bool hpp,
|
||||
CppuOptions const & options);
|
||||
|
||||
void dumpDependedTypes(
|
||||
@ -219,7 +220,7 @@ protected:
|
||||
|
||||
OUString resolveOuterTypedefs(OUString const & name) const;
|
||||
|
||||
OUString resolveAllTypedefs(OUString const & name) const;
|
||||
OUString resolveAllTypedefs(std::u16string_view name) const;
|
||||
|
||||
codemaker::cpp::IdentifierTranslationMode isGlobal() const;
|
||||
|
||||
@ -412,7 +413,7 @@ void CppuType::dump(CppuOptions const & options)
|
||||
}
|
||||
|
||||
void CppuType::dumpFile(
|
||||
OUString const & uri, OUString const & name, bool hpp,
|
||||
std::u16string_view uri, OUString const & name, bool hpp,
|
||||
CppuOptions const & options)
|
||||
{
|
||||
OUString fileUri(
|
||||
@ -990,7 +991,7 @@ OUString CppuType::resolveOuterTypedefs(OUString const & name) const
|
||||
}
|
||||
}
|
||||
|
||||
OUString CppuType::resolveAllTypedefs(OUString const & name) const
|
||||
OUString CppuType::resolveAllTypedefs(std::u16string_view name) const
|
||||
{
|
||||
sal_Int32 k1;
|
||||
OUString n(b2u(codemaker::UnoType::decompose(u2b(name), &k1)));
|
||||
@ -1126,11 +1127,11 @@ private:
|
||||
}
|
||||
|
||||
void dumpExceptionTypeName(
|
||||
FileStream & out, OUString const & prefix, sal_uInt32 index,
|
||||
OUString const & name) const;
|
||||
FileStream & out, std::u16string_view prefix, sal_uInt32 index,
|
||||
std::u16string_view name) const;
|
||||
|
||||
sal_Int32 dumpExceptionTypeNames(
|
||||
FileStream & out, OUString const & prefix,
|
||||
FileStream & out, std::u16string_view prefix,
|
||||
std::vector< OUString > const & exceptions, bool runtimeException) const;
|
||||
|
||||
rtl::Reference< unoidl::InterfaceTypeEntity > entity_;
|
||||
@ -1456,9 +1457,9 @@ void InterfaceType::dumpCppuAttributes(FileStream & out, sal_uInt32 & index)
|
||||
<< "::rtl::OUString sAttributeName" << n << "( \"" << name_
|
||||
<< "::" << attr.name << "\" );\n";
|
||||
sal_Int32 getExcn = dumpExceptionTypeNames(
|
||||
out, "get", attr.getExceptions, false);
|
||||
out, u"get", attr.getExceptions, false);
|
||||
sal_Int32 setExcn = dumpExceptionTypeNames(
|
||||
out, "set", attr.setExceptions, false);
|
||||
out, u"set", attr.setExceptions, false);
|
||||
out << indent()
|
||||
<< ("typelib_typedescription_newExtendedInterfaceAttribute("
|
||||
" &pAttribute,\n");
|
||||
@ -1525,7 +1526,7 @@ void InterfaceType::dumpCppuMethods(FileStream & out, sal_uInt32 & index)
|
||||
++m;
|
||||
}
|
||||
sal_Int32 excn = dumpExceptionTypeNames(
|
||||
out, "", method.exceptions,
|
||||
out, u"", method.exceptions,
|
||||
method.name != "acquire" && method.name != "release");
|
||||
out << indent() << "::rtl::OUString sReturnType" << n << "( \""
|
||||
<< returnType << "\" );\n" << indent()
|
||||
@ -1589,15 +1590,15 @@ void InterfaceType::dumpMethodsCppuDecl(
|
||||
}
|
||||
|
||||
void InterfaceType::dumpExceptionTypeName(
|
||||
FileStream & out, OUString const & prefix, sal_uInt32 index,
|
||||
OUString const & name) const
|
||||
FileStream & out, std::u16string_view prefix, sal_uInt32 index,
|
||||
std::u16string_view name) const
|
||||
{
|
||||
out << indent() << "::rtl::OUString the_" << prefix << "ExceptionName"
|
||||
<< index << "( \"" << name << "\" );\n";
|
||||
}
|
||||
|
||||
sal_Int32 InterfaceType::dumpExceptionTypeNames(
|
||||
FileStream & out, OUString const & prefix,
|
||||
FileStream & out, std::u16string_view prefix,
|
||||
std::vector< OUString > const & exceptions, bool runtimeException) const
|
||||
{
|
||||
sal_Int32 count = 0;
|
||||
@ -1608,7 +1609,7 @@ sal_Int32 InterfaceType::dumpExceptionTypeNames(
|
||||
}
|
||||
if (runtimeException) {
|
||||
dumpExceptionTypeName(
|
||||
out, prefix, count++, "com.sun.star.uno.RuntimeException");
|
||||
out, prefix, count++, u"com.sun.star.uno.RuntimeException");
|
||||
}
|
||||
if (count != 0) {
|
||||
out << indent() << "rtl_uString * the_" << prefix << "Exceptions[] = {";
|
||||
@ -1765,7 +1766,7 @@ void ConstantGroup::dumpDeclaration(FileStream & out)
|
||||
}
|
||||
}
|
||||
|
||||
void dumpTypeParameterName(FileStream & out, OUString const & name)
|
||||
void dumpTypeParameterName(FileStream & out, std::u16string_view name)
|
||||
{
|
||||
// Prefix all type parameters with "typeparam_" to avoid problems when a
|
||||
// struct member has the same name as a type parameter, as in
|
||||
@ -2722,7 +2723,7 @@ void PolyStructType::dumpTemplateParameters(FileStream & out) const
|
||||
out << " >";
|
||||
}
|
||||
|
||||
OUString typeToIdentifier(OUString const & name)
|
||||
OUString typeToIdentifier(std::u16string_view name)
|
||||
{
|
||||
sal_Int32 k;
|
||||
OUString n(b2u(codemaker::UnoType::decompose(u2b(name), &k)));
|
||||
@ -3553,7 +3554,7 @@ private:
|
||||
};
|
||||
|
||||
void failsToSupply(
|
||||
FileStream & o, OUString const & service, OString const & type)
|
||||
FileStream & o, std::u16string_view service, OString const & type)
|
||||
{
|
||||
o << "::rtl::OUString(\"component context fails to supply service \") + \""
|
||||
<< service << "\" + \" of type \" + \"" << type << "\"";
|
||||
|
@ -70,7 +70,7 @@ bool dumpNamespaceClose(
|
||||
}
|
||||
|
||||
void dumpTypeIdentifier(FileStream & out, OUString const & entityName) {
|
||||
out << entityName.copy(entityName.lastIndexOf('.') + 1);
|
||||
out << entityName.subView(entityName.lastIndexOf('.') + 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -265,7 +265,7 @@ void Includes::dumpInclude(
|
||||
<< (hpp ? "hpp" : "hdl") << "\"\n";
|
||||
}
|
||||
|
||||
bool Includes::isInterfaceType(OString const & entityName) const {
|
||||
bool Includes::isInterfaceType(std::string_view entityName) const {
|
||||
return m_manager->getSort(b2u(entityName)) == UnoType::Sort::Interface;
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include <rtl/ref.hxx>
|
||||
#include <rtl/ustring.hxx>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
#include "dependencies.hxx"
|
||||
|
||||
@ -68,7 +69,7 @@ private:
|
||||
Includes(Includes const &) = delete;
|
||||
Includes& operator =(const Includes&) = delete;
|
||||
|
||||
bool isInterfaceType(OString const & entityName) const;
|
||||
bool isInterfaceType(std::string_view entityName) const;
|
||||
|
||||
rtl::Reference< TypeManager > m_manager;
|
||||
Dependencies::Map m_map;
|
||||
|
@ -91,7 +91,7 @@ public:
|
||||
const OUString& str1, sal_Int32 off1, sal_Int32 len1,
|
||||
const OUString& str2, sal_Int32 off2, sal_Int32 len2) override
|
||||
{
|
||||
return str1.copy(off1, len1).compareTo(str2.copy(off2, len2));
|
||||
return str1.copy(off1, len1).compareTo(str2.subView(off2, len2));
|
||||
}
|
||||
virtual sal_Int32 SAL_CALL compareString(
|
||||
const OUString& str1,
|
||||
@ -238,7 +238,7 @@ void TestString::testNatural()
|
||||
);
|
||||
// Original behavior
|
||||
CPPUNIT_ASSERT(
|
||||
OUString("Heading 9").compareTo("Heading 10") > 0
|
||||
OUString("Heading 9").compareTo(u"Heading 10") > 0
|
||||
);
|
||||
CPPUNIT_ASSERT(
|
||||
compareNatural("Heading 10", "Heading 9", xCollator, xBI, lang::Locale()) > 0
|
||||
@ -248,7 +248,7 @@ void TestString::testNatural()
|
||||
compareNatural("July, the 4th", "July, the 10th", xCollator, xBI, lang::Locale()) < 0
|
||||
);
|
||||
CPPUNIT_ASSERT(
|
||||
OUString("July, the 4th").compareTo("July, the 10th") > 0
|
||||
OUString("July, the 4th").compareTo(u"July, the 10th") > 0
|
||||
);
|
||||
CPPUNIT_ASSERT(
|
||||
compareNatural("July, the 10th", "July, the 4th", xCollator, xBI, lang::Locale()) > 0
|
||||
@ -258,7 +258,7 @@ void TestString::testNatural()
|
||||
compareNatural("abc08", "abc010", xCollator, xBI, lang::Locale()) < 0
|
||||
);
|
||||
CPPUNIT_ASSERT(
|
||||
OUString("abc08").compareTo("abc010") > 0
|
||||
OUString("abc08").compareTo(u"abc010") > 0
|
||||
);
|
||||
CPPUNIT_ASSERT(
|
||||
compareNatural("abc010", "abc08", xCollator, xBI, lang::Locale()) > 0
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <config_gpgme.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <string_view>
|
||||
|
||||
#include <comphelper/docpasswordhelper.hxx>
|
||||
#include <comphelper/storagehelper.hxx>
|
||||
@ -56,11 +57,11 @@ using namespace ::com::sun::star;
|
||||
namespace comphelper {
|
||||
|
||||
|
||||
static uno::Sequence< sal_Int8 > GeneratePBKDF2Hash( const OUString& aPassword, const uno::Sequence< sal_Int8 >& aSalt, sal_Int32 nCount, sal_Int32 nHashLength )
|
||||
static uno::Sequence< sal_Int8 > GeneratePBKDF2Hash( std::u16string_view aPassword, const uno::Sequence< sal_Int8 >& aSalt, sal_Int32 nCount, sal_Int32 nHashLength )
|
||||
{
|
||||
uno::Sequence< sal_Int8 > aResult;
|
||||
|
||||
if ( !aPassword.isEmpty() && aSalt.hasElements() && nCount && nHashLength )
|
||||
if ( !aPassword.empty() && aSalt.hasElements() && nCount && nHashLength )
|
||||
{
|
||||
OString aBytePass = OUStringToOString( aPassword, RTL_TEXTENCODING_UTF8 );
|
||||
// FIXME this is subject to the SHA1-bug tdf#114939 - see also
|
||||
@ -84,7 +85,7 @@ IDocPasswordVerifier::~IDocPasswordVerifier()
|
||||
}
|
||||
|
||||
|
||||
uno::Sequence< beans::PropertyValue > DocPasswordHelper::GenerateNewModifyPasswordInfo( const OUString& aPassword )
|
||||
uno::Sequence< beans::PropertyValue > DocPasswordHelper::GenerateNewModifyPasswordInfo( std::u16string_view aPassword )
|
||||
{
|
||||
uno::Sequence< beans::PropertyValue > aResult;
|
||||
|
||||
@ -109,10 +110,10 @@ uno::Sequence< beans::PropertyValue > DocPasswordHelper::GenerateNewModifyPasswo
|
||||
}
|
||||
|
||||
|
||||
bool DocPasswordHelper::IsModifyPasswordCorrect( const OUString& aPassword, const uno::Sequence< beans::PropertyValue >& aInfo )
|
||||
bool DocPasswordHelper::IsModifyPasswordCorrect( std::u16string_view aPassword, const uno::Sequence< beans::PropertyValue >& aInfo )
|
||||
{
|
||||
bool bResult = false;
|
||||
if ( !aPassword.isEmpty() && aInfo.hasElements() )
|
||||
if ( !aPassword.empty() && aInfo.hasElements() )
|
||||
{
|
||||
OUString sAlgorithm;
|
||||
uno::Sequence< sal_Int8 > aSalt;
|
||||
@ -223,7 +224,7 @@ sal_uInt32 DocPasswordHelper::GetWordHashAsUINT32(
|
||||
|
||||
|
||||
sal_uInt16 DocPasswordHelper::GetXLHashAsUINT16(
|
||||
const OUString& aUString,
|
||||
std::u16string_view aUString,
|
||||
rtl_TextEncoding nEnc )
|
||||
{
|
||||
sal_uInt16 nResult = 0;
|
||||
@ -248,7 +249,7 @@ sal_uInt16 DocPasswordHelper::GetXLHashAsUINT16(
|
||||
|
||||
|
||||
Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
|
||||
const OUString& aUString )
|
||||
std::u16string_view aUString )
|
||||
{
|
||||
sal_uInt16 nHash = GetXLHashAsUINT16( aUString );
|
||||
return {sal_Int8(nHash >> 8), sal_Int8(nHash & 0xFF)};
|
||||
|
@ -379,11 +379,11 @@ uno::Reference< embed::XStorage > OStorageHelper::GetStorageOfFormatFromStream(
|
||||
}
|
||||
|
||||
|
||||
uno::Sequence< beans::NamedValue > OStorageHelper::CreatePackageEncryptionData( const OUString& aPassword )
|
||||
uno::Sequence< beans::NamedValue > OStorageHelper::CreatePackageEncryptionData( std::u16string_view aPassword )
|
||||
{
|
||||
// TODO/LATER: Should not the method be part of DocPasswordHelper?
|
||||
uno::Sequence< beans::NamedValue > aEncryptionData;
|
||||
if ( !aPassword.isEmpty() )
|
||||
if ( !aPassword.empty() )
|
||||
{
|
||||
sal_Int32 nSha1Ind = 0;
|
||||
// generate SHA256 start key
|
||||
|
@ -291,18 +291,36 @@ bool StringAdd::isSideEffectFree(Expr const* expr)
|
||||
{
|
||||
// check for calls through OUString::number/OUString::unacquired
|
||||
if (auto calleeMethodDecl = dyn_cast_or_null<CXXMethodDecl>(callExpr->getCalleeDecl()))
|
||||
if (calleeMethodDecl && calleeMethodDecl->getIdentifier())
|
||||
if (calleeMethodDecl)
|
||||
{
|
||||
auto name = calleeMethodDecl->getName();
|
||||
if (callExpr->getNumArgs() > 0
|
||||
&& (name == "number" || name == "unacquired" || name == "boolean"
|
||||
|| name == "copy"))
|
||||
if (calleeMethodDecl->getIdentifier())
|
||||
{
|
||||
auto tc = loplugin::TypeCheck(calleeMethodDecl->getParent());
|
||||
if (tc.Class("OUString") || tc.Class("OString"))
|
||||
auto name = calleeMethodDecl->getName();
|
||||
if (callExpr->getNumArgs() > 0
|
||||
&& (name == "number" || name == "unacquired" || name == "boolean"
|
||||
|| name == "copy"))
|
||||
{
|
||||
if (isSideEffectFree(callExpr->getArg(0)))
|
||||
return true;
|
||||
auto tc = loplugin::TypeCheck(calleeMethodDecl->getParent());
|
||||
if (tc.Class("OUString") || tc.Class("OString"))
|
||||
{
|
||||
if (isSideEffectFree(callExpr->getArg(0)))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (auto const d = dyn_cast<CXXConversionDecl>(calleeMethodDecl))
|
||||
{
|
||||
if (loplugin::TypeCheck(d->getConversionType())
|
||||
.ClassOrStruct("basic_string_view")
|
||||
.StdNamespace())
|
||||
{
|
||||
auto const tc = loplugin::TypeCheck(calleeMethodDecl->getParent());
|
||||
if (tc.Class("OUString").Namespace("rtl").GlobalNamespace()
|
||||
|| tc.Class("OString").Namespace("rtl").GlobalNamespace())
|
||||
{
|
||||
if (isSideEffectFree(callExpr->getCallee()))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ namespace connectivity
|
||||
return aRet;
|
||||
}
|
||||
|
||||
bool existsJavaClassByName( const ::rtl::Reference< jvmaccess::VirtualMachine >& _pJVM,const OUString& _sClassName )
|
||||
bool existsJavaClassByName( const ::rtl::Reference< jvmaccess::VirtualMachine >& _pJVM,std::u16string_view _sClassName )
|
||||
{
|
||||
bool bRet = false;
|
||||
if ( _pJVM.is() )
|
||||
|
@ -144,7 +144,7 @@ DriversConfig& DriversConfig::operator=( const DriversConfig& _rhs )
|
||||
}
|
||||
|
||||
|
||||
OUString DriversConfig::getDriverFactoryName(const OUString& _sURL) const
|
||||
OUString DriversConfig::getDriverFactoryName(std::u16string_view _sURL) const
|
||||
{
|
||||
const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB);
|
||||
OUString sRet;
|
||||
@ -162,7 +162,7 @@ OUString DriversConfig::getDriverFactoryName(const OUString& _sURL) const
|
||||
return sRet;
|
||||
}
|
||||
|
||||
OUString DriversConfig::getDriverTypeDisplayName(const OUString& _sURL) const
|
||||
OUString DriversConfig::getDriverTypeDisplayName(std::u16string_view _sURL) const
|
||||
{
|
||||
const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB);
|
||||
OUString sRet;
|
||||
@ -180,22 +180,25 @@ OUString DriversConfig::getDriverTypeDisplayName(const OUString& _sURL) const
|
||||
return sRet;
|
||||
}
|
||||
|
||||
const ::comphelper::NamedValueCollection& DriversConfig::getProperties(const OUString& _sURL) const
|
||||
const ::comphelper::NamedValueCollection& DriversConfig::getProperties(std::u16string_view _sURL)
|
||||
const
|
||||
{
|
||||
return impl_get(_sURL,1);
|
||||
}
|
||||
|
||||
const ::comphelper::NamedValueCollection& DriversConfig::getFeatures(const OUString& _sURL) const
|
||||
const ::comphelper::NamedValueCollection& DriversConfig::getFeatures(std::u16string_view _sURL)
|
||||
const
|
||||
{
|
||||
return impl_get(_sURL,0);
|
||||
}
|
||||
|
||||
const ::comphelper::NamedValueCollection& DriversConfig::getMetaData(const OUString& _sURL) const
|
||||
const ::comphelper::NamedValueCollection& DriversConfig::getMetaData(std::u16string_view _sURL)
|
||||
const
|
||||
{
|
||||
return impl_get(_sURL,2);
|
||||
}
|
||||
|
||||
const ::comphelper::NamedValueCollection& DriversConfig::impl_get(const OUString& _sURL,sal_Int32 _nProps) const
|
||||
const ::comphelper::NamedValueCollection& DriversConfig::impl_get(std::u16string_view _sURL,sal_Int32 _nProps) const
|
||||
{
|
||||
const TInstalledDrivers& rDrivers = m_aNode->getInstalledDrivers(m_xORB);
|
||||
const ::comphelper::NamedValueCollection* pRet = nullptr;
|
||||
|
@ -760,7 +760,7 @@ int ONDXKey::Compare(const ONDXKey& rKey) const
|
||||
}
|
||||
else if (IsText(getDBType()))
|
||||
{
|
||||
nRes = getValue().getString().compareTo(rKey.getValue());
|
||||
nRes = getValue().getString().compareTo(rKey.getValue().getString());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -17,6 +17,10 @@
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
*/
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include <osl/diagnose.h>
|
||||
#include <rtl/ustring.hxx>
|
||||
#include <sal/log.hxx>
|
||||
@ -54,9 +58,9 @@ EBookQuery * createTrue()
|
||||
return e_book_query_from_string("(exists \"full_name\")");
|
||||
}
|
||||
|
||||
EBookQuery * createTest( const OUString &aColumnName,
|
||||
EBookQuery * createTest( std::u16string_view aColumnName,
|
||||
EBookQueryTest eTest,
|
||||
const OUString &aMatch )
|
||||
std::u16string_view aMatch )
|
||||
{
|
||||
OString sMatch = OUStringToOString( aMatch, RTL_TEXTENCODING_UTF8 );
|
||||
OString sColumnName = OUStringToOString( aColumnName, RTL_TEXTENCODING_UTF8 );
|
||||
@ -364,7 +368,7 @@ EBookQuery *OCommonStatement::whereAnalysis( const OSQLParseNode* parseTree )
|
||||
{
|
||||
// String containing only a '%' and nothing else matches everything
|
||||
pResult = createTest( aColumnName, E_BOOK_QUERY_CONTAINS,
|
||||
"" );
|
||||
u"" );
|
||||
}
|
||||
else if( aMatchString.indexOf( WILDCARD ) == -1 )
|
||||
{ // Simple string , eg. "to match" "contains in evo"
|
||||
@ -381,9 +385,10 @@ EBookQuery *OCommonStatement::whereAnalysis( const OSQLParseNode* parseTree )
|
||||
else if( aMatchString.indexOf ( WILDCARD ) == aMatchString.lastIndexOf ( WILDCARD ) )
|
||||
{ // One occurrence of '%' matches...
|
||||
if ( aMatchString.startsWith(OUStringChar(WILDCARD)) )
|
||||
pResult = createTest( aColumnName, E_BOOK_QUERY_ENDS_WITH, aMatchString.copy( 1 ) );
|
||||
pResult = createTest(
|
||||
aColumnName, E_BOOK_QUERY_ENDS_WITH, aMatchString.subView( 1 ) );
|
||||
else if ( aMatchString.indexOf ( WILDCARD ) == aMatchString.getLength() - 1 )
|
||||
pResult = createTest( aColumnName, E_BOOK_QUERY_BEGINS_WITH, aMatchString.copy( 0, aMatchString.getLength() - 1 ) );
|
||||
pResult = createTest( aColumnName, E_BOOK_QUERY_BEGINS_WITH, aMatchString.subView( 0, aMatchString.getLength() - 1 ) );
|
||||
else
|
||||
m_xConnection->throwGenericSQLException(STR_QUERY_LIKE_WILDCARD,*this);
|
||||
}
|
||||
@ -391,7 +396,7 @@ EBookQuery *OCommonStatement::whereAnalysis( const OSQLParseNode* parseTree )
|
||||
aMatchString.startsWith(OUStringChar(WILDCARD)) &&
|
||||
aMatchString.indexOf ( WILDCARD, 1) == aMatchString.getLength() - 1 ) {
|
||||
// one '%' at the start and another at the end
|
||||
pResult = createTest( aColumnName, E_BOOK_QUERY_CONTAINS, aMatchString.copy (1, aMatchString.getLength() - 2) );
|
||||
pResult = createTest( aColumnName, E_BOOK_QUERY_CONTAINS, aMatchString.subView (1, aMatchString.getLength() - 2) );
|
||||
}
|
||||
else
|
||||
m_xConnection->throwGenericSQLException(STR_QUERY_LIKE_WILDCARD_MANY,*this);
|
||||
|
@ -43,7 +43,7 @@ ORowSetValue OOp_Ascii::operate(const ORowSetValue& lhs) const
|
||||
{
|
||||
if (lhs.isNull())
|
||||
return lhs;
|
||||
OString sStr(OUStringToOString(lhs, RTL_TEXTENCODING_ASCII_US));
|
||||
OString sStr(OUStringToOString(lhs.getString(), RTL_TEXTENCODING_ASCII_US));
|
||||
sal_Int32 nAscii = sStr.toChar();
|
||||
return nAscii;
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ void SAL_CALL OStatementCommonBase::close()
|
||||
dispose();
|
||||
}
|
||||
|
||||
void OStatementCommonBase::prepareAndDescribeStatement(const OUString& sql,
|
||||
void OStatementCommonBase::prepareAndDescribeStatement(std::u16string_view sql,
|
||||
XSQLDA*& pOutSqlda,
|
||||
XSQLDA* pInSqlda)
|
||||
{
|
||||
|
@ -20,6 +20,10 @@
|
||||
#ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_FIREBIRD_STATEMENTCOMMONBASE_HXX
|
||||
#define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_FIREBIRD_STATEMENTCOMMONBASE_HXX
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include "Connection.hxx"
|
||||
#include "SubComponent.hxx"
|
||||
|
||||
@ -81,7 +85,7 @@ namespace connectivity::firebird
|
||||
virtual ~OStatementCommonBase() override;
|
||||
|
||||
/// @throws css::sdbc::SQLException
|
||||
void prepareAndDescribeStatement(const OUString& sqlIn,
|
||||
void prepareAndDescribeStatement(std::u16string_view sqlIn,
|
||||
XSQLDA*& pOutSqlda,
|
||||
XSQLDA* pInSqlda=nullptr);
|
||||
|
||||
|
@ -36,7 +36,7 @@ jclass java_lang_Class::getMyClass() const
|
||||
return theClass;
|
||||
}
|
||||
|
||||
java_lang_Class* java_lang_Class::forName(const OUString& _par0)
|
||||
java_lang_Class* java_lang_Class::forName(std::u16string_view _par0)
|
||||
{
|
||||
jobject out(nullptr);
|
||||
SDBThreadAttach t;
|
||||
|
@ -822,7 +822,7 @@ void ODatabaseMetaDataResultSet::openTypeInfo()
|
||||
}
|
||||
|
||||
void ODatabaseMetaDataResultSet::openTables(const Any& catalog, const OUString& schemaPattern,
|
||||
const OUString& tableNamePattern,
|
||||
std::u16string_view tableNamePattern,
|
||||
const Sequence< OUString >& types )
|
||||
{
|
||||
OString aPKQ,aPKO,aPKN,aCOL;
|
||||
@ -919,7 +919,8 @@ void ODatabaseMetaDataResultSet::openSchemas()
|
||||
}
|
||||
|
||||
void ODatabaseMetaDataResultSet::openColumnPrivileges( const Any& catalog, const OUString& schema,
|
||||
const OUString& table, const OUString& columnNamePattern )
|
||||
std::u16string_view table,
|
||||
std::u16string_view columnNamePattern )
|
||||
{
|
||||
const OUString *pSchemaPat = nullptr;
|
||||
|
||||
@ -953,7 +954,7 @@ void ODatabaseMetaDataResultSet::openColumnPrivileges( const Any& catalog, cons
|
||||
}
|
||||
|
||||
void ODatabaseMetaDataResultSet::openColumns( const Any& catalog, const OUString& schemaPattern,
|
||||
const OUString& tableNamePattern, const OUString& columnNamePattern )
|
||||
std::u16string_view tableNamePattern, std::u16string_view columnNamePattern )
|
||||
{
|
||||
const OUString *pSchemaPat = nullptr;
|
||||
|
||||
@ -1020,7 +1021,7 @@ void ODatabaseMetaDataResultSet::openColumns( const Any& catalog,
|
||||
}
|
||||
|
||||
void ODatabaseMetaDataResultSet::openProcedureColumns( const Any& catalog, const OUString& schemaPattern,
|
||||
const OUString& procedureNamePattern,const OUString& columnNamePattern )
|
||||
std::u16string_view procedureNamePattern,std::u16string_view columnNamePattern )
|
||||
{
|
||||
const OUString *pSchemaPat = nullptr;
|
||||
|
||||
@ -1053,7 +1054,7 @@ void ODatabaseMetaDataResultSet::openProcedureColumns( const Any& catalog,
|
||||
}
|
||||
|
||||
void ODatabaseMetaDataResultSet::openProcedures(const Any& catalog, const OUString& schemaPattern,
|
||||
const OUString& procedureNamePattern)
|
||||
std::u16string_view procedureNamePattern)
|
||||
{
|
||||
const OUString *pSchemaPat = nullptr;
|
||||
|
||||
@ -1083,11 +1084,11 @@ void ODatabaseMetaDataResultSet::openProcedures(const Any& catalog, const OUStri
|
||||
}
|
||||
|
||||
void ODatabaseMetaDataResultSet::openSpecialColumns(bool _bRowVer,const Any& catalog, const OUString& schema,
|
||||
const OUString& table,sal_Int32 scope, bool nullable )
|
||||
std::u16string_view table,sal_Int32 scope, bool nullable )
|
||||
{
|
||||
// Some ODBC drivers really don't like getting an empty string as tableName
|
||||
// E.g. psqlodbc up to at least version 09.01.0100 segfaults
|
||||
if (table.isEmpty())
|
||||
if (table.empty())
|
||||
{
|
||||
const char errMsg[] = "ODBC: Trying to get special columns of empty table name";
|
||||
const char SQLState[] = "HY009";
|
||||
@ -1123,13 +1124,13 @@ void ODatabaseMetaDataResultSet::openSpecialColumns(bool _bRowVer,const Any& cat
|
||||
}
|
||||
|
||||
void ODatabaseMetaDataResultSet::openVersionColumns(const Any& catalog, const OUString& schema,
|
||||
const OUString& table)
|
||||
std::u16string_view table)
|
||||
{
|
||||
openSpecialColumns(true,catalog,schema,table,SQL_SCOPE_TRANSACTION,false);
|
||||
}
|
||||
|
||||
void ODatabaseMetaDataResultSet::openBestRowIdentifier( const Any& catalog, const OUString& schema,
|
||||
const OUString& table,sal_Int32 scope,bool nullable )
|
||||
std::u16string_view table,sal_Int32 scope,bool nullable )
|
||||
{
|
||||
openSpecialColumns(false,catalog,schema,table,scope,nullable);
|
||||
}
|
||||
@ -1198,7 +1199,7 @@ void ODatabaseMetaDataResultSet::openExportedKeys(const Any& catalog, const OUSt
|
||||
}
|
||||
|
||||
void ODatabaseMetaDataResultSet::openPrimaryKeys(const Any& catalog, const OUString& schema,
|
||||
const OUString& table)
|
||||
std::u16string_view table)
|
||||
{
|
||||
const OUString *pSchemaPat = nullptr;
|
||||
|
||||
@ -1228,7 +1229,7 @@ void ODatabaseMetaDataResultSet::openPrimaryKeys(const Any& catalog, const OUStr
|
||||
}
|
||||
|
||||
void ODatabaseMetaDataResultSet::openTablePrivileges(const Any& catalog, const OUString& schemaPattern,
|
||||
const OUString& tableNamePattern)
|
||||
std::u16string_view tableNamePattern)
|
||||
{
|
||||
const OUString *pSchemaPat = nullptr;
|
||||
|
||||
@ -1257,7 +1258,7 @@ void ODatabaseMetaDataResultSet::openTablePrivileges(const Any& catalog, const O
|
||||
}
|
||||
|
||||
void ODatabaseMetaDataResultSet::openIndexInfo( const Any& catalog, const OUString& schema,
|
||||
const OUString& table, bool unique, bool approximate )
|
||||
std::u16string_view table, bool unique, bool approximate )
|
||||
{
|
||||
const OUString *pSchemaPat = nullptr;
|
||||
|
||||
|
@ -833,7 +833,7 @@ void OStatement_Base::setMaxFieldSize(sal_Int64 _par0)
|
||||
setStmtOption<SQLULEN, SQL_IS_UINTEGER>(SQL_ATTR_MAX_LENGTH, _par0);
|
||||
}
|
||||
|
||||
void OStatement_Base::setCursorName(const OUString &_par0)
|
||||
void OStatement_Base::setCursorName(std::u16string_view _par0)
|
||||
{
|
||||
OSL_ENSURE(m_aStatementHandle,"StatementHandle is null!");
|
||||
OString aName(OUStringToOString(_par0,getOwnConnection()->getTextEncoding()));
|
||||
|
@ -443,7 +443,7 @@ void Connection::initialize( const Sequence< Any >& aArguments )
|
||||
nColon = url.indexOf( ':' , 1+ nColon );
|
||||
if( nColon != -1 )
|
||||
{
|
||||
o = OUStringToOString( url.copy(nColon+1), ConnectionSettings::encoding );
|
||||
o = OUStringToOString( url.subView(nColon+1), ConnectionSettings::encoding );
|
||||
}
|
||||
}
|
||||
{
|
||||
|
@ -61,6 +61,7 @@
|
||||
#include <com/sun/star/container/XEnumerationAccess.hpp>
|
||||
|
||||
#include <string.h>
|
||||
#include <string_view>
|
||||
|
||||
using osl::MutexGuard;
|
||||
|
||||
@ -239,7 +240,7 @@ sal_Int32 Statement::executeUpdate( const OUString& sql )
|
||||
/// @throws SQLException
|
||||
static void raiseSQLException(
|
||||
const Reference< XInterface> & owner,
|
||||
const OString & sql,
|
||||
std::string_view sql,
|
||||
const char * errorMsg,
|
||||
const char *errorType = nullptr )
|
||||
{
|
||||
|
@ -57,6 +57,7 @@
|
||||
|
||||
#include <libpq-fe.h>
|
||||
#include <string.h>
|
||||
#include <string_view>
|
||||
|
||||
using com::sun::star::beans::XPropertySet;
|
||||
|
||||
@ -91,16 +92,16 @@ OUString concatQualified( const OUString & a, const OUString &b)
|
||||
return a + "." + b;
|
||||
}
|
||||
|
||||
static OString iOUStringToOString( const OUString& str, ConnectionSettings const *settings) {
|
||||
static OString iOUStringToOString( std::u16string_view str, ConnectionSettings const *settings) {
|
||||
OSL_ENSURE(settings, "pgsql-sdbc: OUStringToOString got NULL settings");
|
||||
return OUStringToOString( str, ConnectionSettings::encoding );
|
||||
return rtl::OUStringToOString( str, ConnectionSettings::encoding );
|
||||
}
|
||||
|
||||
OString OUStringToOString( const OUString& str, ConnectionSettings const *settings) {
|
||||
OString OUStringToOString( std::u16string_view str, ConnectionSettings const *settings) {
|
||||
return iOUStringToOString( str, settings );
|
||||
}
|
||||
|
||||
void bufferEscapeConstant( OUStringBuffer & buf, const OUString & value, ConnectionSettings *settings )
|
||||
void bufferEscapeConstant( OUStringBuffer & buf, std::u16string_view value, ConnectionSettings *settings )
|
||||
{
|
||||
|
||||
OString y = iOUStringToOString( value, settings );
|
||||
@ -127,14 +128,14 @@ void bufferEscapeConstant( OUStringBuffer & buf, const OUString & value, Connect
|
||||
buf.append( OStringToOUString( strbuf.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ) );
|
||||
}
|
||||
|
||||
static void ibufferQuoteConstant( OUStringBuffer & buf, const OUString & value, ConnectionSettings *settings )
|
||||
static void ibufferQuoteConstant( OUStringBuffer & buf, std::u16string_view value, ConnectionSettings *settings )
|
||||
{
|
||||
buf.append( "'" );
|
||||
bufferEscapeConstant( buf, value, settings );
|
||||
buf.append( "'" );
|
||||
}
|
||||
|
||||
void bufferQuoteConstant( OUStringBuffer & buf, const OUString & value, ConnectionSettings *settings )
|
||||
void bufferQuoteConstant( OUStringBuffer & buf, std::u16string_view value, ConnectionSettings *settings )
|
||||
{
|
||||
return ibufferQuoteConstant( buf, value, settings );
|
||||
}
|
||||
@ -151,7 +152,7 @@ void bufferQuoteAnyConstant( OUStringBuffer & buf, const Any &val, ConnectionSet
|
||||
buf.append( "NULL" );
|
||||
}
|
||||
|
||||
static void ibufferQuoteIdentifier( OUStringBuffer & buf, const OUString &toQuote, ConnectionSettings *settings )
|
||||
static void ibufferQuoteIdentifier( OUStringBuffer & buf, std::u16string_view toQuote, ConnectionSettings *settings )
|
||||
{
|
||||
OSL_ENSURE(settings, "pgsql-sdbc: bufferQuoteIdentifier got NULL settings");
|
||||
|
||||
@ -171,14 +172,14 @@ static void ibufferQuoteIdentifier( OUStringBuffer & buf, const OUString &toQuot
|
||||
PQfreemem( cstr );
|
||||
}
|
||||
|
||||
void bufferQuoteIdentifier( OUStringBuffer & buf, const OUString &toQuote, ConnectionSettings *settings )
|
||||
void bufferQuoteIdentifier( OUStringBuffer & buf, std::u16string_view toQuote, ConnectionSettings *settings )
|
||||
{
|
||||
return ibufferQuoteIdentifier(buf, toQuote, settings);
|
||||
}
|
||||
|
||||
|
||||
void bufferQuoteQualifiedIdentifier(
|
||||
OUStringBuffer & buf, const OUString &schema, const OUString &table, ConnectionSettings *settings )
|
||||
OUStringBuffer & buf, std::u16string_view schema, std::u16string_view table, ConnectionSettings *settings )
|
||||
{
|
||||
ibufferQuoteIdentifier(buf, schema, settings);
|
||||
buf.append( "." );
|
||||
@ -187,9 +188,9 @@ void bufferQuoteQualifiedIdentifier(
|
||||
|
||||
void bufferQuoteQualifiedIdentifier(
|
||||
OUStringBuffer & buf,
|
||||
const OUString &schema,
|
||||
const OUString &table,
|
||||
const OUString &col,
|
||||
std::u16string_view schema,
|
||||
std::u16string_view table,
|
||||
std::u16string_view col,
|
||||
ConnectionSettings *settings)
|
||||
{
|
||||
ibufferQuoteIdentifier(buf, schema, settings);
|
||||
@ -544,10 +545,10 @@ void tokenizeSQL( const OString & sql, std::vector< OString > &vec )
|
||||
}
|
||||
|
||||
|
||||
void splitConcatenatedIdentifier( const OUString & source, OUString *first, OUString *second)
|
||||
void splitConcatenatedIdentifier( std::u16string_view source, OUString *first, OUString *second)
|
||||
{
|
||||
std::vector< OString > vec;
|
||||
tokenizeSQL( OUStringToOString( source, RTL_TEXTENCODING_UTF8 ), vec );
|
||||
tokenizeSQL( rtl::OUStringToOString( source, RTL_TEXTENCODING_UTF8 ), vec );
|
||||
switch (vec.size())
|
||||
{
|
||||
case 1:
|
||||
|
@ -57,28 +57,28 @@ bool isWhitespace( sal_Unicode c );
|
||||
|
||||
OUString concatQualified( const OUString & a, const OUString &b);
|
||||
|
||||
OString OUStringToOString( const OUString& str, ConnectionSettings const *settings);
|
||||
OString OUStringToOString( std::u16string_view str, ConnectionSettings const *settings);
|
||||
|
||||
void bufferQuoteConstant( OUStringBuffer & buf, const OUString & str, ConnectionSettings *settings );
|
||||
void bufferQuoteConstant( OUStringBuffer & buf, std::u16string_view str, ConnectionSettings *settings );
|
||||
void bufferQuoteAnyConstant( OUStringBuffer & buf, const css::uno::Any &val, ConnectionSettings *settings );
|
||||
|
||||
void bufferEscapeConstant( OUStringBuffer & buf, const OUString & str, ConnectionSettings *settings );
|
||||
void bufferEscapeConstant( OUStringBuffer & buf, std::u16string_view str, ConnectionSettings *settings );
|
||||
|
||||
OUString sqltype2string(
|
||||
const css::uno::Reference< css::beans::XPropertySet > & column );
|
||||
|
||||
|
||||
void bufferQuoteQualifiedIdentifier(
|
||||
OUStringBuffer & buf, const OUString &schema, const OUString &name, ConnectionSettings *settings );
|
||||
OUStringBuffer & buf, std::u16string_view schema, std::u16string_view name, ConnectionSettings *settings );
|
||||
|
||||
void bufferQuoteQualifiedIdentifier(
|
||||
OUStringBuffer & buf,
|
||||
const OUString &schema,
|
||||
const OUString &name,
|
||||
const OUString &col,
|
||||
std::u16string_view schema,
|
||||
std::u16string_view name,
|
||||
std::u16string_view col,
|
||||
ConnectionSettings *settings );
|
||||
|
||||
void bufferQuoteIdentifier( OUStringBuffer & buf, const OUString &toQuote, ConnectionSettings *settings );
|
||||
void bufferQuoteIdentifier( OUStringBuffer & buf, std::u16string_view toQuote, ConnectionSettings *settings );
|
||||
void bufferKey2TableConstraint(
|
||||
OUStringBuffer &buf,
|
||||
const css::uno::Reference< css::beans::XPropertySet > &key,
|
||||
@ -115,7 +115,7 @@ OUString array2String( const css::uno::Sequence< css::uno::Any > &seq );
|
||||
css::uno::Reference< css::sdbc::XConnection > extractConnectionFromStatement(
|
||||
const css::uno::Reference< css::uno::XInterface > & stmt );
|
||||
|
||||
void splitConcatenatedIdentifier( const OUString & source, OUString *first, OUString *second);
|
||||
void splitConcatenatedIdentifier( std::u16string_view source, OUString *first, OUString *second);
|
||||
|
||||
|
||||
void fillAttnum2attnameMap(
|
||||
|
@ -328,8 +328,8 @@ void Columns::refresh()
|
||||
|
||||
|
||||
void alterColumnByDescriptor(
|
||||
const OUString & schemaName,
|
||||
const OUString & tableName,
|
||||
std::u16string_view schemaName,
|
||||
std::u16string_view tableName,
|
||||
ConnectionSettings *settings,
|
||||
const Reference< XStatement > &stmt,
|
||||
const css::uno::Reference< css::beans::XPropertySet > & past,
|
||||
|
@ -37,6 +37,10 @@
|
||||
#ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_POSTGRESQL_PQ_XCOLUMNS_HXX
|
||||
#define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_POSTGRESQL_PQ_XCOLUMNS_HXX
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include "pq_xcontainer.hxx"
|
||||
#include "pq_xbase.hxx"
|
||||
|
||||
@ -46,8 +50,8 @@ namespace pq_sdbc_driver
|
||||
{
|
||||
|
||||
void alterColumnByDescriptor(
|
||||
const OUString & schemaName,
|
||||
const OUString & tableName,
|
||||
std::u16string_view schemaName,
|
||||
std::u16string_view tableName,
|
||||
ConnectionSettings *settings,
|
||||
const css::uno::Reference< css::sdbc::XStatement > &stmt,
|
||||
const css::uno::Reference< css::beans::XPropertySet > & past,
|
||||
|
@ -21,6 +21,10 @@
|
||||
|
||||
//************ Class: java.lang.Class
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include <java/lang/Object.hxx>
|
||||
|
||||
namespace connectivity
|
||||
@ -36,7 +40,7 @@ namespace connectivity
|
||||
// a Constructor, that is needed for when Returning the Object is needed:
|
||||
java_lang_Class( JNIEnv * pEnv, jobject myObj ) : java_lang_Object( pEnv, myObj ){}
|
||||
|
||||
static java_lang_Class * forName( const OUString &_par0 );
|
||||
static java_lang_Class * forName( std::u16string_view _par0 );
|
||||
// return the jre object
|
||||
jobject newInstanceObject();
|
||||
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include <odbc/ODatabaseMetaData.hxx>
|
||||
#include <odbc/odbcbasedllapi.hxx>
|
||||
#include <memory>
|
||||
#include <string_view>
|
||||
|
||||
namespace connectivity::odbc
|
||||
{
|
||||
@ -199,31 +200,31 @@ namespace connectivity::odbc
|
||||
/// @throws css::sdbc::SQLException
|
||||
/// @throws css::uno::RuntimeException
|
||||
void openTables(const css::uno::Any& catalog, const OUString& schemaPattern,
|
||||
const OUString& tableNamePattern, const css::uno::Sequence< OUString >& types );
|
||||
std::u16string_view tableNamePattern, const css::uno::Sequence< OUString >& types );
|
||||
/// @throws css::sdbc::SQLException
|
||||
/// @throws css::uno::RuntimeException
|
||||
void openColumnPrivileges( const css::uno::Any& catalog, const OUString& schema,
|
||||
const OUString& table, const OUString& columnNamePattern );
|
||||
std::u16string_view table, std::u16string_view columnNamePattern );
|
||||
/// @throws css::sdbc::SQLException
|
||||
/// @throws css::uno::RuntimeException
|
||||
void openColumns( const css::uno::Any& catalog, const OUString& schemaPattern,
|
||||
const OUString& tableNamePattern, const OUString& columnNamePattern );
|
||||
std::u16string_view tableNamePattern, std::u16string_view columnNamePattern );
|
||||
/// @throws css::sdbc::SQLException
|
||||
/// @throws css::uno::RuntimeException
|
||||
void openProcedureColumns( const css::uno::Any& catalog, const OUString& schemaPattern,
|
||||
const OUString& procedureNamePattern,const OUString& columnNamePattern );
|
||||
std::u16string_view procedureNamePattern,std::u16string_view columnNamePattern );
|
||||
/// @throws css::sdbc::SQLException
|
||||
/// @throws css::uno::RuntimeException
|
||||
void openProcedures( const css::uno::Any& catalog, const OUString& schemaPattern,
|
||||
const OUString& procedureNamePattern);
|
||||
std::u16string_view procedureNamePattern);
|
||||
/// @throws css::sdbc::SQLException
|
||||
/// @throws css::uno::RuntimeException
|
||||
void openVersionColumns(const css::uno::Any& catalog, const OUString& schema,
|
||||
const OUString& table);
|
||||
std::u16string_view table);
|
||||
/// @throws css::sdbc::SQLException
|
||||
/// @throws css::uno::RuntimeException
|
||||
void openBestRowIdentifier( const css::uno::Any& catalog, const OUString& schema,
|
||||
const OUString& table,sal_Int32 scope, bool nullable );
|
||||
std::u16string_view table,sal_Int32 scope, bool nullable );
|
||||
/// @throws css::sdbc::SQLException
|
||||
/// @throws css::uno::RuntimeException
|
||||
void openForeignKeys( const css::uno::Any& catalog, const OUString* schema,const OUString* table,
|
||||
@ -236,19 +237,19 @@ namespace connectivity::odbc
|
||||
void openImportedKeys(const css::uno::Any& catalog, const OUString& schema,const OUString& table);
|
||||
/// @throws css::sdbc::SQLException
|
||||
/// @throws css::uno::RuntimeException
|
||||
void openPrimaryKeys(const css::uno::Any& catalog, const OUString& schema,const OUString& table);
|
||||
void openPrimaryKeys(const css::uno::Any& catalog, const OUString& schema,std::u16string_view table);
|
||||
/// @throws css::sdbc::SQLException
|
||||
/// @throws css::uno::RuntimeException
|
||||
void openTablePrivileges(const css::uno::Any& catalog, const OUString& schemaPattern,
|
||||
const OUString& tableNamePattern);
|
||||
std::u16string_view tableNamePattern);
|
||||
/// @throws css::sdbc::SQLException
|
||||
/// @throws css::uno::RuntimeException
|
||||
void openSpecialColumns(bool _bRowVer,const css::uno::Any& catalog, const OUString& schema,
|
||||
const OUString& table,sal_Int32 scope, bool nullable );
|
||||
std::u16string_view table,sal_Int32 scope, bool nullable );
|
||||
/// @throws css::sdbc::SQLException
|
||||
/// @throws css::uno::RuntimeException
|
||||
void openIndexInfo( const css::uno::Any& catalog, const OUString& schema,
|
||||
const OUString& table,bool unique,bool approximate );
|
||||
std::u16string_view table,bool unique,bool approximate );
|
||||
|
||||
protected:
|
||||
using OPropertySetHelper::getFastPropertyValue;
|
||||
|
@ -35,6 +35,7 @@
|
||||
#include <odbc/OFunctions.hxx>
|
||||
#include <odbc/OConnection.hxx>
|
||||
#include <odbc/odbcbasedllapi.hxx>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
#include <com/sun/star/lang/XServiceInfo.hpp>
|
||||
|
||||
@ -91,7 +92,7 @@ namespace connectivity::odbc
|
||||
void setMaxRows(sal_Int64 _par0) ;
|
||||
void setFetchDirection(sal_Int32 _par0) ;
|
||||
void setFetchSize(sal_Int32 _par0) ;
|
||||
void setCursorName(const OUString &_par0);
|
||||
void setCursorName(std::u16string_view _par0);
|
||||
void setEscapeProcessing( const bool _bEscapeProc );
|
||||
template < typename T, SQLINTEGER BufferLength > SQLRETURN setStmtOption (SQLINTEGER fOption, T value) const;
|
||||
|
||||
|
@ -33,7 +33,7 @@ OSQLInternalNode::OSQLInternalNode(const char* pNewValue,
|
||||
}
|
||||
|
||||
|
||||
OSQLInternalNode::OSQLInternalNode(const OString &NewValue,
|
||||
OSQLInternalNode::OSQLInternalNode(std::string_view NewValue,
|
||||
SQLNodeType eNodeType,
|
||||
sal_uInt32 nNodeID)
|
||||
:OSQLParseNode(NewValue,eNodeType,nNodeID)
|
||||
|
@ -1599,7 +1599,7 @@ OSQLParseNode::OSQLParseNode(const char * pNewValue,
|
||||
OSL_ENSURE(m_eNodeType >= SQLNodeType::Rule && m_eNodeType <= SQLNodeType::Concat,"OSQLParseNode: created with invalid NodeType");
|
||||
}
|
||||
|
||||
OSQLParseNode::OSQLParseNode(const OString &_rNewValue,
|
||||
OSQLParseNode::OSQLParseNode(std::string_view _rNewValue,
|
||||
SQLNodeType eNewNodeType,
|
||||
sal_uInt32 nNewNodeID)
|
||||
:m_pParent(nullptr)
|
||||
@ -2508,7 +2508,7 @@ void OSQLParseNode::parseLeaf(OUStringBuffer& rString, const SQLParseNodeParamet
|
||||
}
|
||||
|
||||
|
||||
sal_Int32 OSQLParser::getFunctionReturnType(const OUString& _sFunctionName, const IParseContext* pContext)
|
||||
sal_Int32 OSQLParser::getFunctionReturnType(std::u16string_view _sFunctionName, const IParseContext* pContext)
|
||||
{
|
||||
sal_Int32 nType = DataType::VARCHAR;
|
||||
OString sFunctionName(OUStringToOString(_sFunctionName,RTL_TEXTENCODING_UTF8));
|
||||
|
@ -199,7 +199,8 @@ static void LogProbe(
|
||||
{
|
||||
OString sTemp;
|
||||
if ( pMemberType && pMemberType->pTypeName )
|
||||
sTemp = OUStringToOString(pMemberType->pTypeName,RTL_TEXTENCODING_ASCII_US);
|
||||
sTemp = OUStringToOString(
|
||||
OUString::unacquired(&pMemberType->pTypeName),RTL_TEXTENCODING_ASCII_US);
|
||||
if ( pre )
|
||||
{
|
||||
SAL_INFO("cppu.log", "{ LogBridge () " << sTemp );
|
||||
|
@ -279,7 +279,7 @@ TypeDescriptor_Init_Impl::~TypeDescriptor_Init_Impl()
|
||||
typelib_TypeDescriptionReference * pTDR = rEntry.second;
|
||||
if (pTDR)
|
||||
{
|
||||
OString aTypeName( OUStringToOString( pTDR->pTypeName, RTL_TEXTENCODING_ASCII_US ) );
|
||||
OString aTypeName( OUStringToOString( OUString::unacquired(&pTDR->pTypeName), RTL_TEXTENCODING_ASCII_US ) );
|
||||
SAL_INFO("cppu.typelib", "remaining type: " << aTypeName << "; ref count = " << pTDR->nRefCount);
|
||||
}
|
||||
else
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include "prim.hxx"
|
||||
#include "loadmodule.hxx"
|
||||
|
||||
#include <string_view>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
#include <stdio.h>
|
||||
@ -672,7 +673,7 @@ void writeLine(
|
||||
|
||||
|
||||
void writeLine(
|
||||
void * stream, const OUString & rLine, const char * pFilter )
|
||||
void * stream, std::u16string_view rLine, const char * pFilter )
|
||||
{
|
||||
OString aLine( OUStringToOString(
|
||||
rLine, RTL_TEXTENCODING_ASCII_US ) );
|
||||
@ -777,7 +778,8 @@ extern "C" void SAL_CALL uno_dumpEnvironmentByName(
|
||||
else
|
||||
{
|
||||
writeLine(
|
||||
stream, "environment \"" + OUString::unacquired(&pEnvDcp) + "\" does not exist!",
|
||||
stream,
|
||||
OUString("environment \"" + OUString::unacquired(&pEnvDcp) + "\" does not exist!"),
|
||||
pFilter );
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string_view>
|
||||
|
||||
#include <sal/main.h>
|
||||
#include <sal/log.hxx>
|
||||
@ -68,7 +69,7 @@ static void out( const char * pText )
|
||||
fprintf( stderr, "%s", pText );
|
||||
}
|
||||
|
||||
static void out( const OUString & rText )
|
||||
static void out( std::u16string_view rText )
|
||||
{
|
||||
if (! s_quiet)
|
||||
{
|
||||
|
@ -7,6 +7,11 @@
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include <config_folders.h>
|
||||
|
||||
#include <AdditionsDialog.hxx>
|
||||
@ -142,54 +147,61 @@ void parseResponse(const std::string& rResponse, std::vector<AdditionInfo>& aAdd
|
||||
try
|
||||
{
|
||||
AdditionInfo aNewAddition = {
|
||||
OStringToOUString(OString(arrayElement.child("id").string_value().get()),
|
||||
OStringToOUString(std::string_view(arrayElement.child("id").string_value().get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(OString(arrayElement.child("name").string_value().get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(OString(arrayElement.child("author").string_value().get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(OString(arrayElement.child("url").string_value().get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(OString(arrayElement.child("screenshotURL").string_value().get()),
|
||||
OStringToOUString(std::string_view(arrayElement.child("name").string_value().get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(
|
||||
OString(arrayElement.child("extensionIntroduction").string_value().get()),
|
||||
std::string_view(arrayElement.child("author").string_value().get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(
|
||||
OString(arrayElement.child("extensionDescription").string_value().get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(OString(arrayElement.child("releases")
|
||||
.child(0)
|
||||
.child("compatibility")
|
||||
.string_value()
|
||||
.get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(OString(arrayElement.child("releases")
|
||||
.child(0)
|
||||
.child("releaseName")
|
||||
.string_value()
|
||||
.get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(OString(arrayElement.child("releases")
|
||||
.child(0)
|
||||
.child("license")
|
||||
.string_value()
|
||||
.get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(OString(arrayElement.child("commentNumber").string_value().get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(OString(arrayElement.child("commentURL").string_value().get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(OString(arrayElement.child("rating").string_value().get()),
|
||||
OStringToOUString(std::string_view(arrayElement.child("url").string_value().get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(
|
||||
OString(arrayElement.child("downloadNumber").string_value().get()),
|
||||
std::string_view(arrayElement.child("screenshotURL").string_value().get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(OString(arrayElement.child("releases")
|
||||
.child(0)
|
||||
.child("downloadURL")
|
||||
.string_value()
|
||||
.get()),
|
||||
OStringToOUString(
|
||||
std::string_view(
|
||||
arrayElement.child("extensionIntroduction").string_value().get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(
|
||||
std::string_view(
|
||||
arrayElement.child("extensionDescription").string_value().get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(std::string_view(arrayElement.child("releases")
|
||||
.child(0)
|
||||
.child("compatibility")
|
||||
.string_value()
|
||||
.get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(std::string_view(arrayElement.child("releases")
|
||||
.child(0)
|
||||
.child("releaseName")
|
||||
.string_value()
|
||||
.get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(std::string_view(arrayElement.child("releases")
|
||||
.child(0)
|
||||
.child("license")
|
||||
.string_value()
|
||||
.get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(
|
||||
std::string_view(arrayElement.child("commentNumber").string_value().get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(
|
||||
std::string_view(arrayElement.child("commentURL").string_value().get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(
|
||||
std::string_view(arrayElement.child("rating").string_value().get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(
|
||||
std::string_view(arrayElement.child("downloadNumber").string_value().get()),
|
||||
RTL_TEXTENCODING_UTF8),
|
||||
OStringToOUString(std::string_view(arrayElement.child("releases")
|
||||
.child(0)
|
||||
.child("downloadURL")
|
||||
.string_value()
|
||||
.get()),
|
||||
RTL_TEXTENCODING_UTF8)
|
||||
};
|
||||
|
||||
|
@ -47,7 +47,9 @@ utl::TempFile DBTestBase::createTempCopy(OUString const & pathname) {
|
||||
tmp.EnableKillingFile();
|
||||
auto const e = osl::File::copy(url, tmp.GetURL());
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE(
|
||||
(OUStringToOString("<" + url + "> -> <" + tmp.GetURL() + ">", RTL_TEXTENCODING_UTF8)
|
||||
(OString(
|
||||
"<" + OUStringToOString(url, RTL_TEXTENCODING_UTF8) + "> -> <"
|
||||
+ OUStringToOString(tmp.GetURL(), RTL_TEXTENCODING_UTF8) + ">")
|
||||
.getStr()),
|
||||
osl::FileBase::E_None, e);
|
||||
return tmp;
|
||||
|
@ -72,7 +72,7 @@ ODsnTypeCollection::~ODsnTypeCollection()
|
||||
#endif
|
||||
}
|
||||
|
||||
OUString ODsnTypeCollection::getTypeDisplayName(const OUString& _sURL) const
|
||||
OUString ODsnTypeCollection::getTypeDisplayName(std::u16string_view _sURL) const
|
||||
{
|
||||
return m_aDriverConfig.getDriverTypeDisplayName(_sURL);
|
||||
}
|
||||
@ -130,7 +130,7 @@ bool ODsnTypeCollection::hasDriver( const char* _pAsciiPattern ) const
|
||||
return !sPrefix.isEmpty();
|
||||
}
|
||||
|
||||
bool ODsnTypeCollection::isConnectionUrlRequired(const OUString& _sURL) const
|
||||
bool ODsnTypeCollection::isConnectionUrlRequired(std::u16string_view _sURL) const
|
||||
{
|
||||
OUString sRet;
|
||||
OUString sOldPattern;
|
||||
@ -146,7 +146,7 @@ bool ODsnTypeCollection::isConnectionUrlRequired(const OUString& _sURL) const
|
||||
return !sRet.isEmpty() && sRet[sRet.getLength()-1] == '*';
|
||||
}
|
||||
|
||||
OUString ODsnTypeCollection::getMediaType(const OUString& _sURL) const
|
||||
OUString ODsnTypeCollection::getMediaType(std::u16string_view _sURL) const
|
||||
{
|
||||
const ::comphelper::NamedValueCollection& aFeatures = m_aDriverConfig.getMetaData(_sURL);
|
||||
return aFeatures.getOrDefault("MediaType",OUString());
|
||||
@ -236,43 +236,43 @@ void ODsnTypeCollection::extractHostNamePort(const OUString& _rDsn,OUString& _sD
|
||||
}
|
||||
}
|
||||
|
||||
OUString ODsnTypeCollection::getJavaDriverClass(const OUString& _sURL) const
|
||||
OUString ODsnTypeCollection::getJavaDriverClass(std::u16string_view _sURL) const
|
||||
{
|
||||
const ::comphelper::NamedValueCollection& aFeatures = m_aDriverConfig.getProperties(_sURL);
|
||||
return aFeatures.getOrDefault("JavaDriverClass",OUString());
|
||||
}
|
||||
|
||||
bool ODsnTypeCollection::isFileSystemBased(const OUString& _sURL) const
|
||||
bool ODsnTypeCollection::isFileSystemBased(std::u16string_view _sURL) const
|
||||
{
|
||||
const ::comphelper::NamedValueCollection& aFeatures = m_aDriverConfig.getMetaData(_sURL);
|
||||
return aFeatures.getOrDefault("FileSystemBased",false);
|
||||
}
|
||||
|
||||
bool ODsnTypeCollection::supportsTableCreation(const OUString& _sURL) const
|
||||
bool ODsnTypeCollection::supportsTableCreation(std::u16string_view _sURL) const
|
||||
{
|
||||
const ::comphelper::NamedValueCollection& aFeatures = m_aDriverConfig.getMetaData(_sURL);
|
||||
return aFeatures.getOrDefault("SupportsTableCreation",false);
|
||||
}
|
||||
|
||||
bool ODsnTypeCollection::supportsColumnDescription(const OUString& _sURL) const
|
||||
bool ODsnTypeCollection::supportsColumnDescription(std::u16string_view _sURL) const
|
||||
{
|
||||
const ::comphelper::NamedValueCollection& aFeatures = m_aDriverConfig.getMetaData(_sURL);
|
||||
return aFeatures.getOrDefault("SupportsColumnDescription",false);
|
||||
}
|
||||
|
||||
bool ODsnTypeCollection::supportsBrowsing(const OUString& _sURL) const
|
||||
bool ODsnTypeCollection::supportsBrowsing(std::u16string_view _sURL) const
|
||||
{
|
||||
const ::comphelper::NamedValueCollection& aFeatures = m_aDriverConfig.getMetaData(_sURL);
|
||||
return aFeatures.getOrDefault("SupportsBrowsing",false);
|
||||
}
|
||||
|
||||
bool ODsnTypeCollection::supportsDBCreation(const OUString& _sURL) const
|
||||
bool ODsnTypeCollection::supportsDBCreation(std::u16string_view _sURL) const
|
||||
{
|
||||
const ::comphelper::NamedValueCollection& aFeatures = m_aDriverConfig.getMetaData(_sURL);
|
||||
return aFeatures.getOrDefault("SupportsDBCreation",false);
|
||||
}
|
||||
|
||||
Sequence<PropertyValue> ODsnTypeCollection::getDefaultDBSettings( const OUString& _sURL ) const
|
||||
Sequence<PropertyValue> ODsnTypeCollection::getDefaultDBSettings( std::u16string_view _sURL ) const
|
||||
{
|
||||
const ::comphelper::NamedValueCollection& aProperties = m_aDriverConfig.getProperties(_sURL);
|
||||
return aProperties.getPropertyValues();
|
||||
@ -467,7 +467,7 @@ void ODsnTypeCollection::fillPageIds(const OUString& _sURL,std::vector<sal_Int16
|
||||
}
|
||||
}
|
||||
|
||||
OUString ODsnTypeCollection::getType(const OUString& _sURL) const
|
||||
OUString ODsnTypeCollection::getType(std::u16string_view _sURL) const
|
||||
{
|
||||
OUString sOldPattern;
|
||||
for (auto const& dsnPrefix : m_aDsnPrefixes)
|
||||
@ -481,7 +481,7 @@ OUString ODsnTypeCollection::getType(const OUString& _sURL) const
|
||||
return sOldPattern;
|
||||
}
|
||||
|
||||
sal_Int32 ODsnTypeCollection::getIndexOf(const OUString& _sURL) const
|
||||
sal_Int32 ODsnTypeCollection::getIndexOf(std::u16string_view _sURL) const
|
||||
{
|
||||
sal_Int32 nRet = -1;
|
||||
OUString sOldPattern;
|
||||
|
@ -17,6 +17,10 @@
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
*/
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include "rowinputbinary.hxx"
|
||||
#include <com/sun/star/sdbc/DataType.hpp>
|
||||
#include <com/sun/star/io/WrongFormatException.hpp>
|
||||
@ -82,7 +86,8 @@ OUString lcl_double_dabble(const std::vector<sal_uInt8>& bytes)
|
||||
digit += '0';
|
||||
|
||||
/* Resize and return the resulting string. */
|
||||
return OStringToOUString(OString(scratch.data(), scratch.size()), RTL_TEXTENCODING_UTF8);
|
||||
return OStringToOUString(std::string_view(scratch.data(), scratch.size()),
|
||||
RTL_TEXTENCODING_UTF8);
|
||||
}
|
||||
|
||||
OUString lcl_makeStringFromBigint(const std::vector<sal_uInt8>& bytes)
|
||||
|
@ -51,7 +51,7 @@ int getHexValue(sal_Unicode c)
|
||||
} // unnamed namespace
|
||||
|
||||
//Convert ascii escaped unicode to utf-8
|
||||
OUString utils::convertToUTF8(const OString& original)
|
||||
OUString utils::convertToUTF8(std::string_view original)
|
||||
{
|
||||
OUString res = OStringToOUString(original, RTL_TEXTENCODING_UTF8);
|
||||
for (sal_Int32 i = 0;;)
|
||||
|
@ -9,11 +9,15 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include <rtl/ustring.hxx>
|
||||
|
||||
namespace dbahsql::utils
|
||||
{
|
||||
OUString convertToUTF8(const OString& original);
|
||||
OUString convertToUTF8(std::string_view original);
|
||||
|
||||
OUString getTableNameFromStmt(const OUString& sSql);
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include <dbadllapi.hxx>
|
||||
@ -117,7 +118,7 @@ public:
|
||||
~ODsnTypeCollection();
|
||||
|
||||
/// get the datasource type display name from a DSN string
|
||||
OUString getTypeDisplayName(const OUString& _sURL) const;
|
||||
OUString getTypeDisplayName(std::u16string_view _sURL) const;
|
||||
|
||||
/// on a given string, cut the type prefix and return the result
|
||||
OUString cutPrefix(const OUString& _sURL) const;
|
||||
@ -129,10 +130,10 @@ public:
|
||||
bool hasDriver( const char* _pAsciiPattern ) const;
|
||||
|
||||
/// on a given string, return the Java Driver Class
|
||||
OUString getJavaDriverClass(const OUString& _sURL) const;
|
||||
OUString getJavaDriverClass(std::u16string_view _sURL) const;
|
||||
|
||||
/// returns the media type of a file based database
|
||||
OUString getMediaType(const OUString& _sURL) const;
|
||||
OUString getMediaType(std::u16string_view _sURL) const;
|
||||
|
||||
/// returns the dsn prefix for a given media type
|
||||
OUString getDatasourcePrefixFromMediaType(std::u16string_view _sMediaType, std::u16string_view _sExtension );
|
||||
@ -140,21 +141,21 @@ public:
|
||||
void extractHostNamePort(const OUString& _rDsn,OUString& _sDatabaseName,OUString& _rHostname,sal_Int32& _nPortNumber) const;
|
||||
|
||||
/// check if the given data source allows creation of tables
|
||||
bool supportsTableCreation(const OUString& _sURL) const;
|
||||
bool supportsTableCreation(std::u16string_view _sURL) const;
|
||||
|
||||
/// check if the given data source allows to show column description.
|
||||
bool supportsColumnDescription(const OUString& _sURL) const;
|
||||
bool supportsColumnDescription(std::u16string_view _sURL) const;
|
||||
|
||||
// check if a Browse button may be shown to insert connection url
|
||||
bool supportsBrowsing(const OUString& _sURL) const;
|
||||
bool supportsBrowsing(std::u16string_view _sURL) const;
|
||||
|
||||
// check if a Create New Database button may be shown to insert connection url
|
||||
bool supportsDBCreation(const OUString& _sURL) const;
|
||||
bool supportsDBCreation(std::u16string_view _sURL) const;
|
||||
|
||||
/// check if the given data source type is based on the file system - i.e. the URL is a prefix plus a file URL
|
||||
bool isFileSystemBased(const OUString& _sURL) const;
|
||||
bool isFileSystemBased(std::u16string_view _sURL) const;
|
||||
|
||||
bool isConnectionUrlRequired(const OUString& _sURL) const;
|
||||
bool isConnectionUrlRequired(std::u16string_view _sURL) const;
|
||||
|
||||
/// checks if the given data source type embeds its data into the database document
|
||||
static bool isEmbeddedDatabase( const OUString& _sURL );
|
||||
@ -167,7 +168,7 @@ public:
|
||||
/** returns default settings for newly created databases of the given type.
|
||||
*/
|
||||
css::uno::Sequence< css::beans::PropertyValue>
|
||||
getDefaultDBSettings( const OUString& _sURL ) const;
|
||||
getDefaultDBSettings( std::u16string_view _sURL ) const;
|
||||
|
||||
/// get access to the first element of the types collection
|
||||
inline TypeIterator begin() const;
|
||||
@ -178,9 +179,9 @@ public:
|
||||
|
||||
DATASOURCE_TYPE determineType(const OUString& _rDsn) const;
|
||||
|
||||
sal_Int32 getIndexOf(const OUString& _sURL) const;
|
||||
sal_Int32 getIndexOf(std::u16string_view _sURL) const;
|
||||
sal_Int32 size() const;
|
||||
OUString getType(const OUString& _sURL) const;
|
||||
OUString getType(std::u16string_view _sURL) const;
|
||||
};
|
||||
|
||||
//- ODsnTypeCollection::TypeIterator
|
||||
|
@ -293,7 +293,7 @@ void ODbTypeWizDialogSetup::activateDatabasePath()
|
||||
{
|
||||
sal_Int32 nCreateNewDBIndex = m_pCollection->getIndexOf( m_pGeneralPage->GetSelectedType() );
|
||||
if ( nCreateNewDBIndex == -1 )
|
||||
nCreateNewDBIndex = m_pCollection->getIndexOf( "sdbc:dbase:" );
|
||||
nCreateNewDBIndex = m_pCollection->getIndexOf( u"sdbc:dbase:" );
|
||||
OSL_ENSURE( nCreateNewDBIndex != -1, "ODbTypeWizDialogSetup::activateDatabasePath: the GeneralPage should have prevented this!" );
|
||||
activatePath( static_cast< PathId >( nCreateNewDBIndex + 1 ), true );
|
||||
|
||||
|
@ -461,7 +461,7 @@ namespace dbaui
|
||||
// If no driver for embedded DBs is installed, and no dBase driver, then hide the "Create new database" option
|
||||
sal_Int32 nCreateNewDBIndex = m_pCollection->getIndexOf( dbaccess::ODsnTypeCollection::getEmbeddedDatabase() );
|
||||
if ( nCreateNewDBIndex == -1 )
|
||||
nCreateNewDBIndex = m_pCollection->getIndexOf( "sdbc:dbase:" );
|
||||
nCreateNewDBIndex = m_pCollection->getIndexOf( u"sdbc:dbase:" );
|
||||
bool bHideCreateNew = ( nCreateNewDBIndex == -1 );
|
||||
|
||||
// also, if our application policies tell us to hide the option, do it
|
||||
@ -551,7 +551,7 @@ namespace dbaui
|
||||
// Sets the default selected database on startup.
|
||||
if (m_xRB_CreateDatabase->get_active() )
|
||||
{
|
||||
return m_pCollection->getTypeDisplayName( "sdbc:firebird:" );
|
||||
return m_pCollection->getTypeDisplayName( u"sdbc:firebird:" );
|
||||
}
|
||||
|
||||
return OGeneralPage::getDatasourceName( _rSet );
|
||||
|
@ -19,6 +19,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include <osl/mutex.hxx>
|
||||
#include <osl/process.h>
|
||||
#include <com/sun/star/uno/XComponentContext.hpp>
|
||||
@ -106,13 +110,13 @@ oslProcess raiseProcess( OUString const & appURL,
|
||||
as target encoding.
|
||||
*/
|
||||
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
|
||||
void writeConsole(OUString const & sText);
|
||||
void writeConsole(std::u16string_view sText);
|
||||
|
||||
/** writes the argument to the console using the error stream.
|
||||
Otherwise the same as writeConsole.
|
||||
*/
|
||||
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
|
||||
void writeConsoleError(OUString const & sText);
|
||||
void writeConsoleError(std::u16string_view sText);
|
||||
|
||||
|
||||
/** reads from the console.
|
||||
|
@ -2084,7 +2084,7 @@ void DesktopLOKTest::testGetFontSubset()
|
||||
rtl_UriEncodeKeepEscapes,
|
||||
RTL_TEXTENCODING_UTF8
|
||||
);
|
||||
OString aCommand = OUStringToOString(".uno:FontSubset&name=" + aFontName, RTL_TEXTENCODING_UTF8);
|
||||
OString aCommand = ".uno:FontSubset&name=" + OUStringToOString(aFontName, RTL_TEXTENCODING_UTF8);
|
||||
boost::property_tree::ptree aTree;
|
||||
char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, aCommand.getStr());
|
||||
std::stringstream aStream(pJSON);
|
||||
|
@ -61,6 +61,7 @@
|
||||
#include <osl/thread.hxx>
|
||||
#include <osl/file.hxx>
|
||||
#include <iostream>
|
||||
#include <string_view>
|
||||
|
||||
using namespace ::osl;
|
||||
using namespace ::com::sun::star::uno;
|
||||
@ -89,7 +90,7 @@ struct DispatchHolder
|
||||
Reference< XDispatch > xDispatch;
|
||||
};
|
||||
|
||||
std::shared_ptr<const SfxFilter> impl_lookupExportFilterForUrl( const OUString& rUrl, const OUString& rFactory )
|
||||
std::shared_ptr<const SfxFilter> impl_lookupExportFilterForUrl( std::u16string_view rUrl, const OUString& rFactory )
|
||||
{
|
||||
// create the list of filters
|
||||
OUStringBuffer sQuery(256);
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
|
||||
#include <osl/diagnose.h>
|
||||
@ -44,11 +45,11 @@ namespace {
|
||||
|
||||
constexpr const char separator[] = "\xff";
|
||||
|
||||
OString oldKey(OUString const & fileName) {
|
||||
OString oldKey(std::u16string_view fileName) {
|
||||
return OUStringToOString(fileName, RTL_TEXTENCODING_UTF8);
|
||||
}
|
||||
|
||||
OString newKey(OUString const & id) {
|
||||
OString newKey(std::u16string_view id) {
|
||||
return separator + OUStringToOString(id, RTL_TEXTENCODING_UTF8);
|
||||
}
|
||||
|
||||
|
@ -455,19 +455,19 @@ Reference<XInterface> resolveUnoURL(
|
||||
return nullptr; // warning C4715
|
||||
}
|
||||
|
||||
static void writeConsoleWithStream(OUString const & sText, FILE * stream)
|
||||
static void writeConsoleWithStream(std::u16string_view sText, FILE * stream)
|
||||
{
|
||||
OString s = OUStringToOString(sText, osl_getThreadTextEncoding());
|
||||
fprintf(stream, "%s", s.getStr());
|
||||
fflush(stream);
|
||||
}
|
||||
|
||||
void writeConsole(OUString const & sText)
|
||||
void writeConsole(std::u16string_view sText)
|
||||
{
|
||||
writeConsoleWithStream(sText, stdout);
|
||||
}
|
||||
|
||||
void writeConsoleError(OUString const & sText)
|
||||
void writeConsoleError(std::u16string_view sText)
|
||||
{
|
||||
writeConsoleWithStream(sText, stderr);
|
||||
}
|
||||
@ -479,7 +479,7 @@ OUString readConsole()
|
||||
// read one char less so that the last char in buf is always zero
|
||||
if (fgets(buf, 1024, stdin) != nullptr)
|
||||
{
|
||||
OUString value = OStringToOUString(OString(buf), osl_getThreadTextEncoding());
|
||||
OUString value = OStringToOUString(std::string_view(buf), osl_getThreadTextEncoding());
|
||||
return value.trim();
|
||||
}
|
||||
throw css::uno::RuntimeException("reading from stdin failed");
|
||||
|
@ -31,6 +31,8 @@
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <iostream>
|
||||
#include <string_view>
|
||||
|
||||
#include <boost/property_tree/json_parser.hpp>
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
@ -283,7 +285,7 @@ static char *convertOString(const OString &rStr)
|
||||
return pMemory;
|
||||
}
|
||||
|
||||
static char *convertOUString(const OUString &aStr)
|
||||
static char *convertOUString(std::u16string_view aStr)
|
||||
{
|
||||
return convertOString(OUStringToOString(aStr, RTL_TEXTENCODING_UTF8));
|
||||
}
|
||||
@ -3492,7 +3494,7 @@ static void doc_postWindowExtTextInputEvent(LibreOfficeKitDocument* pThis, unsig
|
||||
return;
|
||||
}
|
||||
|
||||
SfxLokHelper::postExtTextEventAsync(pWindow, nType, OUString::fromUtf8(OString(pText, strlen(pText))));
|
||||
SfxLokHelper::postExtTextEventAsync(pWindow, nType, OUString::fromUtf8(std::string_view(pText, strlen(pText))));
|
||||
}
|
||||
|
||||
static void doc_removeTextContext(LibreOfficeKitDocument* pThis, unsigned nLOKWindowId, int nCharBefore, int nCharAfter)
|
||||
@ -4584,7 +4586,7 @@ static char* getFonts (const char* pCommand)
|
||||
return pJson;
|
||||
}
|
||||
|
||||
static char* getFontSubset (const OString& aFontName)
|
||||
static char* getFontSubset (std::string_view aFontName)
|
||||
{
|
||||
OUString aFoundFont(::rtl::Uri::decode(OStringToOUString(aFontName, RTL_TEXTENCODING_UTF8), rtl_UriDecodeStrict, RTL_TEXTENCODING_UTF8));
|
||||
SfxObjectShell* pDocSh = SfxObjectShell::Current();
|
||||
@ -5053,7 +5055,7 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo
|
||||
}
|
||||
else if (aCommand.startsWith(aFontSubset))
|
||||
{
|
||||
return getFontSubset(OString(pCommand + aFontSubset.getLength()));
|
||||
return getFontSubset(std::string_view(pCommand + aFontSubset.getLength()));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -70,8 +70,8 @@ struct ExtensionName
|
||||
};
|
||||
|
||||
|
||||
const char s_usingText [] =
|
||||
"\n"
|
||||
const char16_t s_usingText [] =
|
||||
u"\n"
|
||||
"using: " APP_NAME " add <options> extension-path...\n"
|
||||
" " APP_NAME " validate <options> extension-identifier...\n"
|
||||
" " APP_NAME " remove <options> extension-identifier...\n"
|
||||
@ -231,7 +231,7 @@ extern "C" int unopkg_main()
|
||||
return 0;
|
||||
}
|
||||
else if (isOption( info_version, &nPos )) {
|
||||
dp_misc::writeConsole("\n" APP_NAME " Version 3.3\n");
|
||||
dp_misc::writeConsole(u"\n" APP_NAME " Version 3.3\n");
|
||||
return 0;
|
||||
}
|
||||
//consume all bootstrap variables which may occur before the sub-command
|
||||
@ -271,12 +271,12 @@ extern "C" int unopkg_main()
|
||||
if (cmdArg[ 0 ] == '-')
|
||||
{
|
||||
// is option:
|
||||
dp_misc::writeConsoleError(
|
||||
dp_misc::writeConsoleError(OUString(
|
||||
"\nERROR: unexpected option " +
|
||||
cmdArg +
|
||||
"!\n Use " APP_NAME " " +
|
||||
toString(info_help) +
|
||||
" to print all options.\n");
|
||||
" to print all options.\n"));
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
@ -478,7 +478,7 @@ extern "C" int unopkg_main()
|
||||
vec_packages.size(), false);
|
||||
|
||||
dp_misc::writeConsole(
|
||||
"All deployed " + repository + " extensions:\n\n");
|
||||
OUString("All deployed " + repository + " extensions:\n\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -612,7 +612,7 @@ extern "C" int unopkg_main()
|
||||
catch (const LockFileException & e)
|
||||
{
|
||||
// No logger since it requires UNO which we don't have here
|
||||
dp_misc::writeConsoleError(e.Message + "\n");
|
||||
dp_misc::writeConsoleError(OUString(e.Message + "\n"));
|
||||
bShowFailedMsg = false;
|
||||
}
|
||||
catch (const css::uno::Exception & e ) {
|
||||
|
@ -139,9 +139,9 @@ void CommandEnvironmentImpl::printLicense(
|
||||
|
||||
OUString sNewLine("\n");
|
||||
|
||||
dp_misc::writeConsole(sNewLine + sNewLine + s1 + sNewLine + sNewLine);
|
||||
dp_misc::writeConsole(sLicense + sNewLine + sNewLine);
|
||||
dp_misc::writeConsole(s2 + sNewLine);
|
||||
dp_misc::writeConsole(OUString(sNewLine + sNewLine + s1 + sNewLine + sNewLine));
|
||||
dp_misc::writeConsole(OUString(sLicense + sNewLine + sNewLine));
|
||||
dp_misc::writeConsole(OUString(s2 + sNewLine));
|
||||
dp_misc::writeConsole(s3);
|
||||
|
||||
//the user may enter "yes" or "no", we compare in a case insensitive way
|
||||
@ -168,7 +168,7 @@ void CommandEnvironmentImpl::printLicense(
|
||||
}
|
||||
else
|
||||
{
|
||||
dp_misc::writeConsole(sNewLine + sNewLine + s4 + sNewLine);
|
||||
dp_misc::writeConsole(OUString(sNewLine + sNewLine + s4 + sNewLine));
|
||||
}
|
||||
}
|
||||
while(true);
|
||||
@ -254,7 +254,7 @@ void CommandEnvironmentImpl::handle(
|
||||
{
|
||||
OUString sMsg(DpResId(RID_STR_UNSUPPORTED_PLATFORM));
|
||||
sMsg = sMsg.replaceAll("%Name", platExc.package->getDisplayName());
|
||||
dp_misc::writeConsole("\n" + sMsg + "\n\n");
|
||||
dp_misc::writeConsole(OUString("\n" + sMsg + "\n\n"));
|
||||
approve = true;
|
||||
}
|
||||
else {
|
||||
@ -272,7 +272,7 @@ void CommandEnvironmentImpl::handle(
|
||||
if (abort && m_option_verbose)
|
||||
{
|
||||
OUString msg = ::comphelper::anyToString(request);
|
||||
dp_misc::writeConsoleError("\nERROR: " + msg + "\n");
|
||||
dp_misc::writeConsoleError(OUString("\nERROR: " + msg + "\n"));
|
||||
}
|
||||
|
||||
// select:
|
||||
@ -339,15 +339,15 @@ void CommandEnvironmentImpl::update_( Any const & Status )
|
||||
for ( sal_Int32 n = 0; n < m_logLevel; ++n )
|
||||
{
|
||||
if (bUseErr)
|
||||
dp_misc::writeConsoleError(" ");
|
||||
dp_misc::writeConsoleError(u" ");
|
||||
else
|
||||
dp_misc::writeConsole(" ");
|
||||
dp_misc::writeConsole(u" ");
|
||||
}
|
||||
|
||||
if (bUseErr)
|
||||
dp_misc::writeConsoleError(msg + "\n");
|
||||
dp_misc::writeConsoleError(OUString(msg + "\n"));
|
||||
else
|
||||
dp_misc::writeConsole(msg + "\n");
|
||||
dp_misc::writeConsole(OUString(msg + "\n"));
|
||||
}
|
||||
|
||||
|
||||
|
@ -227,7 +227,7 @@ namespace {
|
||||
void printf_space( sal_Int32 space )
|
||||
{
|
||||
while (space--)
|
||||
dp_misc::writeConsole(" ");
|
||||
dp_misc::writeConsole(u" ");
|
||||
}
|
||||
|
||||
|
||||
@ -235,7 +235,7 @@ void printf_line(
|
||||
OUString const & name, OUString const & value, sal_Int32 level )
|
||||
{
|
||||
printf_space( level );
|
||||
dp_misc::writeConsole(name + ": " + value + "\n");
|
||||
dp_misc::writeConsole(OUString(name + ": " + value + "\n"));
|
||||
}
|
||||
|
||||
|
||||
@ -282,13 +282,13 @@ void printf_package(
|
||||
Sequence< Reference<deployment::XPackage> > seq(
|
||||
xPackage->getBundle( Reference<task::XAbortChannel>(), xCmdEnv ) );
|
||||
printf_space( level + 1 );
|
||||
dp_misc::writeConsole("bundled Packages: {\n");
|
||||
dp_misc::writeConsole(u"bundled Packages: {\n");
|
||||
std::vector<Reference<deployment::XPackage> >vec_bundle;
|
||||
::comphelper::sequenceToContainer(vec_bundle, seq);
|
||||
printf_packages( vec_bundle, std::vector<bool>(vec_bundle.size()),
|
||||
xCmdEnv, level + 2 );
|
||||
printf_space( level + 1 );
|
||||
dp_misc::writeConsole("}\n");
|
||||
dp_misc::writeConsole(u"}\n");
|
||||
}
|
||||
|
||||
} // anon namespace
|
||||
@ -300,7 +300,7 @@ static void printf_unaccepted_licenses(
|
||||
dp_misc::getIdentifier(ext) );
|
||||
printf_line( "Identifier", id, 0 );
|
||||
printf_space(1);
|
||||
dp_misc::writeConsole("License not accepted\n\n");
|
||||
dp_misc::writeConsole(u"License not accepted\n\n");
|
||||
}
|
||||
|
||||
|
||||
@ -314,7 +314,7 @@ void printf_packages(
|
||||
if (allExtensions.empty())
|
||||
{
|
||||
printf_space( level );
|
||||
dp_misc::writeConsole("<none>\n");
|
||||
dp_misc::writeConsole(u"<none>\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -325,7 +325,7 @@ void printf_packages(
|
||||
printf_unaccepted_licenses(extension);
|
||||
else
|
||||
printf_package( extension, xCmdEnv, level );
|
||||
dp_misc::writeConsole("\n");
|
||||
dp_misc::writeConsole(u"\n");
|
||||
++index;
|
||||
}
|
||||
}
|
||||
@ -365,16 +365,16 @@ Reference<XComponentContext> connectToOffice(
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
dp_misc::writeConsole(
|
||||
dp_misc::writeConsole(OUString(
|
||||
"Raising process: " + appURL +
|
||||
"\nArguments: --nologo --nodefault " + args[2] +
|
||||
"\n");
|
||||
"\n"));
|
||||
}
|
||||
|
||||
::dp_misc::raiseProcess( appURL, args );
|
||||
|
||||
if (verbose)
|
||||
dp_misc::writeConsole("OK. Connecting...");
|
||||
dp_misc::writeConsole(u"OK. Connecting...");
|
||||
|
||||
OUString sUnoUrl = "uno:pipe,name=" + pipeId + ";urp;StarOffice.ComponentContext";
|
||||
Reference<XComponentContext> xRet(
|
||||
@ -382,7 +382,7 @@ Reference<XComponentContext> connectToOffice(
|
||||
sUnoUrl, xLocalComponentContext ),
|
||||
UNO_QUERY_THROW );
|
||||
if (verbose)
|
||||
dp_misc::writeConsole("OK.\n");
|
||||
dp_misc::writeConsole(u"OK.\n");
|
||||
|
||||
return xRet;
|
||||
}
|
||||
|
@ -429,7 +429,7 @@ void EnhancedShapeDumper::dumpEnhancedCustomShapeGeometryService(const uno::Refe
|
||||
dumpHandlesAsElement(aHandles);
|
||||
}
|
||||
}
|
||||
void EnhancedShapeDumper::dumpTypeAsAttribute(const OUString& sType)
|
||||
void EnhancedShapeDumper::dumpTypeAsAttribute(std::u16string_view sType)
|
||||
{
|
||||
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("type"), "%s",
|
||||
OUStringToOString(sType, RTL_TEXTENCODING_UTF8).getStr());
|
||||
|
@ -8,6 +8,10 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include <libxml/xmlwriter.h>
|
||||
|
||||
#include <com/sun/star/beans/XPropertySet.hpp>
|
||||
@ -73,7 +77,7 @@ public:
|
||||
|
||||
// EnhancedCustomShapeGeometry.idl
|
||||
void dumpEnhancedCustomShapeGeometryService(const css::uno::Reference< css::beans::XPropertySet >& xPropSet);
|
||||
void dumpTypeAsAttribute(const OUString& sType);
|
||||
void dumpTypeAsAttribute(std::u16string_view sType);
|
||||
void dumpViewBoxAsElement(css::awt::Rectangle aViewBox);
|
||||
void dumpMirroredXAsAttribute(bool bMirroredX); // also used in EnhancedCustomShapeHandle
|
||||
void dumpMirroredYAsAttribute(bool bMirroredY); // also used in EnhancedCustomShapeHandle
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include <rtl/strbuf.hxx>
|
||||
#include <libxml/xmlwriter.h>
|
||||
#include <iostream>
|
||||
#include <string_view>
|
||||
#include <rtl/ustring.hxx>
|
||||
|
||||
#define DEBUG_DUMPER 0
|
||||
@ -62,9 +63,9 @@ void dumpPropertyValueAsElement(const beans::PropertyValue& rPropertyValue, xmlT
|
||||
void dumpFillStyleAsAttribute(css::drawing::FillStyle eFillStyle, xmlTextWriterPtr xmlWriter);
|
||||
void dumpFillColorAsAttribute(sal_Int32 aColor, xmlTextWriterPtr xmlWriter);
|
||||
void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr xmlWriter);
|
||||
void dumpFillTransparenceGradientNameAsAttribute(const OUString& sTranspGradName, xmlTextWriterPtr xmlWriter);
|
||||
void dumpFillTransparenceGradientNameAsAttribute(std::u16string_view sTranspGradName, xmlTextWriterPtr xmlWriter);
|
||||
void dumpFillTransparenceGradientAsElement(const css::awt::Gradient& rTranspGrad, xmlTextWriterPtr xmlWriter);
|
||||
void dumpFillGradientNameAsAttribute(const OUString& sGradName, xmlTextWriterPtr xmlWriter);
|
||||
void dumpFillGradientNameAsAttribute(std::u16string_view sGradName, xmlTextWriterPtr xmlWriter);
|
||||
void dumpFillGradientAsElement(const css::awt::Gradient& rGradient, xmlTextWriterPtr xmlWriter);
|
||||
void dumpFillHatchAsElement(const css::drawing::Hatch& rHatch, xmlTextWriterPtr xmlWriter);
|
||||
void dumpFillBackgroundAsAttribute(bool bBackground, xmlTextWriterPtr xmlWriter);
|
||||
@ -84,13 +85,13 @@ void dumpFillBitmapTileAsAttribute(bool bBitmapTile, xmlTextWriterPtr xmlWriter)
|
||||
// LineProperties.idl
|
||||
void dumpLineStyleAsAttribute(css::drawing::LineStyle eLineStyle, xmlTextWriterPtr xmlWriter);
|
||||
void dumpLineDashAsElement(const css::drawing::LineDash& rLineDash, xmlTextWriterPtr xmlWriter);
|
||||
void dumpLineDashNameAsAttribute(const OUString& sLineDashName, xmlTextWriterPtr xmlWriter);
|
||||
void dumpLineDashNameAsAttribute(std::u16string_view sLineDashName, xmlTextWriterPtr xmlWriter);
|
||||
void dumpLineColorAsAttribute(sal_Int32 aLineColor, xmlTextWriterPtr xmlWriter);
|
||||
void dumpLineTransparenceAsAttribute(sal_Int32 aLineTransparence, xmlTextWriterPtr xmlWriter);
|
||||
void dumpLineWidthAsAttribute(sal_Int32 aLineWidth, xmlTextWriterPtr xmlWriter);
|
||||
void dumpLineJointAsAttribute(css::drawing::LineJoint eLineJoint, xmlTextWriterPtr xmlWriter);
|
||||
void dumpLineStartNameAsAttribute(const OUString& sLineStartName, xmlTextWriterPtr xmlWriter);
|
||||
void dumpLineEndNameAsAttribute(const OUString& sLineEndName, xmlTextWriterPtr xmlWriter);
|
||||
void dumpLineStartNameAsAttribute(std::u16string_view sLineStartName, xmlTextWriterPtr xmlWriter);
|
||||
void dumpLineEndNameAsAttribute(std::u16string_view sLineEndName, xmlTextWriterPtr xmlWriter);
|
||||
void dumpLineStartAsElement(const css::drawing::PolyPolygonBezierCoords& rLineStart, xmlTextWriterPtr xmlWriter);
|
||||
void dumpLineEndAsElement(const css::drawing::PolyPolygonBezierCoords& rLineEnd, xmlTextWriterPtr xmlWriter);
|
||||
void dumpLineStartCenterAsAttribute(bool bLineStartCenter, xmlTextWriterPtr xmlWriter);
|
||||
@ -142,23 +143,24 @@ void dumpShadowYDistanceAsAttribute(sal_Int32 aShadowYDistance, xmlTextWriterPtr
|
||||
//Shape.idl
|
||||
void dumpZOrderAsAttribute(sal_Int32 aZOrder, xmlTextWriterPtr xmlWriter);
|
||||
void dumpLayerIDAsAttribute(sal_Int32 aLayerID, xmlTextWriterPtr xmlWriter);
|
||||
void dumpLayerNameAsAttribute(const OUString& sLayerName, xmlTextWriterPtr xmlWriter);
|
||||
void dumpLayerNameAsAttribute(std::u16string_view sLayerName, xmlTextWriterPtr xmlWriter);
|
||||
void dumpVisibleAsAttribute(bool bVisible, xmlTextWriterPtr xmlWriter);
|
||||
void dumpPrintableAsAttribute(bool bPrintable, xmlTextWriterPtr xmlWriter);
|
||||
void dumpMoveProtectAsAttribute(bool bMoveProtect, xmlTextWriterPtr xmlWriter);
|
||||
void dumpNameAsAttribute(const OUString& sName, xmlTextWriterPtr xmlWriter);
|
||||
void dumpNameAsAttribute(std::u16string_view sName, xmlTextWriterPtr xmlWriter);
|
||||
void dumpSizeProtectAsAttribute(bool bSizeProtect, xmlTextWriterPtr xmlWriter);
|
||||
void dumpHomogenMatrixLine3(const css::drawing::HomogenMatrixLine3& rLine, xmlTextWriterPtr xmlWriter);
|
||||
void dumpTransformationAsElement(const css::drawing::HomogenMatrix3& rTransformation, xmlTextWriterPtr xmlWriter);
|
||||
void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr xmlWriter);
|
||||
void dumpHyperlinkAsAttribute(const OUString& sHyperlink, xmlTextWriterPtr xmlWriter);
|
||||
void dumpHyperlinkAsAttribute(std::u16string_view sHyperlink, xmlTextWriterPtr xmlWriter);
|
||||
void dumpInteropGrabBagAsElement(const uno::Sequence< beans::PropertyValue>& aInteropGrabBag, xmlTextWriterPtr xmlWriter);
|
||||
|
||||
// CustomShape.idl
|
||||
void dumpCustomShapeEngineAsAttribute(const OUString& sCustomShapeEngine, xmlTextWriterPtr xmlWriter);
|
||||
void dumpCustomShapeDataAsAttribute(const OUString& sCustomShapeData, xmlTextWriterPtr xmlWriter);
|
||||
void dumpCustomShapeEngineAsAttribute(std::u16string_view sCustomShapeEngine, xmlTextWriterPtr xmlWriter);
|
||||
void dumpCustomShapeDataAsAttribute(
|
||||
std::u16string_view sCustomShapeData, xmlTextWriterPtr xmlWriter);
|
||||
void dumpCustomShapeGeometryAsElement(const css::uno::Sequence< css::beans::PropertyValue>& aCustomShapeGeometry, xmlTextWriterPtr xmlWriter);
|
||||
void dumpCustomShapeReplacementURLAsAttribute(const OUString& sCustomShapeReplacementURL, xmlTextWriterPtr xmlWriter);
|
||||
void dumpCustomShapeReplacementURLAsAttribute(std::u16string_view sCustomShapeReplacementURL, xmlTextWriterPtr xmlWriter);
|
||||
|
||||
// XShape.idl
|
||||
void dumpPositionAsAttribute(const css::awt::Point& rPoint, xmlTextWriterPtr xmlWriter);
|
||||
@ -229,7 +231,7 @@ void dumpFillTransparenceAsAttribute(sal_Int32 aTransparence, xmlTextWriterPtr x
|
||||
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparence"), "%" SAL_PRIdINT32, aTransparence);
|
||||
}
|
||||
|
||||
void dumpFillTransparenceGradientNameAsAttribute(const OUString& sTranspGradName, xmlTextWriterPtr xmlWriter)
|
||||
void dumpFillTransparenceGradientNameAsAttribute(std::u16string_view sTranspGradName, xmlTextWriterPtr xmlWriter)
|
||||
{
|
||||
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillTransparenceGradientName"), "%s",
|
||||
OUStringToOString(sTranspGradName, RTL_TEXTENCODING_UTF8).getStr());
|
||||
@ -279,7 +281,7 @@ void dumpFillTransparenceGradientAsElement(const awt::Gradient& rTranspGrad, xml
|
||||
xmlTextWriterEndElement( xmlWriter );
|
||||
}
|
||||
|
||||
void dumpFillGradientNameAsAttribute(const OUString& sGradName, xmlTextWriterPtr xmlWriter)
|
||||
void dumpFillGradientNameAsAttribute(std::u16string_view sGradName, xmlTextWriterPtr xmlWriter)
|
||||
{
|
||||
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("fillGradientName"), "%s",
|
||||
OUStringToOString(sGradName, RTL_TEXTENCODING_UTF8).getStr());
|
||||
@ -493,7 +495,7 @@ void dumpLineDashAsElement(const drawing::LineDash& rLineDash, xmlTextWriterPtr
|
||||
xmlTextWriterEndElement( xmlWriter );
|
||||
}
|
||||
|
||||
void dumpLineDashNameAsAttribute(const OUString& sLineDashName, xmlTextWriterPtr xmlWriter)
|
||||
void dumpLineDashNameAsAttribute(std::u16string_view sLineDashName, xmlTextWriterPtr xmlWriter)
|
||||
{
|
||||
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineDashName"), "%s",
|
||||
OUStringToOString(sLineDashName, RTL_TEXTENCODING_UTF8).getStr());
|
||||
@ -538,13 +540,13 @@ void dumpLineJointAsAttribute(drawing::LineJoint eLineJoint, xmlTextWriterPtr xm
|
||||
}
|
||||
}
|
||||
|
||||
void dumpLineStartNameAsAttribute(const OUString& sLineStartName, xmlTextWriterPtr xmlWriter)
|
||||
void dumpLineStartNameAsAttribute(std::u16string_view sLineStartName, xmlTextWriterPtr xmlWriter)
|
||||
{
|
||||
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineStartName"), "%s",
|
||||
OUStringToOString(sLineStartName, RTL_TEXTENCODING_UTF8).getStr());
|
||||
}
|
||||
|
||||
void dumpLineEndNameAsAttribute(const OUString& sLineEndName, xmlTextWriterPtr xmlWriter)
|
||||
void dumpLineEndNameAsAttribute(std::u16string_view sLineEndName, xmlTextWriterPtr xmlWriter)
|
||||
{
|
||||
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("lineEndName"), "%s",
|
||||
OUStringToOString(sLineEndName, RTL_TEXTENCODING_UTF8).getStr());
|
||||
@ -989,7 +991,7 @@ void dumpLayerIDAsAttribute(sal_Int32 aLayerID, xmlTextWriterPtr xmlWriter)
|
||||
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerID"), "%" SAL_PRIdINT32, aLayerID);
|
||||
}
|
||||
|
||||
void dumpLayerNameAsAttribute(const OUString& sLayerName, xmlTextWriterPtr xmlWriter)
|
||||
void dumpLayerNameAsAttribute(std::u16string_view sLayerName, xmlTextWriterPtr xmlWriter)
|
||||
{
|
||||
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("layerName"), "%s",
|
||||
OUStringToOString(sLayerName, RTL_TEXTENCODING_UTF8).getStr());
|
||||
@ -1019,9 +1021,9 @@ void dumpMoveProtectAsAttribute(bool bMoveProtect, xmlTextWriterPtr xmlWriter)
|
||||
xmlTextWriterWriteFormatAttribute( xmlWriter, BAD_CAST("moveProtect"), "%s", "false");
|
||||
}
|
||||
|
||||
void dumpNameAsAttribute(const OUString& sName, xmlTextWriterPtr xmlWriter)
|
||||
void dumpNameAsAttribute(std::u16string_view sName, xmlTextWriterPtr xmlWriter)
|
||||
{
|
||||
if(!sName.isEmpty() && !m_bNameDumped)
|
||||
if(!sName.empty() && !m_bNameDumped)
|
||||
{
|
||||
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("name"), "%s", OUStringToOString(sName, RTL_TEXTENCODING_UTF8).getStr());
|
||||
m_bNameDumped = true;
|
||||
@ -1065,7 +1067,7 @@ void dumpNavigationOrderAsAttribute(sal_Int32 aNavigationOrder, xmlTextWriterPtr
|
||||
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("navigationOrder"), "%" SAL_PRIdINT32, aNavigationOrder);
|
||||
}
|
||||
|
||||
void dumpHyperlinkAsAttribute(const OUString& sHyperlink, xmlTextWriterPtr xmlWriter)
|
||||
void dumpHyperlinkAsAttribute(std::u16string_view sHyperlink, xmlTextWriterPtr xmlWriter)
|
||||
{
|
||||
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("hyperlink"), "%s",
|
||||
OUStringToOString(sHyperlink, RTL_TEXTENCODING_UTF8).getStr());
|
||||
@ -1108,13 +1110,14 @@ void dumpShapeDescriptorAsAttribute( const uno::Reference< drawing::XShapeDescri
|
||||
// ---------- CustomShape.idl ----------
|
||||
|
||||
|
||||
void dumpCustomShapeEngineAsAttribute(const OUString& sCustomShapeEngine, xmlTextWriterPtr xmlWriter)
|
||||
void dumpCustomShapeEngineAsAttribute(std::u16string_view sCustomShapeEngine, xmlTextWriterPtr xmlWriter)
|
||||
{
|
||||
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeEngine"), "%s",
|
||||
OUStringToOString(sCustomShapeEngine, RTL_TEXTENCODING_UTF8).getStr());
|
||||
}
|
||||
|
||||
void dumpCustomShapeDataAsAttribute(const OUString& sCustomShapeData, xmlTextWriterPtr xmlWriter)
|
||||
void dumpCustomShapeDataAsAttribute(
|
||||
std::u16string_view sCustomShapeData, xmlTextWriterPtr xmlWriter)
|
||||
{
|
||||
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeData"), "%s",
|
||||
OUStringToOString(sCustomShapeData, RTL_TEXTENCODING_UTF8).getStr());
|
||||
@ -1220,7 +1223,7 @@ void dumpCustomShapeGeometryAsElement(const uno::Sequence< beans::PropertyValue>
|
||||
xmlTextWriterEndElement( xmlWriter );
|
||||
}
|
||||
|
||||
void dumpCustomShapeReplacementURLAsAttribute(const OUString& sCustomShapeReplacementURL, xmlTextWriterPtr xmlWriter)
|
||||
void dumpCustomShapeReplacementURLAsAttribute(std::u16string_view sCustomShapeReplacementURL, xmlTextWriterPtr xmlWriter)
|
||||
{
|
||||
xmlTextWriterWriteFormatAttribute(xmlWriter, BAD_CAST("customShapeReplacementURL"), "%s",
|
||||
OUStringToOString(sCustomShapeReplacementURL, RTL_TEXTENCODING_UTF8).getStr());
|
||||
|
@ -1884,7 +1884,7 @@ OUString EncryptBlockName_Imp(const OUString& rName)
|
||||
}
|
||||
|
||||
/* This code is copied from SwXMLTextBlocks::GeneratePackageName */
|
||||
static void GeneratePackageName ( const OUString& rShort, OUString& rPackageName )
|
||||
static void GeneratePackageName ( std::u16string_view rShort, OUString& rPackageName )
|
||||
{
|
||||
OString sByte(OUStringToOString(rShort, RTL_TEXTENCODING_UTF7));
|
||||
OUStringBuffer aBuf(OStringToOUString(sByte, RTL_TEXTENCODING_ASCII_US));
|
||||
|
@ -423,7 +423,7 @@ void BibGeneralPage::CommitActiveControl()
|
||||
}
|
||||
|
||||
void BibGeneralPage::AddControlWithError( const OUString& rColumnName, FixedText &rLabel,
|
||||
OUString& rErrorString, const OString& sHelpId, sal_uInt16 nIndexInFTArray, std::vector<vcl::Window*> &rChildren)
|
||||
OUString& rErrorString, std::string_view sHelpId, sal_uInt16 nIndexInFTArray, std::vector<vcl::Window*> &rChildren)
|
||||
{
|
||||
const OUString aColumnUIName(rLabel.GetText());
|
||||
// adds also the XControl and creates a map entry in nFT2CtrlMap[] for mapping between control and FT
|
||||
@ -448,7 +448,7 @@ void BibGeneralPage::AddControlWithError( const OUString& rColumnName, FixedText
|
||||
|
||||
bool BibGeneralPage::AddXControl(
|
||||
const OUString& rName,
|
||||
FixedText& rLabel, const OString& sHelpId, sal_Int16& rIndex,
|
||||
FixedText& rLabel, std::string_view sHelpId, sal_Int16& rIndex,
|
||||
std::vector<vcl::Window*>& rChildren)
|
||||
{
|
||||
uno::Reference< awt::XControlModel > xCtrModel;
|
||||
|
@ -20,6 +20,10 @@
|
||||
#ifndef INCLUDED_EXTENSIONS_SOURCE_BIBLIOGRAPHY_GENERAL_HXX
|
||||
#define INCLUDED_EXTENSIONS_SOURCE_BIBLIOGRAPHY_GENERAL_HXX
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include <com/sun/star/awt/XFocusListener.hpp>
|
||||
#include <com/sun/star/awt/XControlContainer.hpp>
|
||||
#include <com/sun/star/form/XBoundComponent.hpp>
|
||||
@ -124,12 +128,12 @@ class BibGeneralPage : public TabPage
|
||||
BibDataManager* pDatMan;
|
||||
|
||||
bool
|
||||
AddXControl( const OUString& rName, FixedText& rLabel, const OString& sHelpId,
|
||||
AddXControl( const OUString& rName, FixedText& rLabel, std::string_view sHelpId,
|
||||
sal_Int16& rIndex, std::vector<vcl::Window*>& rChildren );
|
||||
|
||||
void AddControlWithError( const OUString& rColumnName, FixedText& rLabel,
|
||||
OUString& rErrorString,
|
||||
const OString& sHelpId, sal_uInt16 nIndexInFTArray, std::vector<vcl::Window*>& rChildren );
|
||||
std::string_view sHelpId, sal_uInt16 nIndexInFTArray, std::vector<vcl::Window*>& rChildren );
|
||||
|
||||
protected:
|
||||
void InitFixedTexts(); // create mnemonics and set text an all fixed texts
|
||||
|
@ -109,7 +109,7 @@ namespace logging
|
||||
}
|
||||
|
||||
|
||||
bool LogHandlerHelper::setEncoding( const OUString& _rEncoding )
|
||||
bool LogHandlerHelper::setEncoding( std::u16string_view _rEncoding )
|
||||
{
|
||||
OString sAsciiEncoding( OUStringToOString( _rEncoding, RTL_TEXTENCODING_ASCII_US ) );
|
||||
rtl_TextEncoding eEncoding = rtl_getTextEncodingFromMimeCharset( sAsciiEncoding.getStr() );
|
||||
|
@ -20,6 +20,10 @@
|
||||
#ifndef INCLUDED_EXTENSIONS_SOURCE_LOGGING_LOGHANDLER_HXX
|
||||
#define INCLUDED_EXTENSIONS_SOURCE_LOGGING_LOGHANDLER_HXX
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include <com/sun/star/logging/XLogFormatter.hpp>
|
||||
#include <com/sun/star/uno/XComponentContext.hpp>
|
||||
#include <com/sun/star/logging/LogRecord.hpp>
|
||||
@ -59,7 +63,7 @@ namespace logging
|
||||
void setIsInitialized() { m_bInitialized = true; }
|
||||
|
||||
bool getEncoding( OUString& _out_rEncoding ) const;
|
||||
bool setEncoding( const OUString& _rEncoding );
|
||||
bool setEncoding( std::u16string_view _rEncoding );
|
||||
|
||||
rtl_TextEncoding
|
||||
getTextEncoding() const { return m_eEncoding; }
|
||||
|
@ -44,7 +44,7 @@ namespace pcr
|
||||
}
|
||||
|
||||
|
||||
OUString HelpIdUrl::getHelpURL( const OString& sHelpId )
|
||||
OUString HelpIdUrl::getHelpURL( std::string_view sHelpId )
|
||||
{
|
||||
OUStringBuffer aBuffer;
|
||||
OUString aTmp( OStringToOUString(sHelpId, RTL_TEXTENCODING_UTF8) );
|
||||
|
@ -23,6 +23,10 @@
|
||||
#define EDITOR_LIST_APPEND (SAL_MAX_UINT16)
|
||||
#define EDITOR_LIST_ENTRY_NOTFOUND (SAL_MAX_UINT16)
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include <com/sun/star/uno/Sequence.hxx>
|
||||
#include <com/sun/star/beans/XPropertyChangeListener.hpp>
|
||||
#include <com/sun/star/beans/PropertyChangeEvent.hpp>
|
||||
@ -66,7 +70,7 @@ namespace pcr
|
||||
{
|
||||
public:
|
||||
static OString getHelpId( const OUString& _rHelpURL );
|
||||
static OUString getHelpURL( const OString& );
|
||||
static OUString getHelpURL( std::string_view );
|
||||
};
|
||||
|
||||
|
||||
|
@ -414,7 +414,7 @@ void Sane::SetOptionValue( int n, bool bSet )
|
||||
ControlOption( n, SANE_ACTION_SET_VALUE, &nRet );
|
||||
}
|
||||
|
||||
void Sane::SetOptionValue( int n, const OUString& rSet )
|
||||
void Sane::SetOptionValue( int n, std::u16string_view rSet )
|
||||
{
|
||||
if( ! maHandle || mppOptions[n]->type != SANE_TYPE_STRING )
|
||||
return;
|
||||
|
@ -18,6 +18,10 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include <cppuhelper/implbase.hxx>
|
||||
#include <osl/thread.h>
|
||||
#include <osl/module.h>
|
||||
@ -144,7 +148,7 @@ public:
|
||||
bool GetOptionValue( int, double* );
|
||||
|
||||
void SetOptionValue( int, bool );
|
||||
void SetOptionValue( int, const OUString& );
|
||||
void SetOptionValue( int, std::u16string_view );
|
||||
void SetOptionValue( int, double, int nElement = 0 );
|
||||
void SetOptionValue( int, double const * );
|
||||
|
||||
|
@ -17,6 +17,9 @@
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
*/
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
@ -70,7 +73,8 @@ static void openFile( OutData& out )
|
||||
sal_Int32 nIndex = aURL.lastIndexOf('/');
|
||||
if( nIndex > 0 )
|
||||
{
|
||||
out.File = out.DestinationDir + OStringToOUString(aURL.copy(nIndex), RTL_TEXTENCODING_UTF8);
|
||||
out.File = out.DestinationDir
|
||||
+ OStringToOUString(aURL.subView(nIndex), RTL_TEXTENCODING_UTF8);
|
||||
|
||||
oslFileError rc;
|
||||
|
||||
@ -206,7 +210,7 @@ Download::getProxyForURL(const OUString& rURL, OString& rHost, sal_Int32& rPort)
|
||||
}
|
||||
|
||||
|
||||
static bool curl_run(const OUString& rURL, OutData& out, const OString& aProxyHost, sal_Int32 nProxyPort)
|
||||
static bool curl_run(std::u16string_view rURL, OutData& out, const OString& aProxyHost, sal_Int32 nProxyPort)
|
||||
{
|
||||
/* Need to investigate further whether it is necessary to call
|
||||
* curl_global_init or not - leave it for now (as the ftp UCB content
|
||||
|
@ -436,7 +436,7 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
OUString DXFRepresentation::ToOUString(const OString& s) const
|
||||
OUString DXFRepresentation::ToOUString(std::string_view s) const
|
||||
{
|
||||
OUString result = OStringToOUString(s, getTextEncoding(),
|
||||
RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_ERROR
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "dxfblkrd.hxx"
|
||||
#include "dxftblrd.hxx"
|
||||
#include <array>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
//--------------------Other stuff---------------------------------------------
|
||||
|
||||
@ -100,7 +100,7 @@ public:
|
||||
|
||||
rtl_TextEncoding getTextEncoding() const;
|
||||
void setTextEncoding(rtl_TextEncoding aEnc) { mEnc = aEnc; }
|
||||
OUString ToOUString(const OString& s) const;
|
||||
OUString ToOUString(std::string_view s) const;
|
||||
|
||||
double getGlobalLineTypeScale() const { return mfGlobalLineTypeScale; }
|
||||
void setGlobalLineTypeScale(double fGlobalLineTypeScale) { mfGlobalLineTypeScale = fGlobalLineTypeScale; }
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <map>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <libxml/parser.h>
|
||||
@ -147,7 +148,7 @@ namespace XSLT
|
||||
streamName = ensureStringValue(streamName, ctxt);
|
||||
|
||||
oh->insertByName(OStringToOUString(reinterpret_cast<char*>(streamName->stringval), RTL_TEXTENCODING_UTF8),
|
||||
OString(reinterpret_cast<char*>(value->stringval)));
|
||||
std::string_view(reinterpret_cast<char*>(value->stringval)));
|
||||
valuePush(ctxt, xmlXPathNewCString(""));
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ namespace XSLT
|
||||
}
|
||||
}
|
||||
|
||||
void OleHandler::initRootStorageFromBase64(const OString& content)
|
||||
void OleHandler::initRootStorageFromBase64(std::string_view content)
|
||||
{
|
||||
Sequence<sal_Int8> oleData;
|
||||
::comphelper::Base64::decode(oleData, OStringToOUString(
|
||||
@ -132,7 +132,7 @@ namespace XSLT
|
||||
}
|
||||
|
||||
void
|
||||
OleHandler::insertByName(const OUString& streamName, const OString& content)
|
||||
OleHandler::insertByName(const OUString& streamName, std::string_view content)
|
||||
{
|
||||
if ( streamName == "oledata.mso" )
|
||||
{
|
||||
@ -167,7 +167,7 @@ namespace XSLT
|
||||
}
|
||||
|
||||
void
|
||||
OleHandler::insertSubStorage(const OUString& streamName, const OString& content)
|
||||
OleHandler::insertSubStorage(const OUString& streamName, std::string_view content)
|
||||
{
|
||||
//decode the base64 string
|
||||
Sequence<sal_Int8> oledata;
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <map>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <libxml/parser.h>
|
||||
@ -66,7 +67,7 @@ namespace XSLT
|
||||
if (m_tcontext)
|
||||
m_tcontext->_private = nullptr;
|
||||
}
|
||||
void insertByName(const OUString& streamName, const OString& content);
|
||||
void insertByName(const OUString& streamName, std::string_view content);
|
||||
OString getByName(const OUString& streamName);
|
||||
void registercontext(xsltTransformContextPtr context)
|
||||
{
|
||||
@ -83,8 +84,8 @@ namespace XSLT
|
||||
|
||||
void ensureCreateRootStorage();
|
||||
OString encodeSubStorage(const OUString& streamName);
|
||||
void insertSubStorage(const OUString& streamName, const OString& content);
|
||||
void initRootStorageFromBase64(const OString& content);
|
||||
void insertSubStorage(const OUString& streamName, std::string_view content);
|
||||
void initRootStorageFromBase64(std::string_view content);
|
||||
css::uno::Reference<XStream> createTempFile();
|
||||
};
|
||||
}
|
||||
|
@ -17,6 +17,9 @@
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
*/
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include <componenttools.hxx>
|
||||
#include "DatabaseForm.hxx"
|
||||
@ -916,7 +919,7 @@ void ODatabaseForm::Encode( OUString& rString )
|
||||
|
||||
|
||||
void ODatabaseForm::InsertTextPart( INetMIMEMessage& rParent, const OUString& rName,
|
||||
const OUString& rData )
|
||||
std::u16string_view rData )
|
||||
{
|
||||
// Create part as MessageChild
|
||||
std::unique_ptr<INetMIMEMessage> pChild(new INetMIMEMessage);
|
||||
@ -2075,7 +2078,7 @@ void SAL_CALL ODatabaseForm::submit( const Reference<XControl>& Control,
|
||||
}
|
||||
|
||||
static void lcl_dispatch(const Reference< XFrame >& xFrame,const Reference<XURLTransformer>& xTransformer,const OUString& aURLStr,const OUString& aReferer,const OUString& aTargetName
|
||||
,const OUString& aData,rtl_TextEncoding _eEncoding)
|
||||
,std::u16string_view aData,rtl_TextEncoding _eEncoding)
|
||||
{
|
||||
URL aURL;
|
||||
aURL.Complete = aURLStr;
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include <propertybaghelper.hxx>
|
||||
@ -505,7 +506,7 @@ private:
|
||||
|
||||
void FillSuccessfulList(HtmlSuccessfulObjList& rList, const css::uno::Reference< css::awt::XControl>& rxSubmitButton, const css::awt::MouseEvent& MouseEvt);
|
||||
|
||||
static void InsertTextPart(INetMIMEMessage& rParent, const OUString& rName, const OUString& rData);
|
||||
static void InsertTextPart(INetMIMEMessage& rParent, const OUString& rName, std::u16string_view rData);
|
||||
static void InsertFilePart(INetMIMEMessage& rParent, const OUString& rName, const OUString& rFileName);
|
||||
static void Encode(OUString& rString);
|
||||
|
||||
|
@ -69,7 +69,8 @@ bool CSerializationURLEncoded::is_unreserved(char c)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
void CSerializationURLEncoded::encode_and_append(const OUString& aString, OStringBuffer& aBuffer)
|
||||
void CSerializationURLEncoded::encode_and_append(
|
||||
std::u16string_view aString, OStringBuffer& aBuffer)
|
||||
{
|
||||
OString utf8String = OUStringToOString(aString, RTL_TEXTENCODING_UTF8);
|
||||
const sal_uInt8 *pString = reinterpret_cast< const sal_uInt8 * >( utf8String.getStr() );
|
||||
|
@ -20,6 +20,10 @@
|
||||
#ifndef INCLUDED_FORMS_SOURCE_XFORMS_SUBMISSION_SERIALIZATION_URLENCODED_HXX
|
||||
#define INCLUDED_FORMS_SOURCE_XFORMS_SUBMISSION_SERIALIZATION_URLENCODED_HXX
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include <com/sun/star/io/XPipe.hpp>
|
||||
|
||||
#include <rtl/strbuf.hxx>
|
||||
@ -32,7 +36,7 @@ private:
|
||||
css::uno::Reference<css::io::XPipe> m_aPipe;
|
||||
|
||||
static bool is_unreserved(char);
|
||||
static void encode_and_append(const OUString& aString, OStringBuffer& aBuffer);
|
||||
static void encode_and_append(std::u16string_view aString, OStringBuffer& aBuffer);
|
||||
void serialize_node(const css::uno::Reference<css::xml::dom::XNode>& aNode);
|
||||
|
||||
public:
|
||||
|
@ -211,7 +211,7 @@ namespace svt
|
||||
return sHelpURL;
|
||||
}
|
||||
|
||||
Any OControlAccess::getControlProperty( const OUString& rControlName, const OUString& rControlProperty )
|
||||
Any OControlAccess::getControlProperty( std::u16string_view rControlName, const OUString& rControlProperty )
|
||||
{
|
||||
// look up the control
|
||||
sal_Int16 nControlId = -1;
|
||||
@ -232,7 +232,7 @@ namespace svt
|
||||
return implGetControlProperty( pControl, aPropDesc->nPropertyId );
|
||||
}
|
||||
|
||||
weld::Widget* OControlAccess::implGetControl( const OUString& rControlName, sal_Int16* _pId, PropFlags* _pPropertyMask ) const
|
||||
weld::Widget* OControlAccess::implGetControl( std::u16string_view rControlName, sal_Int16* _pId, PropFlags* _pPropertyMask ) const
|
||||
{
|
||||
weld::Widget* pControl = nullptr;
|
||||
ControlDescription tmpDesc;
|
||||
@ -260,7 +260,7 @@ namespace svt
|
||||
return pControl;
|
||||
}
|
||||
|
||||
void OControlAccess::setControlProperty( const OUString& rControlName, const OUString& rControlProperty, const css::uno::Any& rValue )
|
||||
void OControlAccess::setControlProperty( std::u16string_view rControlName, const OUString& rControlProperty, const css::uno::Any& rValue )
|
||||
{
|
||||
// look up the control
|
||||
sal_Int16 nControlId = -1;
|
||||
@ -292,7 +292,7 @@ namespace svt
|
||||
return aControls;
|
||||
}
|
||||
|
||||
Sequence< OUString > OControlAccess::getSupportedControlProperties( const OUString& rControlName )
|
||||
Sequence< OUString > OControlAccess::getSupportedControlProperties( std::u16string_view rControlName )
|
||||
{
|
||||
sal_Int16 nControlId = -1;
|
||||
PropFlags nPropertyMask = PropFlags::NONE;
|
||||
@ -311,7 +311,7 @@ namespace svt
|
||||
return aProps;
|
||||
}
|
||||
|
||||
bool OControlAccess::isControlSupported( const OUString& rControlName )
|
||||
bool OControlAccess::isControlSupported( std::u16string_view rControlName )
|
||||
{
|
||||
ControlDescription tmpDesc;
|
||||
OString aControlName = OUStringToOString(rControlName, RTL_TEXTENCODING_UTF8);
|
||||
@ -319,7 +319,7 @@ namespace svt
|
||||
return ::std::binary_search( s_pControls, s_pControlsEnd, tmpDesc, ControlDescriptionLookup() );
|
||||
}
|
||||
|
||||
bool OControlAccess::isControlPropertySupported( const OUString& rControlName, const OUString& rControlProperty )
|
||||
bool OControlAccess::isControlPropertySupported( std::u16string_view rControlName, const OUString& rControlProperty )
|
||||
{
|
||||
// look up the control
|
||||
sal_Int16 nControlId = -1;
|
||||
|
@ -20,6 +20,10 @@
|
||||
#ifndef INCLUDED_FPICKER_SOURCE_OFFICE_OFFICECONTROLACCESS_HXX
|
||||
#define INCLUDED_FPICKER_SOURCE_OFFICE_OFFICECONTROLACCESS_HXX
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include "fileview.hxx"
|
||||
#include "pickercallbacks.hxx"
|
||||
#include <o3tl/typed_flags_set.hxx>
|
||||
@ -66,14 +70,14 @@ namespace svt
|
||||
OControlAccess( IFilePickerController* pController, SvtFileView* pFileView );
|
||||
|
||||
// XControlAccess implementation
|
||||
void setControlProperty( const OUString& rControlName, const OUString& rControlProperty, const css::uno::Any& rValue );
|
||||
css::uno::Any getControlProperty( const OUString& rControlName, const OUString& rControlProperty );
|
||||
void setControlProperty( std::u16string_view rControlName, const OUString& rControlProperty, const css::uno::Any& rValue );
|
||||
css::uno::Any getControlProperty( std::u16string_view rControlName, const OUString& rControlProperty );
|
||||
|
||||
// XControlInformation implementation
|
||||
css::uno::Sequence< OUString > getSupportedControls( ) const;
|
||||
css::uno::Sequence< OUString > getSupportedControlProperties( const OUString& rControlName );
|
||||
static bool isControlSupported( const OUString& rControlName );
|
||||
bool isControlPropertySupported( const OUString& rControlName, const OUString& rControlProperty );
|
||||
css::uno::Sequence< OUString > getSupportedControlProperties( std::u16string_view rControlName );
|
||||
static bool isControlSupported( std::u16string_view rControlName );
|
||||
bool isControlPropertySupported( std::u16string_view rControlName, const OUString& rControlProperty );
|
||||
|
||||
// XFilePickerControlAccess
|
||||
void setValue( sal_Int16 nId, sal_Int16 nCtrlAction, const css::uno::Any& rValue );
|
||||
@ -105,7 +109,7 @@ namespace svt
|
||||
weld::Widget* pControl, PropFlags nProperty, const css::uno::Any& rValue,
|
||||
bool bIgnoreIllegalArgument = true );
|
||||
|
||||
weld::Widget* implGetControl( const OUString& rControlName, sal_Int16* pId, PropFlags* pPropertyMask = nullptr ) const;
|
||||
weld::Widget* implGetControl( std::u16string_view rControlName, sal_Int16* pId, PropFlags* pPropertyMask = nullptr ) const;
|
||||
|
||||
/** implements the various methods for retrieving properties from controls
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <cppuhelper/weakref.hxx>
|
||||
|
||||
#include <deque>
|
||||
#include <string_view>
|
||||
|
||||
namespace framework{
|
||||
|
||||
@ -103,7 +104,7 @@ class InterceptionHelper final : public ::cppu::WeakImplHelper<
|
||||
@return An iterator object, which points directly to the located item inside this list.
|
||||
In case no interceptor could be found, it points to the end of this list!
|
||||
*/
|
||||
iterator findByPattern(const OUString& sURL)
|
||||
iterator findByPattern(std::u16string_view sURL)
|
||||
{
|
||||
iterator pIt;
|
||||
for (pIt=begin(); pIt!=end(); ++pIt)
|
||||
|
@ -20,6 +20,10 @@
|
||||
#ifndef INCLUDED_FRAMEWORK_INC_HELPER_PERSISTENTWINDOWSTATE_HXX
|
||||
#define INCLUDED_FRAMEWORK_INC_HELPER_PERSISTENTWINDOWSTATE_HXX
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include <com/sun/star/lang/XInitialization.hpp>
|
||||
#include <com/sun/star/frame/XFrame.hpp>
|
||||
#include <com/sun/star/frame/XFrameActionListener.hpp>
|
||||
@ -154,7 +158,7 @@ class PersistentWindowState final : public ::cppu::WeakImplHelper<
|
||||
contains the information about position and size.
|
||||
*/
|
||||
static void implst_setWindowStateOnWindow(const css::uno::Reference< css::awt::XWindow >& xWindow ,
|
||||
const OUString& sWindowState);
|
||||
std::u16string_view sWindowState);
|
||||
|
||||
}; // class PersistentWindowState
|
||||
|
||||
|
@ -222,11 +222,11 @@ OUString PersistentWindowState::implst_getWindowStateFromWindow(const css::uno::
|
||||
}
|
||||
|
||||
void PersistentWindowState::implst_setWindowStateOnWindow(const css::uno::Reference< css::awt::XWindow >& xWindow ,
|
||||
const OUString& sWindowState)
|
||||
std::u16string_view sWindowState)
|
||||
{
|
||||
if (
|
||||
(!xWindow.is() ) ||
|
||||
( sWindowState.isEmpty() )
|
||||
( sWindowState.empty() )
|
||||
)
|
||||
return;
|
||||
|
||||
|
@ -17,6 +17,10 @@
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
*/
|
||||
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <string_view>
|
||||
|
||||
#include <jobs/configaccess.hxx>
|
||||
#include <jobs/jobdata.hxx>
|
||||
#include <classes/converter.hxx>
|
||||
@ -415,15 +419,15 @@ void JobData::disableJob()
|
||||
aConfig.close();
|
||||
}
|
||||
|
||||
static bool isEnabled( const OUString& sAdminTime ,
|
||||
const OUString& sUserTime )
|
||||
static bool isEnabled( std::u16string_view sAdminTime ,
|
||||
std::u16string_view sUserTime )
|
||||
{
|
||||
/*Attention!
|
||||
To prevent interpreting of TriGraphs inside next const string value,
|
||||
we have to encode all '?' signs. Otherwise e.g. "??-" will be translated
|
||||
to "~" ...
|
||||
*/
|
||||
WildCard aISOPattern("\?\?\?\?-\?\?-\?\?*");
|
||||
WildCard aISOPattern(u"\?\?\?\?-\?\?-\?\?*");
|
||||
|
||||
bool bValidAdmin = aISOPattern.Matches(sAdminTime);
|
||||
bool bValidUser = aISOPattern.Matches(sUserTime );
|
||||
|
@ -141,7 +141,7 @@ void BasicCodeTagger::tagParagraph( xmlNodePtr paragraph )
|
||||
m_Highlighter.getHighlightPortions( strLine, portions );
|
||||
for (auto const& portion : portions)
|
||||
{
|
||||
OString sToken(OUStringToOString(strLine.copy(portion.nBegin, portion.nEnd-portion.nBegin), RTL_TEXTENCODING_UTF8));
|
||||
OString sToken(OUStringToOString(strLine.subView(portion.nBegin, portion.nEnd-portion.nBegin), RTL_TEXTENCODING_UTF8));
|
||||
xmlNodePtr text = xmlNewText(reinterpret_cast<const xmlChar*>(sToken.getStr()));
|
||||
if ( portion.tokenType != TokenType::Whitespace )
|
||||
{
|
||||
|
@ -847,10 +847,10 @@ HelpProcessingErrorInfo& HelpProcessingErrorInfo::operator=( const struct HelpPr
|
||||
bool compileExtensionHelp
|
||||
(
|
||||
const OUString& aOfficeHelpPath,
|
||||
const OUString& aExtensionName,
|
||||
std::u16string_view aExtensionName,
|
||||
const OUString& aExtensionLanguageRoot,
|
||||
sal_Int32 nXhpFileCount, const OUString* pXhpFiles,
|
||||
const OUString& aDestination,
|
||||
std::u16string_view aDestination,
|
||||
HelpProcessingErrorInfo& o_rHelpProcessingErrorInfo
|
||||
)
|
||||
{
|
||||
|
@ -1416,8 +1416,8 @@ LanguageType MsLangId::Conversion::convertIsoNamesToLanguage( const OUString& rL
|
||||
|
||||
|
||||
// static
|
||||
LanguageType MsLangId::Conversion::convertIsoNamesToLanguage( const OString& rLang,
|
||||
const OString& rCountry )
|
||||
LanguageType MsLangId::Conversion::convertIsoNamesToLanguage( std::string_view rLang,
|
||||
std::string_view rCountry )
|
||||
{
|
||||
OUString aLang = OStringToOUString( rLang, RTL_TEXTENCODING_ASCII_US);
|
||||
OUString aCountry = OStringToOUString( rCountry, RTL_TEXTENCODING_ASCII_US);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user