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
f37bb5d4
Kaydet (Commit)
f37bb5d4
authored
Eki 05, 2013
tarafından
Matteo Casalin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
String to OUString + use return instead of reference args
Change-Id: I0c0857b4b4ac87586675e8540ef5135dbce82b5c
üst
74c7539c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
35 deletions
+33
-35
ndgrf.cxx
sw/source/core/graphic/ndgrf.cxx
+33
-35
No files found.
sw/source/core/graphic/ndgrf.cxx
Dosyayı görüntüle @
f37bb5d4
...
@@ -466,40 +466,42 @@ sal_Bool SwGrfNode::ImportGraphic( SvStream& rStrm )
...
@@ -466,40 +466,42 @@ sal_Bool SwGrfNode::ImportGraphic( SvStream& rStrm )
namespace
namespace
{
{
void
lcl_GetStreamStorageNames
(
String
aUserData
,
struct
StreamAndStorageNames
String
&
rStrmName
,
String
&
rStorName
)
{
{
rStorName
.
Erase
();
OUString
sStream
;
rStrmName
.
Erase
();
OUString
sStorage
;
};
if
(
!
aUserData
.
Len
()
)
StreamAndStorageNames
lcl_GetStreamStorageNames
(
OUString
aUserData
)
return
;
{
StreamAndStorageNames
aNames
;
if
(
aUserData
.
isEmpty
()
)
return
aNames
;
String
aProt
(
"vnd.sun.star.Package:"
);
const
OU
String
aProt
(
"vnd.sun.star.Package:"
);
if
(
0
==
aUserData
.
CompareTo
(
aProt
,
aProt
.
Len
()
)
)
if
(
aUserData
.
startsWith
(
aProt
)
)
{
{
// 6.0 (XML) Package
// 6.0 (XML) Package
xub_StrLen
nPos
=
aUserData
.
Search
(
'/'
);
const
sal_Int32
nPos
=
aUserData
.
indexOf
(
'/'
);
if
(
STRING_NOTFOUND
==
nPos
)
if
(
nPos
<
0
)
{
{
rStrmName
=
aUserData
.
Copy
(
aProt
.
Len
()
);
aNames
.
sStream
=
aUserData
.
copy
(
aProt
.
getLength
()
);
}
}
else
else
{
{
xub_StrLen
nPathStart
=
aProt
.
Len
();
sal_Int32
nPathStart
=
aProt
.
getLength
();
if
(
0
==
aUserData
.
CompareToAscii
(
"./"
,
2
)
)
if
(
aUserData
.
startsWith
(
"./"
)
)
nPathStart
+=
2
;
nPathStart
+=
2
;
rStorName
=
aUserData
.
C
opy
(
nPathStart
,
nPos
-
nPathStart
);
aNames
.
sStorage
=
aUserData
.
c
opy
(
nPathStart
,
nPos
-
nPathStart
);
rStrmName
=
aUserData
.
C
opy
(
nPos
+
1
);
aNames
.
sStream
=
aUserData
.
c
opy
(
nPos
+
1
);
}
}
}
}
else
else
{
{
OSL_FAIL
(
"<lcl_GetStreamStorageNames(..)> - unknown graphic URL type. Code for handling 3.1 - 5.2 storages has been deleted by issue i53025."
);
OSL_FAIL
(
"<lcl_GetStreamStorageNames(..)> - unknown graphic URL type. Code for handling 3.1 - 5.2 storages has been deleted by issue i53025."
);
}
}
OSL_ENSURE
(
STRING_NOTFOUND
==
rStrmName
.
Search
(
'/'
),
OSL_ENSURE
(
aNames
.
sStream
.
indexOf
(
'/'
)
<
0
,
"invalid graphic stream name"
);
"invalid graphic stream name"
)
;
return
aNames
;
}
}
}
}
...
@@ -554,10 +556,9 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
...
@@ -554,10 +556,9 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
{
{
try
try
{
{
String
aStrmName
,
aPicStgName
;
const
StreamAndStorageNames
aNames
=
lcl_GetStreamStorageNames
(
maGrfObj
.
GetUserData
()
);
lcl_GetStreamStorageNames
(
maGrfObj
.
GetUserData
(),
aStrmName
,
aPicStgName
);
uno
::
Reference
<
embed
::
XStorage
>
refPics
=
_GetDocSubstorageOrRoot
(
aNames
.
sStorage
);
uno
::
Reference
<
embed
::
XStorage
>
refPics
=
_GetDocSubstorageOrRoot
(
aPicStgName
);
SvStream
*
pStrm
=
_GetStreamForEmbedGrf
(
refPics
,
aNames
.
sStream
);
SvStream
*
pStrm
=
_GetStreamForEmbedGrf
(
refPics
,
aStrmName
);
if
(
pStrm
)
if
(
pStrm
)
{
{
if
(
ImportGraphic
(
*
pStrm
)
)
if
(
ImportGraphic
(
*
pStrm
)
)
...
@@ -816,12 +817,11 @@ void SwGrfNode::DelStreamName()
...
@@ -816,12 +817,11 @@ void SwGrfNode::DelStreamName()
{
{
try
try
{
{
String
aPicStgName
,
aStrmName
;
const
StreamAndStorageNames
aNames
=
lcl_GetStreamStorageNames
(
maGrfObj
.
GetUserData
()
);
lcl_GetStreamStorageNames
(
maGrfObj
.
GetUserData
(),
aStrmName
,
aPicStgName
);
uno
::
Reference
<
embed
::
XStorage
>
refPics
=
xDocStg
;
uno
::
Reference
<
embed
::
XStorage
>
refPics
=
xDocStg
;
if
(
aPicStgName
.
Len
()
)
if
(
!
aNames
.
sStorage
.
isEmpty
()
)
refPics
=
xDocStg
->
openStorageElement
(
a
PicStgNam
e
,
embed
::
ElementModes
::
READWRITE
);
refPics
=
xDocStg
->
openStorageElement
(
a
Names
.
sStorag
e
,
embed
::
ElementModes
::
READWRITE
);
refPics
->
removeElement
(
a
StrmName
);
refPics
->
removeElement
(
a
Names
.
sStream
);
uno
::
Reference
<
embed
::
XTransactedObject
>
xTrans
(
refPics
,
uno
::
UNO_QUERY
);
uno
::
Reference
<
embed
::
XTransactedObject
>
xTrans
(
refPics
,
uno
::
UNO_QUERY
);
if
(
xTrans
.
is
()
)
if
(
xTrans
.
is
()
)
xTrans
->
commit
();
xTrans
->
commit
();
...
@@ -923,10 +923,9 @@ SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
...
@@ -923,10 +923,9 @@ SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
{
{
try
try
{
{
String
aStrmName
,
aPicStgName
;
const
StreamAndStorageNames
aNames
=
lcl_GetStreamStorageNames
(
maGrfObj
.
GetUserData
()
);
lcl_GetStreamStorageNames
(
maGrfObj
.
GetUserData
(),
aStrmName
,
aPicStgName
);
uno
::
Reference
<
embed
::
XStorage
>
refPics
=
_GetDocSubstorageOrRoot
(
aNames
.
sStorage
);
uno
::
Reference
<
embed
::
XStorage
>
refPics
=
_GetDocSubstorageOrRoot
(
aPicStgName
);
SvStream
*
pStrm
=
_GetStreamForEmbedGrf
(
refPics
,
aNames
.
sStream
);
SvStream
*
pStrm
=
_GetStreamForEmbedGrf
(
refPics
,
aStrmName
);
if
(
pStrm
)
if
(
pStrm
)
{
{
const
OUString
aURL
(
maGrfObj
.
GetUserData
());
const
OUString
aURL
(
maGrfObj
.
GetUserData
());
...
@@ -1003,10 +1002,9 @@ IMPL_LINK( SwGrfNode, SwapGraphic, GraphicObject*, pGrfObj )
...
@@ -1003,10 +1002,9 @@ IMPL_LINK( SwGrfNode, SwapGraphic, GraphicObject*, pGrfObj )
{
{
try
try
{
{
String
aStrmName
,
aPicStgName
;
const
StreamAndStorageNames
aNames
=
lcl_GetStreamStorageNames
(
maGrfObj
.
GetUserData
()
);
lcl_GetStreamStorageNames
(
maGrfObj
.
GetUserData
(),
aStrmName
,
aPicStgName
);
uno
::
Reference
<
embed
::
XStorage
>
refPics
=
_GetDocSubstorageOrRoot
(
aNames
.
sStorage
);
uno
::
Reference
<
embed
::
XStorage
>
refPics
=
_GetDocSubstorageOrRoot
(
aPicStgName
);
SvStream
*
pStrm
=
_GetStreamForEmbedGrf
(
refPics
,
aNames
.
sStream
);
SvStream
*
pStrm
=
_GetStreamForEmbedGrf
(
refPics
,
aStrmName
);
if
(
pStrm
)
if
(
pStrm
)
{
{
if
(
pGrfObj
->
IsInSwapOut
()
)
if
(
pGrfObj
->
IsInSwapOut
()
)
...
...
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