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
4f4a668e
Kaydet (Commit)
4f4a668e
authored
Eyl 05, 2015
tarafından
Rosemary
Kaydeden (comit)
Markus Mohrhard
Eyl 10, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Export the module streams
Change-Id: I132c71e06307dbb0a381d85a6d2ba7a9bd1dd5ec
üst
c9efb849
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
2 deletions
+42
-2
vbaexport.cxx
oox/source/ole/vbaexport.cxx
+42
-2
No files found.
oox/source/ole/vbaexport.cxx
Dosyayı görüntüle @
4f4a668e
...
@@ -615,6 +615,28 @@ void exportDirStream(SvStream& rStrm, css::uno::Reference<css::container::XNameC
...
@@ -615,6 +615,28 @@ void exportDirStream(SvStream& rStrm, css::uno::Reference<css::container::XNameC
aCompression
.
write
();
aCompression
.
write
();
}
}
void
exportModuleStream
(
SvStream
&
rStrm
,
css
::
uno
::
Reference
<
css
::
container
::
XNameContainer
>
xNameContainer
,
OUString
aSourceCode
)
{
SvMemoryStream
aModuleStream
(
4096
,
4096
);
exportString
(
aModuleStream
,
aSourceCode
);
aModuleStream
.
Seek
(
0
);
#if VBA_EXPORT_DEBUG
const
OUString
aModuleFileName
(
"/tmp/vba_module_out.bin"
);
SvFileStream
aModuleStreamDebug
(
aModuleFileName
,
STREAM_READWRITE
);
aModuleStreamDebug
.
WriteStream
(
aModuleStream
);
aModuleStream
.
Seek
(
0
);
#endif
// the stream for the compression
SvMemoryStream
aMemoryStream
(
4096
,
4096
);
aMemoryStream
.
WriteStream
(
aModuleStream
);
VBACompression
aCompression
(
rStrm
,
aModuleStream
);
aCompression
.
write
();
}
void
exportVBAProjectStream
(
SvStream
&
rStrm
)
void
exportVBAProjectStream
(
SvStream
&
rStrm
)
{
{
rStrm
.
WriteUInt16
(
0x61CC
);
// Reserved1
rStrm
.
WriteUInt16
(
0x61CC
);
// Reserved1
...
@@ -627,18 +649,36 @@ void exportVBAProjectStream(SvStream& rStrm)
...
@@ -627,18 +649,36 @@ void exportVBAProjectStream(SvStream& rStrm)
void
VbaExport
::
exportVBA
(
SotStorage
*
pRootStorage
)
void
VbaExport
::
exportVBA
(
SotStorage
*
pRootStorage
)
{
{
css
::
uno
::
Reference
<
css
::
container
::
XNameContainer
>
xNameContainer
=
getBasicLibrary
();
css
::
uno
::
Sequence
<
OUString
>
aElementNames
=
xNameContainer
->
getElementNames
();
sal_Int32
n
=
aElementNames
.
getLength
();
// get the number of modules
// start here with the VBA export
// start here with the VBA export
SotStorage
*
pVBAStream
=
pRootStorage
->
OpenSotStorage
(
"VBA"
,
STREAM_READWRITE
);
SotStorage
*
pVBAStream
=
pRootStorage
->
OpenSotStorage
(
"VBA"
,
STREAM_READWRITE
);
SotStorageStream
*
pDirStream
=
pVBAStream
->
OpenSotStream
(
"dir"
,
STREAM_READWRITE
);
SotStorageStream
*
pDirStream
=
pVBAStream
->
OpenSotStream
(
"dir"
,
STREAM_READWRITE
);
SotStorageStream
*
pModuleStream
[
n
];
for
(
sal_Int32
i
=
0
;
i
<
n
;
++
i
)
{
pModuleStream
[
i
]
=
pVBAStream
->
OpenSotStream
(
aElementNames
[
i
],
STREAM_READWRITE
);
}
SotStorageStream
*
pVBAProjectStream
=
pVBAStream
->
OpenSotStream
(
"_VBA_PROJECT"
,
STREAM_READWRITE
);
SotStorageStream
*
pVBAProjectStream
=
pVBAStream
->
OpenSotStream
(
"_VBA_PROJECT"
,
STREAM_READWRITE
);
css
::
uno
::
Reference
<
css
::
container
::
XNameContainer
>
xNameContainer
=
getBasicLibrary
();
// export
// export
exportDirStream
(
*
pDirStream
,
xNameContainer
);
exportDirStream
(
*
pDirStream
,
xNameContainer
);
for
(
sal_Int32
i
=
0
;
i
<
n
;
++
i
)
{
css
::
uno
::
Any
aCode
=
xNameContainer
->
getByName
(
aElementNames
[
i
]);
OUString
aSourceCode
;
aCode
>>=
aSourceCode
;
exportModuleStream
(
*
pModuleStream
[
i
],
xNameContainer
,
aSourceCode
);
}
exportVBAProjectStream
(
*
pVBAProjectStream
);
exportVBAProjectStream
(
*
pVBAProjectStream
);
pVBAProjectStream
->
Commit
();
pVBAProjectStream
->
Commit
();
for
(
sal_Int32
i
=
0
;
i
<
n
;
i
++
)
{
pModuleStream
[
i
]
->
Commit
();
}
pDirStream
->
Commit
();
pDirStream
->
Commit
();
pVBAStream
->
Commit
();
pVBAStream
->
Commit
();
pRootStorage
->
Commit
();
pRootStorage
->
Commit
();
...
...
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