Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
d7194ade
Kaydet (Commit)
d7194ade
authored
Tem 10, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use std::unique_ptr in SmViewShell::Execute()
Change-Id: I8593c87f7a580e09d689df4cfdfecc8947f86159
üst
ebb5068a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
8 deletions
+5
-8
view.cxx
starmath/source/view.cxx
+5
-8
No files found.
starmath/source/view.cxx
Dosyayı görüntüle @
d7194ade
...
@@ -1666,7 +1666,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
...
@@ -1666,7 +1666,7 @@ void SmViewShell::Execute(SfxRequest& rReq)
xStrm
=
aDataHelper
.
GetInputStream
(
nId
,
""
);
xStrm
=
aDataHelper
.
GetInputStream
(
nId
,
""
);
if
(
xStrm
.
is
())
if
(
xStrm
.
is
())
{
{
SfxMedium
*
pClipboardMedium
=
new
SfxMedium
(
);
std
::
unique_ptr
<
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
(
MATHML_XML
);
SfxFilter
::
GetFilterByName
(
MATHML_XML
);
...
@@ -1674,7 +1674,6 @@ void SmViewShell::Execute(SfxRequest& rReq)
...
@@ -1674,7 +1674,6 @@ void SmViewShell::Execute(SfxRequest& rReq)
pClipboardMedium
->
setStreamToLoadFrom
(
xStrm
,
true
/*bIsReadOnly*/
);
pClipboardMedium
->
setStreamToLoadFrom
(
xStrm
,
true
/*bIsReadOnly*/
);
InsertFrom
(
*
pClipboardMedium
);
InsertFrom
(
*
pClipboardMedium
);
GetDoc
()
->
UpdateText
();
GetDoc
()
->
UpdateText
();
delete
pClipboardMedium
;
}
}
}
}
else
else
...
@@ -1685,13 +1684,13 @@ void SmViewShell::Execute(SfxRequest& rReq)
...
@@ -1685,13 +1684,13 @@ void SmViewShell::Execute(SfxRequest& rReq)
::
rtl
::
OUString
aString
;
::
rtl
::
OUString
aString
;
if
(
aDataHelper
.
GetString
(
nId
,
aString
))
if
(
aDataHelper
.
GetString
(
nId
,
aString
))
{
{
SfxMedium
*
pClipboardMedium
=
new
SfxMedium
(
);
std
::
unique_ptr
<
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
(
MATHML_XML
);
SfxFilter
::
GetFilterByName
(
MATHML_XML
);
pClipboardMedium
->
SetFilter
(
pMathFilter
);
pClipboardMedium
->
SetFilter
(
pMathFilter
);
SvMemoryStream
*
pStrm
;
std
::
unique_ptr
<
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
;
...
@@ -1709,18 +1708,16 @@ void SmViewShell::Execute(SfxRequest& rReq)
...
@@ -1709,18 +1708,16 @@ void SmViewShell::Execute(SfxRequest& rReq)
if
(
bForceUTF16
)
if
(
bForceUTF16
)
{
{
OUString
aNewString
=
aString
.
replaceAt
(
nPosL
,
nPosU
-
nPosL
,
"UTF-16"
);
OUString
aNewString
=
aString
.
replaceAt
(
nPosL
,
nPosU
-
nPosL
,
"UTF-16"
);
pStrm
=
new
SvMemoryStream
(
const_cast
<
sal_Unicode
*>
(
aNewString
.
getStr
()),
aNewString
.
getLength
()
*
sizeof
(
sal_Unicode
),
StreamMode
::
READ
);
pStrm
.
reset
(
new
SvMemoryStream
(
const_cast
<
sal_Unicode
*>
(
aNewString
.
getStr
()),
aNewString
.
getLength
()
*
sizeof
(
sal_Unicode
),
StreamMode
::
READ
)
);
}
}
else
else
{
{
pStrm
=
new
SvMemoryStream
(
const_cast
<
sal_Unicode
*>
(
aString
.
getStr
()),
aString
.
getLength
()
*
sizeof
(
sal_Unicode
),
StreamMode
::
READ
);
pStrm
.
reset
(
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*/
);
InsertFrom
(
*
pClipboardMedium
);
InsertFrom
(
*
pClipboardMedium
);
GetDoc
()
->
UpdateText
();
GetDoc
()
->
UpdateText
();
delete
pClipboardMedium
;
delete
pStrm
;
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment