[Libreoffice-commits] core.git: 4 commits - embeddedobj/source filter/source include/filter lotuswordpro/source sc/source sd/source starmath/source sw/qa sw/source
Michael Stahl
mstahl at redhat.com
Tue Dec 8 13:13:49 PST 2015
embeddedobj/source/msole/olevisual.cxx | 4 +-
filter/source/msfilter/msdffimp.cxx | 36 ++++++--------------
include/filter/msfilter/classids.hxx | 47 +++++++++++++++++++++++++++
lotuswordpro/source/filter/lwptabrack.cxx | 2 +
sc/source/filter/excel/excel.cxx | 3 +
sd/source/filter/eppt/eppt.cxx | 3 +
starmath/source/mathtype.cxx | 6 +--
sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 3 +
sw/source/core/unocore/unoframe.cxx | 2 -
sw/source/filter/ww8/docxattributeoutput.cxx | 5 ++
sw/source/filter/ww8/wrtww8.cxx | 6 +--
11 files changed, 81 insertions(+), 36 deletions(-)
New commits:
commit 8d2c9a60b2dca069dedb08cac38c26afea0a562d
Author: Michael Stahl <mstahl at redhat.com>
Date: Tue Dec 8 12:45:18 2015 +0100
sw: redundant condition, was checked previously
Change-Id: I7934bc993e049169a08b835f922da8ef50ea05ee
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index ba315f5..15ad17d 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -2994,7 +2994,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan
if(!m_sName.isEmpty())
pDoc->SetFlyName((SwFlyFrameFormat&)*pFrameFormat, m_sName);
}
- else if( pEmbeddedObject || pStreamName )
+ else if (pEmbeddedObject)
{
uno::Reference< embed::XEmbeddedObject > obj;
(*pEmbeddedObject) >>= obj;
commit 1a18c92a527cd53abfb0919246935a4fd4ef421d
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Dec 4 17:38:04 2015 +0100
consolidate MSO format ClassID magic numbers in msfilter/classids.hxx
Change-Id: I673eeaa4168f769cb002995c43d986ee5f2030b2
diff --git a/embeddedobj/source/msole/olevisual.cxx b/embeddedobj/source/msole/olevisual.cxx
index cb12987..5be4ed5 100644
--- a/embeddedobj/source/msole/olevisual.cxx
+++ b/embeddedobj/source/msole/olevisual.cxx
@@ -28,6 +28,7 @@
#include <oleembobj.hxx>
#include <comphelper/mimeconfighelper.hxx>
#include <comphelper/seqstream.hxx>
+#include <filter/msfilter/classids.hxx>
#if defined WNT
#include <olecomponent.hxx>
@@ -113,8 +114,7 @@ void SAL_CALL OleEmbeddedObject::setVisualAreaSize( sal_Int64 nAspect, const awt
// If cached size is not set, that means that this is the size initialization, so there is no need to set the real size
sal_Bool bAllowToSetExtent =
( ( getStatus( nAspect ) & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE )
- && !MimeConfigurationHelper::ClassIDsEqual( m_aClassID, MimeConfigurationHelper::GetSequenceClassID( 0x00020906L, 0x0000, 0x0000,
- 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 ) )
+ && !MimeConfigurationHelper::ClassIDsEqual(m_aClassID, MimeConfigurationHelper::GetSequenceClassID(MSO_WW8_CLASSID))
&& m_bHasCachedSize );
if ( m_nObjectState == embed::EmbedStates::LOADED && bAllowToSetExtent )
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 430be20..4afc1cb 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -107,6 +107,7 @@
#include "svx/svditer.hxx"
#include <svx/xpoly.hxx>
#include "svx/xattr.hxx"
+#include <filter/msfilter/classids.hxx>
#include <filter/msfilter/msdffimp.hxx>
#include <editeng/outliner.hxx>
#include <editeng/outlobj.hxx>
@@ -6849,31 +6850,18 @@ css::uno::Reference < css::embed::XEmbeddedObject > SvxMSDffManager::CheckForCo
sal_uInt16 n2, n3;
sal_uInt8 b8, b9, b10, b11, b12, b13, b14, b15;
} aArr[] = {
- { OLE_MATHTYPE_2_STARMATH, "smath",
- 0x0002ce02L, 0x0000, 0x0000,
- 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
- { OLE_MATHTYPE_2_STARMATH, "smath",
- 0x00021700L, 0x0000, 0x0000,
- 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
- { OLE_WINWORD_2_STARWRITER, "swriter",
- 0x00020906L, 0x0000, 0x0000,
- 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
- { OLE_EXCEL_2_STARCALC, "scalc", // Excel table
- 0x00020810L, 0x0000, 0x0000,
- 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
- { OLE_EXCEL_2_STARCALC, "scalc", // Excel chart
- 0x00020820L, 0x0000, 0x0000,
- 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
+ { OLE_MATHTYPE_2_STARMATH, "smath", MSO_EQUATION3_CLASSID },
+ { OLE_MATHTYPE_2_STARMATH, "smath", MSO_EQUATION2_CLASSID },
+ { OLE_WINWORD_2_STARWRITER, "swriter", MSO_WW8_CLASSID },
+ // Excel table
+ { OLE_EXCEL_2_STARCALC, "scalc", MSO_EXCEL5_CLASSID },
+ { OLE_EXCEL_2_STARCALC, "scalc", MSO_EXCEL8_CLASSID },
// 114465: additional Excel OLE chart classId to above.
- { OLE_EXCEL_2_STARCALC, "scalc",
- 0x00020821L, 0x0000, 0x0000,
- 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x46 },
- { OLE_POWERPOINT_2_STARIMPRESS, "simpress", // PowerPoint presentation
- 0x64818d10L, 0x4f9b, 0x11cf,
- 0x86,0xea,0x00,0xaa,0x00,0xb9,0x29,0xe8 },
- { OLE_POWERPOINT_2_STARIMPRESS, "simpress", // PowerPoint slide
- 0x64818d11L, 0x4f9b, 0x11cf,
- 0x86,0xea,0x00,0xaa,0x00,0xb9,0x29,0xe8 },
+ { OLE_EXCEL_2_STARCALC, "scalc", MSO_EXCEL8_CHART_CLASSID },
+ // PowerPoint presentation
+ { OLE_POWERPOINT_2_STARIMPRESS, "simpress", MSO_PPT8_CLASSID },
+ // PowerPoint slide
+ { OLE_POWERPOINT_2_STARIMPRESS, "simpress", MSO_PPT8_SLIDE_CLASSID },
{ 0, nullptr,
0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0 }
diff --git a/include/filter/msfilter/classids.hxx b/include/filter/msfilter/classids.hxx
new file mode 100644
index 0000000..8394a71
--- /dev/null
+++ b/include/filter/msfilter/classids.hxx
@@ -0,0 +1,47 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_FILTER_MSFILTER_CLASSIDS_HXX
+#define INCLUDED_FILTER_MSFILTER_CLASSIDS_HXX
+
+#define MSO_EQUATION2_CLASSID \
+ 0x00021700L, 0x0000, 0x0000, \
+ 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46
+
+#define MSO_EQUATION3_CLASSID \
+ 0x0002ce02L, 0x0000, 0x0000, \
+ 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46
+
+#define MSO_WW8_CLASSID \
+ 0x00020906L, 0x0000, 0x0000, \
+ 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46
+
+#define MSO_EXCEL5_CLASSID \
+ 0x00020810L, 0x0000, 0x0000, \
+ 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46
+
+#define MSO_EXCEL8_CLASSID \
+ 0x00020820L, 0x0000, 0x0000, \
+ 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46
+
+#define MSO_EXCEL8_CHART_CLASSID \
+ 0x00020821L, 0x0000, 0x0000, \
+ 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46
+
+#define MSO_PPT8_CLASSID \
+ 0x64818d10L, 0x4f9b, 0x11cf, \
+ 0x86, 0xea, 0x00, 0xaa, 0x00, 0xb9, 0x29, 0xe8
+
+#define MSO_PPT8_SLIDE_CLASSID \
+ 0x64818d11L, 0x4f9b, 0x11cf, \
+ 0x86, 0xea, 0x00, 0xaa, 0x00, 0xb9, 0x29, 0xe8
+
+#endif // INCLUDED_FILTER_MSFILTER_CLASSIDS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx
index 59e0daf..73ee93e 100644
--- a/sc/source/filter/excel/excel.cxx
+++ b/sc/source/filter/excel/excel.cxx
@@ -24,6 +24,7 @@
#include <sfx2/request.hxx>
#include <sot/storage.hxx>
#include <sot/exchange.hxx>
+#include <filter/msfilter/classids.hxx>
#include <tools/globname.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/beans/NamedValue.hpp>
@@ -186,7 +187,7 @@ static FltError lcl_ExportExcelBiff( SfxMedium& rMedium, ScDocument *pDocument,
if( eRet == eERR_RNGOVRFLW )
eRet = SCWARN_EXPORT_MAXROW;
- SvGlobalName aGlobName( 0x00020810, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 );
+ SvGlobalName aGlobName(MSO_EXCEL5_CLASSID);
SotClipboardFormatId nClip = SotExchange::RegisterFormatName( aClipName );
xRootStrg->SetClass( aGlobName, nClip, aClassName );
diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx
index 9e5c4a7..71ef6f5 100644
--- a/sd/source/filter/eppt/eppt.cxx
+++ b/sd/source/filter/eppt/eppt.cxx
@@ -44,6 +44,7 @@
#include <tools/zcodec.hxx>
#include <editeng/svxenum.hxx>
#include <sot/storinfo.hxx>
+#include <filter/msfilter/classids.hxx>
#include <filter/msfilter/msoleexp.hxx>
#include <vcl/virdev.hxx>
#include <vcl/wmf.hxx>
@@ -113,7 +114,7 @@ void PPTWriter::exportPPTPre( const std::vector< css::beans::PropertyValue >& rM
mXStatusIndicator->start( "PowerPoint Export", mnStatMaxValue + ( mnStatMaxValue >> 3 ) );
}
- SvGlobalName aGName( 0x64818d10L, 0x4f9b, 0x11cf, 0x86, 0xea, 0x00, 0xaa, 0x00, 0xb9, 0x29, 0xe8 );
+ SvGlobalName aGName(MSO_PPT8_CLASSID);
mrStg->SetClass( aGName, SotClipboardFormatId::NONE, "MS PowerPoint 97" );
if ( !ImplCreateCurrentUserStream() )
diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx
index 9cc65c0..962de9d 100644
--- a/starmath/source/mathtype.cxx
+++ b/starmath/source/mathtype.cxx
@@ -17,8 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#include <mathtype.hxx>
+
+#include <filter/msfilter/classids.hxx>
#include <osl/diagnose.h>
#include <sfx2/docfile.hxx>
@@ -1887,8 +1888,7 @@ int MathType::ConvertFromStarMath( SfxMedium& rMedium )
{
tools::SvRef<SotStorage> pStor = new SotStorage( pStream, false );
- SvGlobalName aGName(0x0002ce02L, 0x0000, 0x0000,0xc0,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x46 );
+ SvGlobalName aGName(MSO_EQUATION3_CLASSID);
pStor->SetClass( aGName, SotClipboardFormatId::NONE, "Microsoft Equation 3.0");
static sal_uInt8 const aCompObj[] = {
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 76182e2..0fdeef8 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -43,6 +43,7 @@
#include <svx/svdpage.hxx>
#include <editeng/hyphenzoneitem.hxx>
#include <editeng/langitem.hxx>
+#include <filter/msfilter/classids.hxx>
#include <filter/msfilter/msoleexp.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/ulspitem.hxx>
@@ -3232,7 +3233,6 @@ void WW8Export::PrepareStorage()
sal_uLong nLen;
const sal_uInt8* pData;
const char* pName;
- sal_uInt32 nId1;
static const char aUserName[] = "Microsoft Word-Document";
static const sal_uInt8 aCompObj[] =
@@ -3256,10 +3256,8 @@ void WW8Export::PrepareStorage()
pName = aUserName;
pData = aCompObj;
nLen = sizeof( aCompObj );
- nId1 = 0x00020906L;
- SvGlobalName aGName( nId1, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x46 );
+ SvGlobalName aGName(MSO_WW8_CLASSID);
GetWriter().GetStorage().SetClass( aGName, SotClipboardFormatId::NONE, OUString::createFromAscii( pName ));
tools::SvRef<SotStorageStream> xStor( GetWriter().GetStorage().OpenSotStream(sCompObj) );
xStor->Write( pData, nLen );
commit 3b63d2b9371baa5f526d0fcd41043ec76abb0d50
Author: Michael Stahl <mstahl at redhat.com>
Date: Tue Dec 8 19:55:20 2015 +0100
sw: un-break DOCX formula export
(regression from 1dac99e7ea45f90bf39eb95eb7bc01f7d79093ef)
Change-Id: Iffe3ec6c28f62b78a2b223144bfaad383d272802
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
index de71773..759ccf1 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx
@@ -984,6 +984,9 @@ DECLARE_OOXMLEXPORT_TEST(testFileOpenInputOutputError,"floatingtbl_with_formula.
if (!pXmlDoc)
return;
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pStyle", "val", "Normal");
+
+ // let's also assert that the formula was exported properly
+ assertXPathContent(pXmlDoc, "//wps:txbx/w:txbxContent/w:tbl/w:tr/w:tc[2]/w:p/m:oMath/m:sSubSup/m:e/m:r/m:t", OUString::fromUtf8("\xcf\x83"));
}
#endif
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 02c21e6..d9b45e8 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -127,6 +127,7 @@
#include <com/sun/star/drawing/ShadingPattern.hpp>
#include <com/sun/star/text/GraphicCrop.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
+#include <com/sun/star/embed/EmbedStates.hpp>
#include <algorithm>
@@ -4521,6 +4522,10 @@ bool DocxAttributeOutput::WriteOLEMath( const SdrObject*, const SwOLENode& rOLEN
void DocxAttributeOutput::WritePostponedMath(const SwOLENode* pPostponedMath)
{
uno::Reference < embed::XEmbeddedObject > xObj(const_cast<SwOLENode*>(pPostponedMath)->GetOLEObj().GetOleRef());
+ if (embed::EmbedStates::LOADED == xObj->getCurrentState())
+ { // must be running so there is a Component
+ xObj->changeState(embed::EmbedStates::RUNNING);
+ }
uno::Reference< uno::XInterface > xInterface( xObj->getComponent(), uno::UNO_QUERY );
if (!xInterface.is())
{
commit 742c2370566bf1e7caa7403c99f088a79ae146fa
Author: Michael Stahl <mstahl at redhat.com>
Date: Tue Dec 8 22:11:13 2015 +0100
lotuswordpro: GCC 4.6 seems to need stdexcept included
Change-Id: I30bbf7bab8cb37422fd20a25741e564500faa31c
diff --git a/lotuswordpro/source/filter/lwptabrack.cxx b/lotuswordpro/source/filter/lwptabrack.cxx
index a07fa39..9d284db 100644
--- a/lotuswordpro/source/filter/lwptabrack.cxx
+++ b/lotuswordpro/source/filter/lwptabrack.cxx
@@ -61,6 +61,8 @@
#include "lwpobjstrm.hxx"
#include "lwpslvlist.hxx"
+#include <stdexcept>
+
LwpTab::LwpTab()
{
m_nX = 0;
More information about the Libreoffice-commits
mailing list