Kaydet (Commit) bad606fe authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Clean up uses of SAL_U/SAL_W: embedserv

Change-Id: I5a73acf6ccfc1709e95e55fa15c32ec6dda2657a
üst cf59d64a
......@@ -46,11 +46,9 @@ STDMETHODIMP EmbedDocument_Impl::SetHostNames( LPCOLESTR szContainerApp, LPCOLES
if ( !m_aFileName.getLength() )
{
m_pDocHolder->setTitle(
OUString(
SAL_U(szContainerObj)));
OUString(reinterpret_cast<sal_Unicode const *>(szContainerObj)));
m_pDocHolder->setContainerName(
OUString(
SAL_U(szContainerApp)));
OUString(reinterpret_cast<sal_Unicode const *>(szContainerApp)));
}
return S_OK;
......@@ -424,7 +422,8 @@ HRESULT EmbedDocument_Impl::SaveObject()
// in case of links the containers does not provide client site sometimes
hr = Save( static_cast<LPCOLESTR>(nullptr), FALSE ); // triggers saving to the link location
SaveCompleted( SAL_W(aPreservFileName.getStr()) );
SaveCompleted(
reinterpret_cast<wchar_t const *>(aPreservFileName.getStr()));
}
notify( false );
......
......@@ -37,6 +37,7 @@
#include <com/sun/star/util/XURLTransformer.hpp>
#include <comphelper/processfactory.hxx>
#include <o3tl/string_view.hxx>
#include <osl/mutex.hxx>
#include <osl/diagnose.h>
#include <sal/types.h>
......@@ -399,7 +400,7 @@ STDMETHODIMP EmbedDocument_Impl::InitNew( IStorage *pStg )
if ( m_xFactory.is() && pStg )
{
uno::Reference< frame::XModel > aDocument(
m_xFactory->createInstance( getServiceNameFromGUID_Impl( &m_guid ) ),
m_xFactory->createInstance( o3tl::toOUString(getServiceNameFromGUID_Impl( &m_guid )) ),
uno::UNO_QUERY );
if ( aDocument.is() )
{
......@@ -421,11 +422,11 @@ STDMETHODIMP EmbedDocument_Impl::InitNew( IStorage *pStg )
if ( hr == S_OK )
{
OUString aCurType = getStorageTypeFromGUID_Impl( &m_guid ); // ???
wchar_t const * aCurType = getStorageTypeFromGUID_Impl( &m_guid ); // ???
CLIPFORMAT cf = (CLIPFORMAT)RegisterClipboardFormatA( "Embedded Object" );
hr = WriteFmtUserTypeStg( pStg,
cf, // ???
SAL_W(const_cast<sal_Unicode *>(aCurType.getStr())) );
const_cast<wchar_t *>(aCurType) );
if ( hr == S_OK )
{
......@@ -534,7 +535,7 @@ STDMETHODIMP EmbedDocument_Impl::Load( IStorage *pStg )
if ( xTempIn.is() )
{
uno::Reference< frame::XModel > aDocument(
m_xFactory->createInstance( getServiceNameFromGUID_Impl( &m_guid ) ),
m_xFactory->createInstance( o3tl::toOUString(getServiceNameFromGUID_Impl( &m_guid )) ),
uno::UNO_QUERY );
if ( aDocument.is() )
{
......@@ -749,11 +750,11 @@ STDMETHODIMP EmbedDocument_Impl::Load( LPCOLESTR pszFileName, DWORD /*dwMode*/ )
if ( FAILED( hr ) || !m_pMasterStorage ) return E_FAIL;
OUString aCurType = getServiceNameFromGUID_Impl( &m_guid ); // ???
o3tl::u16string_view aCurType = getServiceNameFromGUID_Impl( &m_guid ); // ???
CLIPFORMAT cf = (CLIPFORMAT)RegisterClipboardFormatA( "Embedded Object" );
hr = WriteFmtUserTypeStg( m_pMasterStorage,
cf, // ???
SAL_W(const_cast<sal_Unicode *>(aCurType.getStr())) );
const_cast<wchar_t *>(reinterpret_cast<wchar_t const *>(aCurType.data())) );
if ( FAILED( hr ) ) return E_FAIL;
hr = m_pMasterStorage->SetClass( m_guid );
......@@ -775,7 +776,7 @@ STDMETHODIMP EmbedDocument_Impl::Load( LPCOLESTR pszFileName, DWORD /*dwMode*/ )
uno::Reference< frame::XModel > aDocument(
m_xFactory->createInstance( getServiceNameFromGUID_Impl( &m_guid ) ),
m_xFactory->createInstance( o3tl::toOUString(getServiceNameFromGUID_Impl( &m_guid )) ),
uno::UNO_QUERY );
if ( aDocument.is() )
{
......@@ -804,7 +805,7 @@ STDMETHODIMP EmbedDocument_Impl::Load( LPCOLESTR pszFileName, DWORD /*dwMode*/ )
cf = (CLIPFORMAT)RegisterClipboardFormatA( "Embedded Object" );
hr = WriteFmtUserTypeStg( m_pMasterStorage,
cf, // ???
SAL_W(const_cast<sal_Unicode *>(aCurType.getStr())) );
const_cast<wchar_t *>(reinterpret_cast<wchar_t const *>(aCurType.data())) );
if ( SUCCEEDED( hr ) )
{
......
......@@ -26,74 +26,74 @@
#include <guid.hxx>
OUString getStorageTypeFromGUID_Impl( GUID* guid )
wchar_t const * getStorageTypeFromGUID_Impl( GUID* guid )
{
if ( *guid == OID_WriterTextServer )
return OUString( "soffice.StarWriterDocument.6" );
return L"soffice.StarWriterDocument.6";
if ( *guid == OID_WriterOASISTextServer )
return OUString( "LibreOffice.WriterDocument.1" );
return L"LibreOffice.WriterDocument.1";
if ( *guid == OID_CalcServer )
return OUString( "soffice.StarCalcDocument.6" );
return L"soffice.StarCalcDocument.6";
if ( *guid == OID_CalcOASISServer )
return OUString( "LibreOffice.CalcDocument.1" );
return L"LibreOffice.CalcDocument.1";
if ( *guid == OID_DrawingServer )
return OUString( "soffice.StarDrawDocument.6" );
return L"soffice.StarDrawDocument.6";
if ( *guid == OID_DrawingOASISServer )
return OUString( "LibreOffice.DrawDocument.1" );
return L"LibreOffice.DrawDocument.1";
if ( *guid == OID_PresentationServer )
return OUString( "soffice.StarImpressDocument.6" );
return L"soffice.StarImpressDocument.6";
if ( *guid == OID_PresentationOASISServer )
return OUString( "LibreOffice.ImpressDocument.1" );
return L"LibreOffice.ImpressDocument.1";
if ( *guid == OID_MathServer )
return OUString( "soffice.StarMathDocument.6" );
return L"soffice.StarMathDocument.6";
if ( *guid == OID_MathOASISServer )
return OUString( "LibreOffice.MathDocument.1" );
return L"LibreOffice.MathDocument.1";
return OUString();
return L"";
}
OUString getServiceNameFromGUID_Impl( GUID* guid )
o3tl::u16string_view getServiceNameFromGUID_Impl( GUID* guid )
{
if ( *guid == OID_WriterTextServer )
return OUString( "com.sun.star.comp.Writer.TextDocument" );
return u"com.sun.star.comp.Writer.TextDocument";
if ( *guid == OID_WriterOASISTextServer )
return OUString( "com.sun.star.comp.Writer.TextDocument" );
return u"com.sun.star.comp.Writer.TextDocument";
if ( *guid == OID_CalcServer )
return OUString( "com.sun.star.comp.Calc.SpreadsheetDocument" );
return u"com.sun.star.comp.Calc.SpreadsheetDocument";
if ( *guid == OID_CalcOASISServer )
return OUString( "com.sun.star.comp.Calc.SpreadsheetDocument" );
return u"com.sun.star.comp.Calc.SpreadsheetDocument";
if ( *guid == OID_DrawingServer )
return OUString( "com.sun.star.comp.Draw.DrawingDocument" );
return u"com.sun.star.comp.Draw.DrawingDocument";
if ( *guid == OID_DrawingOASISServer )
return OUString( "com.sun.star.comp.Draw.DrawingDocument" );
return u"com.sun.star.comp.Draw.DrawingDocument";
if ( *guid == OID_PresentationServer )
return OUString( "com.sun.star.comp.Draw.PresentationDocument" );
return u"com.sun.star.comp.Draw.PresentationDocument";
if ( *guid == OID_PresentationOASISServer )
return OUString( "com.sun.star.comp.Draw.PresentationDocument" );
return u"com.sun.star.comp.Draw.PresentationDocument";
if ( *guid == OID_MathServer )
return OUString( "com.sun.star.comp.Math.FormulaDocument" );
return u"com.sun.star.comp.Math.FormulaDocument";
if ( *guid == OID_MathOASISServer )
return OUString( "com.sun.star.comp.Math.FormulaDocument" );
return u"com.sun.star.comp.Math.FormulaDocument";
return OUString();
return u"";
}
OUString getFilterNameFromGUID_Impl( GUID* guid )
......
......@@ -22,15 +22,16 @@
#include <sal/config.h>
#include <o3tl/string_view.hxx>
#include <rtl/ustring.hxx>
#include <common.h>
OUString getFilterNameFromGUID_Impl( GUID* );
OUString getServiceNameFromGUID_Impl( GUID* );
o3tl::u16string_view getServiceNameFromGUID_Impl( GUID* );
OUString getStorageTypeFromGUID_Impl( GUID* guid );
wchar_t const * getStorageTypeFromGUID_Impl( GUID* guid );
#endif
......
......@@ -19,6 +19,8 @@
#include <sal/config.h>
#include <algorithm>
#include <sal/types.h>
#ifdef _MSC_VER
......@@ -540,7 +542,7 @@ void Tracker::DrawTrackerRect(
// otherwise, size depends on the style
if (m_nStyle & hatchedBorder)
{
size.cx = size.cy = max(1,GetHandleSize(&rect)-1);
size.cx = size.cy = std::max(1,GetHandleSize(&rect)-1);
InflateRect(&rect,size.cx,size.cy);
}
else
......@@ -698,7 +700,7 @@ int Tracker::GetHandleSize(LPRECT lpRect) const
if (!(m_nStyle & resizeOutside))
{
// make sure size is small enough for the size of the rect
int sizeMax = min(abs(rect->right - rect->left),
int sizeMax = std::min(abs(rect->right - rect->left),
abs(rect->bottom - rect->top));
if (size * 2 > sizeMax)
size = sizeMax / 2;
......
......@@ -35,6 +35,12 @@
#endif
#endif
#include <atlbase.h>
#if defined max
#undef max
#endif
#if defined min
#undef min
#endif
//You may derive a class from CComModule and use it if you want to override
//something, but do not change the name of _Module
extern CComModule _Module;
......
......@@ -862,6 +862,17 @@ template<> struct hash<o3tl::wstring_view> {
}
namespace o3tl {
// LO-specific convenience functions:
// For std::u16string_view, this will be provided by a (LIBO_INTERNAL_ONLY)
// rtl::OUString constructor:
inline OUString toOUString(u16string_view s)
{ return OUString(s.data(), s.size()); }
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment