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
1babe37e
Kaydet (Commit)
1babe37e
authored
Agu 28, 2014
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use comphelper::SequenceAsHashMap
Change-Id: I21302361e89b9f01af04cf1a1ed78627097b9d8c
üst
2c8b1d76
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
33 deletions
+11
-33
OLEHandler.cxx
writerfilter/source/dmapper/OLEHandler.cxx
+11
-33
No files found.
writerfilter/source/dmapper/OLEHandler.cxx
Dosyayı görüntüle @
1babe37e
...
...
@@ -184,24 +184,16 @@ void OLEHandler::lcl_sprm(Sprm & rSprm)
void
OLEHandler
::
saveInteropProperties
(
uno
::
Reference
<
text
::
XTextDocument
>
const
&
xTextDocument
,
const
OUString
&
sObjectName
,
const
OUString
&
sOldObjectName
)
{
const
OUString
sGrabBagPropName
=
UNO_NAME_MISC_OBJ_INTEROPGRABBAG
;
const
OUString
sEmbeddingsPropName
=
"EmbeddedObjects"
;
static
const
OUString
sEmbeddingsPropName
=
"EmbeddedObjects"
;
// get interop grab bag from document
uno
::
Reference
<
beans
::
XPropertySet
>
xDocProps
(
xTextDocument
,
uno
::
UNO_QUERY
);
uno
::
Sequence
<
beans
::
PropertyValue
>
aGrabBag
;
xDocProps
->
getPropertyValue
(
sGrabBagPropName
)
>>=
aGrabBag
;
comphelper
::
SequenceAsHashMap
aGrabBag
(
xDocProps
->
getPropertyValue
(
UNO_NAME_MISC_OBJ_INTEROPGRABBAG
));
// get EmbeddedObjects property inside grab bag
sal_Int32
i
=
0
;
sal_Int32
nBagLength
=
aGrabBag
.
getLength
();
uno
::
Sequence
<
beans
::
PropertyValue
>
objectsList
;
for
(
;
i
<
nBagLength
;
++
i
)
if
(
aGrabBag
[
i
].
Name
==
sEmbeddingsPropName
)
{
aGrabBag
[
i
].
Value
>>=
objectsList
;
break
;
}
comphelper
::
SequenceAsHashMap
objectsList
;
if
(
aGrabBag
.
find
(
sEmbeddingsPropName
)
!=
aGrabBag
.
end
())
objectsList
<<
aGrabBag
[
sEmbeddingsPropName
];
uno
::
Sequence
<
beans
::
PropertyValue
>
aGrabBagAttribute
(
2
);
aGrabBagAttribute
[
0
].
Name
=
"ProgID"
;
...
...
@@ -209,35 +201,21 @@ void OLEHandler::saveInteropProperties(uno::Reference<text::XTextDocument> const
aGrabBagAttribute
[
1
].
Name
=
"DrawAspect"
;
aGrabBagAttribute
[
1
].
Value
=
uno
::
Any
(
m_sDrawAspect
);
// save ProgID of current object
sal_Int32
length
=
objectsList
.
getLength
();
// If we got an "old name", erase that first.
if
(
!
sOldObjectName
.
isEmpty
())
{
comphelper
::
SequenceAsHashMap
aMap
(
objectsList
);
comphelper
::
SequenceAsHashMap
::
iterator
it
=
aMap
.
find
(
sOldObjectName
);
if
(
it
!=
aMap
.
end
())
aMap
.
erase
(
it
);
objectsList
=
aMap
.
getAsConstPropertyValueList
();
comphelper
::
SequenceAsHashMap
::
iterator
it
=
objectsList
.
find
(
sOldObjectName
);
if
(
it
!=
objectsList
.
end
())
objectsList
.
erase
(
it
);
}
objectsList
.
realloc
(
length
+
1
);
objectsList
[
length
].
Name
=
sObjectName
;
objectsList
[
length
].
Value
=
uno
::
Any
(
aGrabBagAttribute
);
objectsList
[
sObjectName
]
=
uno
::
Any
(
aGrabBagAttribute
);
// put objects list back into the grab bag
if
(
i
==
nBagLength
)
{
aGrabBag
.
realloc
(
nBagLength
+
1
);
aGrabBag
[
nBagLength
].
Name
=
sEmbeddingsPropName
;
aGrabBag
[
nBagLength
].
Value
=
uno
::
Any
(
objectsList
);
}
else
aGrabBag
[
i
].
Value
=
uno
::
Any
(
objectsList
);
aGrabBag
[
sEmbeddingsPropName
]
=
uno
::
Any
(
objectsList
.
getAsConstPropertyValueList
());
// put grab bag back into the document
xDocProps
->
setPropertyValue
(
sGrabBagPropName
,
uno
::
Any
(
aGrabBag
)
);
xDocProps
->
setPropertyValue
(
UNO_NAME_MISC_OBJ_INTEROPGRABBAG
,
uno
::
Any
(
aGrabBag
.
getAsConstPropertyValueList
())
);
}
void
OLEHandler
::
importStream
(
uno
::
Reference
<
uno
::
XComponentContext
>
xComponentContext
,
uno
::
Reference
<
text
::
XTextDocument
>
xTextDocument
,
uno
::
Reference
<
text
::
XTextContent
>
xOLE
)
...
...
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