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

various warnings

Change-Id: I1e4f6920601bad273b5255defc9377ef303083fc
üst feab17bc
...@@ -1669,7 +1669,7 @@ void SmViewShell::Execute(SfxRequest& rReq) ...@@ -1669,7 +1669,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
SfxMedium* pClipboardMedium = new SfxMedium(); SfxMedium* pClipboardMedium = new SfxMedium();
pClipboardMedium->GetItemSet(); //generate initial itemset, not sure if necessary pClipboardMedium->GetItemSet(); //generate initial itemset, not sure if necessary
const SfxFilter* pMathFilter = const SfxFilter* pMathFilter =
SfxFilter::GetFilterByName(OUString::createFromAscii(MATHML_XML)); SfxFilter::GetFilterByName(MATHML_XML);
pClipboardMedium->SetFilter(pMathFilter); pClipboardMedium->SetFilter(pMathFilter);
pClipboardMedium->setStreamToLoadFrom(xStrm, true /*bIsReadOnly*/); pClipboardMedium->setStreamToLoadFrom(xStrm, true /*bIsReadOnly*/);
InsertFrom(*pClipboardMedium); InsertFrom(*pClipboardMedium);
...@@ -1688,14 +1688,14 @@ void SmViewShell::Execute(SfxRequest& rReq) ...@@ -1688,14 +1688,14 @@ void SmViewShell::Execute(SfxRequest& rReq)
SfxMedium* pClipboardMedium = new SfxMedium(); SfxMedium* pClipboardMedium = new SfxMedium();
pClipboardMedium->GetItemSet(); //generates initial itemset, not sure if necessary pClipboardMedium->GetItemSet(); //generates initial itemset, not sure if necessary
const SfxFilter* pMathFilter = const SfxFilter* pMathFilter =
SfxFilter::GetFilterByName(OUString::createFromAscii(MATHML_XML)); SfxFilter::GetFilterByName(MATHML_XML);
pClipboardMedium->SetFilter(pMathFilter); pClipboardMedium->SetFilter(pMathFilter);
SvMemoryStream * pStrm; SvMemoryStream * pStrm;
// The text to be imported might asserts encoding like 'encoding="utf-8"' but FORMAT_STRING is UTF-16. // The text to be imported might asserts encoding like 'encoding="utf-8"' but FORMAT_STRING is UTF-16.
// Force encoding to UTF-16, if encoding exists. // Force encoding to UTF-16, if encoding exists.
bool bForceUTF16 = false; bool bForceUTF16 = false;
sal_Int32 nPosL = aString.indexOf( OUString::createFromAscii("encoding=\"")); sal_Int32 nPosL = aString.indexOf("encoding=\"");
sal_Int32 nPosU = -1; sal_Int32 nPosU = -1;
if ( nPosL >= 0 && nPosL +10 < aString.getLength() ) if ( nPosL >= 0 && nPosL +10 < aString.getLength() )
{ {
...@@ -1708,12 +1708,12 @@ void SmViewShell::Execute(SfxRequest& rReq) ...@@ -1708,12 +1708,12 @@ void SmViewShell::Execute(SfxRequest& rReq)
} }
if ( bForceUTF16 ) if ( bForceUTF16 )
{ {
OUString aNewString = aString.replaceAt( nPosL,nPosU-nPosL,OUString::createFromAscii("UTF-16")); OUString aNewString = aString.replaceAt( nPosL,nPosU-nPosL,"UTF-16");
pStrm = new SvMemoryStream( (void*)aNewString.getStr(), aNewString.getLength() * sizeof(sal_Unicode), StreamMode::READ); pStrm = new SvMemoryStream( const_cast<sal_Unicode *>(aNewString.getStr()), aNewString.getLength() * sizeof(sal_Unicode), StreamMode::READ);
} }
else else
{ {
pStrm = new SvMemoryStream( (void*)aString.getStr(), aString.getLength() * sizeof(sal_Unicode), StreamMode::READ); pStrm = new SvMemoryStream( const_cast<sal_Unicode *>(aString.getStr()), aString.getLength() * sizeof(sal_Unicode), StreamMode::READ);
} }
uno::Reference<io::XInputStream> xStrm2( new ::utl::OInputStreamWrapper(*pStrm) ); uno::Reference<io::XInputStream> xStrm2( new ::utl::OInputStreamWrapper(*pStrm) );
pClipboardMedium->setStreamToLoadFrom(xStrm2, true /*bIsReadOnly*/); pClipboardMedium->setStreamToLoadFrom(xStrm2, true /*bIsReadOnly*/);
......
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