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
a7762b56
Kaydet (Commit)
a7762b56
authored
Ara 09, 2015
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw: move ProgId parsing to DocxExport::WriteOLEObject
Change-Id: Ieb308d717aa661fa51bd1b9dd3d0a12ca61337c1
üst
88312819
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
95 deletions
+105
-95
docxattributeoutput.cxx
sw/source/filter/ww8/docxattributeoutput.cxx
+2
-93
docxexport.cxx
sw/source/filter/ww8/docxexport.cxx
+102
-1
docxexport.hxx
sw/source/filter/ww8/docxexport.hxx
+1
-1
No files found.
sw/source/filter/ww8/docxattributeoutput.cxx
Dosyayı görüntüle @
a7762b56
...
@@ -4752,7 +4752,7 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S
...
@@ -4752,7 +4752,7 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S
OUString sObjectName = aContainer->GetEmbeddedObjectName( xObj );
OUString sObjectName = aContainer->GetEmbeddedObjectName( xObj );
// set some attributes according to the type of the embedded object
// set some attributes according to the type of the embedded object
OUString sProgID, s
MediaType, sRelationType, sFileExtension, sDrawAspect=
"Content";
OUString sProgID, s
DrawAspect =
"Content";
for( sal_Int32 i=0; i < aObjectsInteropList.getLength(); ++i )
for( sal_Int32 i=0; i < aObjectsInteropList.getLength(); ++i )
if ( aObjectsInteropList[i].Name == sObjectName )
if ( aObjectsInteropList[i].Name == sObjectName )
{
{
...
@@ -4772,99 +4772,8 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S
...
@@ -4772,99 +4772,8 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S
}
}
}
}
if( sProgID == "Excel.Sheet.12" )
{
sMediaType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
sFileExtension = "xlsx";
}
else if(sProgID.startsWith("Excel.SheetBinaryMacroEnabled.12") )
{
sMediaType = "application/vnd.ms-excel.sheet.binary.macroEnabled.12";
sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
sFileExtension = "xlsb";
}
else if( sProgID.startsWith("Excel.SheetMacroEnabled.12") )
{
sMediaType = "application/vnd.ms-excel.sheet.macroEnabled.12";
sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
sFileExtension = "xlsm";
}
else if( sProgID.startsWith("Excel.Sheet") )
{
sMediaType = "application/vnd.ms-excel";
sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject";
sFileExtension = "xls";
}
else if( sProgID == "PowerPoint.Show.12" )
{
sMediaType = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
sFileExtension = "pptx";
}
else if(sProgID == "PowerPoint.ShowMacroEnabled.12")
{
sMediaType = "application/vnd.ms-powerpoint.presentation.macroEnabled.12";
sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
sFileExtension = "pptm";
}
else if( sProgID.startsWith("PowerPoint.Show") )
{
sMediaType = "application/vnd.ms-powerpoint";
sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject";
sFileExtension = "ppt";
}
else if (sProgID.startsWith("PowerPoint.Slide.12"))
{
sMediaType = "application/vnd.openxmlformats-officedocument.presentationml.slide";
sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
sFileExtension = "sldx";
}
else if( sProgID == "PowerPoint.SlideMacroEnabled.12" )
{
sMediaType = "application/vnd.ms-powerpoint.slide.macroEnabled.12";
sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
sFileExtension = "sldm";
}
else if( sProgID == "Word.DocumentMacroEnabled.12" )
{
sMediaType = "application/vnd.ms-word.document.macroEnabled.12";
sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
sFileExtension = "docm";
}
else if (sProgID == "Word.Document.12")
{
sMediaType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
sFileExtension = "docx";
}
else if( sProgID == "Word.Document.8" )
{
sMediaType = "application/msword";
sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject";
sFileExtension = "doc";
}
else if( sProgID == "Excel.Chart.8" )
{
sMediaType = "application/vnd.ms-excel";
sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject";
sFileExtension = "xls";
}
else if (sProgID == "AcroExch.Document.11")
{
sMediaType = "application/pdf";
sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject";
sFileExtension = "pdf";
}
else
{
sMediaType = "application/vnd.openxmlformats-officedocument.oleObject";
sRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject";
sFileExtension = "bin";
}
// write embedded file
// write embedded file
OString sId = m_rExport.WriteOLEObject(
aObject, sMediaType, sRelationType, sFileExtension
);
OString sId = m_rExport.WriteOLEObject(
aObject, sProgID
);
if( sId.isEmpty() )
if( sId.isEmpty() )
{
{
...
...
sw/source/filter/ww8/docxexport.cxx
Dosyayı görüntüle @
a7762b56
...
@@ -366,12 +366,113 @@ OString DocxExport::OutputChart( uno::Reference< frame::XModel >& xModel, sal_In
...
@@ -366,12 +366,113 @@ OString DocxExport::OutputChart( uno::Reference< frame::XModel >& xModel, sal_In
return
OUStringToOString
(
sId
,
RTL_TEXTENCODING_UTF8
);
return
OUStringToOString
(
sId
,
RTL_TEXTENCODING_UTF8
);
}
}
OString
DocxExport
::
WriteOLEObject
(
SwOLEObj
&
rObject
,
const
OUString
&
sMediaType
,
const
OUString
&
sRelationType
,
const
OUString
&
sFileExtension
)
static
void
lcl_ConvertProgID
(
OUString
const
&
rProgID
,
OUString
&
o_rMediaType
,
OUString
&
o_rRelationType
,
OUString
&
o_rFileExtension
)
{
if
(
rProgID
==
"Excel.Sheet.12"
)
{
o_rMediaType
=
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
;
o_rRelationType
=
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"
;
o_rFileExtension
=
"xlsx"
;
}
else
if
(
rProgID
.
startsWith
(
"Excel.SheetBinaryMacroEnabled.12"
)
)
{
o_rMediaType
=
"application/vnd.ms-excel.sheet.binary.macroEnabled.12"
;
o_rRelationType
=
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"
;
o_rFileExtension
=
"xlsb"
;
}
else
if
(
rProgID
.
startsWith
(
"Excel.SheetMacroEnabled.12"
))
{
o_rMediaType
=
"application/vnd.ms-excel.sheet.macroEnabled.12"
;
o_rRelationType
=
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"
;
o_rFileExtension
=
"xlsm"
;
}
else
if
(
rProgID
.
startsWith
(
"Excel.Sheet"
))
{
o_rMediaType
=
"application/vnd.ms-excel"
;
o_rRelationType
=
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"
;
o_rFileExtension
=
"xls"
;
}
else
if
(
rProgID
==
"PowerPoint.Show.12"
)
{
o_rMediaType
=
"application/vnd.openxmlformats-officedocument.presentationml.presentation"
;
o_rRelationType
=
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"
;
o_rFileExtension
=
"pptx"
;
}
else
if
(
rProgID
==
"PowerPoint.ShowMacroEnabled.12"
)
{
o_rMediaType
=
"application/vnd.ms-powerpoint.presentation.macroEnabled.12"
;
o_rRelationType
=
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"
;
o_rFileExtension
=
"pptm"
;
}
else
if
(
rProgID
.
startsWith
(
"PowerPoint.Show"
))
{
o_rMediaType
=
"application/vnd.ms-powerpoint"
;
o_rRelationType
=
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"
;
o_rFileExtension
=
"ppt"
;
}
else
if
(
rProgID
.
startsWith
(
"PowerPoint.Slide.12"
))
{
o_rMediaType
=
"application/vnd.openxmlformats-officedocument.presentationml.slide"
;
o_rRelationType
=
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"
;
o_rFileExtension
=
"sldx"
;
}
else
if
(
rProgID
==
"PowerPoint.SlideMacroEnabled.12"
)
{
o_rMediaType
=
"application/vnd.ms-powerpoint.slide.macroEnabled.12"
;
o_rRelationType
=
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"
;
o_rFileExtension
=
"sldm"
;
}
else
if
(
rProgID
==
"Word.DocumentMacroEnabled.12"
)
{
o_rMediaType
=
"application/vnd.ms-word.document.macroEnabled.12"
;
o_rRelationType
=
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"
;
o_rFileExtension
=
"docm"
;
}
else
if
(
rProgID
==
"Word.Document.12"
)
{
o_rMediaType
=
"application/vnd.openxmlformats-officedocument.wordprocessingml.document"
;
o_rRelationType
=
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package"
;
o_rFileExtension
=
"docx"
;
}
else
if
(
rProgID
==
"Word.Document.8"
)
{
o_rMediaType
=
"application/msword"
;
o_rRelationType
=
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"
;
o_rFileExtension
=
"doc"
;
}
else
if
(
rProgID
==
"Excel.Chart.8"
)
{
o_rMediaType
=
"application/vnd.ms-excel"
;
o_rRelationType
=
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"
;
o_rFileExtension
=
"xls"
;
}
else
if
(
rProgID
==
"AcroExch.Document.11"
)
{
o_rMediaType
=
"application/pdf"
;
o_rRelationType
=
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"
;
o_rFileExtension
=
"pdf"
;
}
else
{
o_rMediaType
=
"application/vnd.openxmlformats-officedocument.oleObject"
;
o_rRelationType
=
"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject"
;
o_rFileExtension
=
"bin"
;
}
}
OString
DocxExport
::
WriteOLEObject
(
SwOLEObj
&
rObject
,
OUString
const
&
rProgID
)
{
{
uno
::
Reference
<
embed
::
XEmbeddedObject
>
xObj
(
rObject
.
GetOleRef
()
);
uno
::
Reference
<
embed
::
XEmbeddedObject
>
xObj
(
rObject
.
GetOleRef
()
);
comphelper
::
EmbeddedObjectContainer
*
aContainer
=
rObject
.
GetObject
().
GetContainer
();
comphelper
::
EmbeddedObjectContainer
*
aContainer
=
rObject
.
GetObject
().
GetContainer
();
uno
::
Reference
<
io
::
XInputStream
>
xInStream
=
aContainer
->
GetObjectStream
(
xObj
);
uno
::
Reference
<
io
::
XInputStream
>
xInStream
=
aContainer
->
GetObjectStream
(
xObj
);
OUString
sMediaType
;
OUString
sRelationType
;
OUString
sFileExtension
;
lcl_ConvertProgID
(
rProgID
,
sMediaType
,
sRelationType
,
sFileExtension
);
OUString
sFileName
=
"embeddings/oleObject"
+
OUString
::
number
(
++
m_nOLEObjects
)
+
"."
+
sFileExtension
;
OUString
sFileName
=
"embeddings/oleObject"
+
OUString
::
number
(
++
m_nOLEObjects
)
+
"."
+
sFileExtension
;
uno
::
Reference
<
io
::
XOutputStream
>
xOutStream
=
GetFilter
().
openFragmentStream
(
OUStringBuffer
()
uno
::
Reference
<
io
::
XOutputStream
>
xOutStream
=
GetFilter
().
openFragmentStream
(
OUStringBuffer
()
.
append
(
"word/"
)
.
append
(
"word/"
)
...
...
sw/source/filter/ww8/docxexport.hxx
Dosyayı görüntüle @
a7762b56
...
@@ -170,7 +170,7 @@ public:
...
@@ -170,7 +170,7 @@ public:
/// Returns the relationd id
/// Returns the relationd id
OString
OutputChart
(
css
::
uno
::
Reference
<
css
::
frame
::
XModel
>&
xModel
,
sal_Int32
nCount
,
::
sax_fastparser
::
FSHelperPtr
m_pSerializer
);
OString
OutputChart
(
css
::
uno
::
Reference
<
css
::
frame
::
XModel
>&
xModel
,
sal_Int32
nCount
,
::
sax_fastparser
::
FSHelperPtr
m_pSerializer
);
OString
WriteOLEObject
(
SwOLEObj
&
rObject
,
const
OUString
&
sMediaType
,
const
OUString
&
sRelationType
,
const
OUString
&
sFileExtension
);
OString
WriteOLEObject
(
SwOLEObj
&
rObject
,
OUString
const
&
rProgID
);
static
bool
lcl_CopyStream
(
css
::
uno
::
Reference
<
css
::
io
::
XInputStream
>
xIn
,
css
::
uno
::
Reference
<
css
::
io
::
XOutputStream
>
xOut
);
static
bool
lcl_CopyStream
(
css
::
uno
::
Reference
<
css
::
io
::
XInputStream
>
xIn
,
css
::
uno
::
Reference
<
css
::
io
::
XOutputStream
>
xOut
);
/// Writes the shape using drawingML syntax.
/// Writes the shape using drawingML syntax.
...
...
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