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
c0afcc0f
Kaydet (Commit)
c0afcc0f
authored
Eki 05, 2013
tarafından
Matteo Casalin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
This does not need to be a member function
Change-Id: I4d008ac516c66243d436a3afe3322ba1b6c9ef22
üst
4106979a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
44 deletions
+45
-44
ndgrf.hxx
sw/inc/ndgrf.hxx
+0
-4
ndgrf.cxx
sw/source/core/graphic/ndgrf.cxx
+45
-40
No files found.
sw/inc/ndgrf.hxx
Dosyayı görüntüle @
c0afcc0f
...
...
@@ -78,10 +78,6 @@ class SW_DLLPUBLIC SwGrfNode: public SwNoTxtNode
/** adjust return type and rename method to
indicate that its an private one. */
/** embedded graphic stream couldn't be inside a 3.1 - 5.2 storage any more.
Thus, return value isn't needed any more. */
void
_GetStreamStorageNames
(
String
&
rStrmName
,
String
&
rStgName
)
const
;
void
DelStreamName
();
DECL_LINK
(
SwapGraphic
,
GraphicObject
*
);
...
...
sw/source/core/graphic/ndgrf.cxx
Dosyayı görüntüle @
c0afcc0f
...
...
@@ -463,6 +463,47 @@ sal_Bool SwGrfNode::ImportGraphic( SvStream& rStrm )
return
sal_False
;
}
namespace
{
void
lcl_GetStreamStorageNames
(
String
aUserData
,
String
&
rStrmName
,
String
&
rStorName
)
{
rStorName
.
Erase
();
rStrmName
.
Erase
();
if
(
!
aUserData
.
Len
()
)
return
;
String
aProt
(
"vnd.sun.star.Package:"
);
if
(
0
==
aUserData
.
CompareTo
(
aProt
,
aProt
.
Len
()
)
)
{
// 6.0 (XML) Package
xub_StrLen
nPos
=
aUserData
.
Search
(
'/'
);
if
(
STRING_NOTFOUND
==
nPos
)
{
rStrmName
=
aUserData
.
Copy
(
aProt
.
Len
()
);
}
else
{
xub_StrLen
nPathStart
=
aProt
.
Len
();
if
(
0
==
aUserData
.
CompareToAscii
(
"./"
,
2
)
)
nPathStart
+=
2
;
rStorName
=
aUserData
.
Copy
(
nPathStart
,
nPos
-
nPathStart
);
rStrmName
=
aUserData
.
Copy
(
nPos
+
1
);
}
}
else
{
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
(
'/'
),
"invalid graphic stream name"
);
}
}
/**
* @return -1 if ReRead successful,
* 1 if reading successful,
...
...
@@ -514,7 +555,7 @@ short SwGrfNode::SwapIn( sal_Bool bWaitForData )
try
{
String
aStrmName
,
aPicStgName
;
_GetStreamStorageNames
(
aStrmName
,
aPicStgName
);
lcl_GetStreamStorageNames
(
maGrfObj
.
GetUserData
(),
aStrmName
,
aPicStgName
);
uno
::
Reference
<
embed
::
XStorage
>
refPics
=
_GetDocSubstorageOrRoot
(
aPicStgName
);
SvStream
*
pStrm
=
_GetStreamForEmbedGrf
(
refPics
,
aStrmName
);
if
(
pStrm
)
...
...
@@ -776,7 +817,7 @@ void SwGrfNode::DelStreamName()
try
{
String
aPicStgName
,
aStrmName
;
_GetStreamStorageNames
(
aStrmName
,
aPicStgName
);
lcl_GetStreamStorageNames
(
maGrfObj
.
GetUserData
(),
aStrmName
,
aPicStgName
);
uno
::
Reference
<
embed
::
XStorage
>
refPics
=
xDocStg
;
if
(
aPicStgName
.
Len
()
)
refPics
=
xDocStg
->
openStorageElement
(
aPicStgName
,
embed
::
ElementModes
::
READWRITE
);
...
...
@@ -870,42 +911,6 @@ SvStream* SwGrfNode::_GetStreamForEmbedGrf(
return
pStrm
;
}
void
SwGrfNode
::
_GetStreamStorageNames
(
String
&
rStrmName
,
String
&
rStorName
)
const
{
rStorName
.
Erase
();
rStrmName
.
Erase
();
String
aUserData
(
maGrfObj
.
GetUserData
()
);
if
(
!
aUserData
.
Len
()
)
return
;
String
aProt
(
"vnd.sun.star.Package:"
);
if
(
0
==
aUserData
.
CompareTo
(
aProt
,
aProt
.
Len
()
)
)
{
// 6.0 (XML) Package
xub_StrLen
nPos
=
aUserData
.
Search
(
'/'
);
if
(
STRING_NOTFOUND
==
nPos
)
{
rStrmName
=
aUserData
.
Copy
(
aProt
.
Len
()
);
}
else
{
xub_StrLen
nPathStart
=
aProt
.
Len
();
if
(
0
==
aUserData
.
CompareToAscii
(
"./"
,
2
)
)
nPathStart
+=
2
;
rStorName
=
aUserData
.
Copy
(
nPathStart
,
nPos
-
nPathStart
);
rStrmName
=
aUserData
.
Copy
(
nPos
+
1
);
}
}
else
{
OSL_FAIL
(
"<SwGrfNode::_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
(
'/'
),
"invalid graphic stream name"
);
}
SwCntntNode
*
SwGrfNode
::
MakeCopy
(
SwDoc
*
pDoc
,
const
SwNodeIndex
&
rIdx
)
const
{
// copy formats into the other document
...
...
@@ -918,7 +923,7 @@ SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const
try
{
String
aStrmName
,
aPicStgName
;
_GetStreamStorageNames
(
aStrmName
,
aPicStgName
);
lcl_GetStreamStorageNames
(
maGrfObj
.
GetUserData
(),
aStrmName
,
aPicStgName
);
uno
::
Reference
<
embed
::
XStorage
>
refPics
=
_GetDocSubstorageOrRoot
(
aPicStgName
);
SvStream
*
pStrm
=
_GetStreamForEmbedGrf
(
refPics
,
aStrmName
);
if
(
pStrm
)
...
...
@@ -998,7 +1003,7 @@ IMPL_LINK( SwGrfNode, SwapGraphic, GraphicObject*, pGrfObj )
try
{
String
aStrmName
,
aPicStgName
;
_GetStreamStorageNames
(
aStrmName
,
aPicStgName
);
lcl_GetStreamStorageNames
(
maGrfObj
.
GetUserData
(),
aStrmName
,
aPicStgName
);
uno
::
Reference
<
embed
::
XStorage
>
refPics
=
_GetDocSubstorageOrRoot
(
aPicStgName
);
SvStream
*
pStrm
=
_GetStreamForEmbedGrf
(
refPics
,
aStrmName
);
if
(
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