From kde-commits Mon Mar 23 02:22:20 2015 From: Inge Wallin Date: Mon, 23 Mar 2015 02:22:20 +0000 To: kde-commits Subject: [calligra/frameworks] filters/libmsooxml: Port filters/libmsooxml to Qt5/KF5. Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=142707735121737 Git commit ac1ca3135ae441d2b11474aa3cbf219cab53522c by Inge Wallin. Committed on 23/03/2015 at 02:20. Pushed by ingwa into branch 'frameworks'. Port filters/libmsooxml to Qt5/KF5. This is the actual port, but it's not enabled yet in CalligraProducts.cmake. The reason for that is that libs/main is not yet ported, and we need to link against that. As far as I understand, once that= is done, the only thing needed will be to move the LIBMSOOXML product from UNPORTED to PORTED. M +1 -1 filters/libmsooxml/CMakeLists.txt M +2 -1 filters/libmsooxml/MsooXmlCommonReader.cpp M +1 -0 filters/libmsooxml/MsooXmlDiagramReader_p.h M +8 -3 filters/libmsooxml/MsooXmlUtils.cpp M +3 -0 filters/libmsooxml/PredefinedShapeHelper.cpp http://commits.kde.org/calligra/ac1ca3135ae441d2b11474aa3cbf219cab53522c diff --git a/filters/libmsooxml/CMakeLists.txt b/filters/libmsooxml/CMakeLi= sts.txt index 5c57396..4c0807b 100644 --- a/filters/libmsooxml/CMakeLists.txt +++ b/filters/libmsooxml/CMakeLists.txt @@ -41,7 +41,7 @@ set(msooxml_LIB_SRCS = add_library(komsooxml SHARED ${msooxml_LIB_SRCS}) = -target_link_libraries(komsooxml mso koodf2 koodf komain) +target_link_libraries(komsooxml mso koodf2 koodf komain KF5::Archive) if(Qca-qt5_FOUND) target_link_libraries(komsooxml qca-qt5) endif() diff --git a/filters/libmsooxml/MsooXmlCommonReader.cpp b/filters/libmsooxm= l/MsooXmlCommonReader.cpp index 0df07a9..4e99c32 100644 --- a/filters/libmsooxml/MsooXmlCommonReader.cpp +++ b/filters/libmsooxml/MsooXmlCommonReader.cpp @@ -123,6 +123,8 @@ void MsooXmlCommonReader::popCurrentDrawStyle() m_drawStyleStack.removeLast(); } = +Q_GLOBAL_STATIC(MediaTypeMap, g_mediaTypes) + void MsooXmlCommonReader::addManifestEntryForFile(const QString& path) { if (path.isEmpty()) @@ -134,7 +136,6 @@ void MsooXmlCommonReader::addManifestEntryForFile(const= QString& path) } const int lastDot =3D path.lastIndexOf(QLatin1Char('.')); const QByteArray ext(path.mid(lastDot + 1).toLatin1().toLower()); - K_GLOBAL_STATIC(MediaTypeMap, g_mediaTypes) manifest->addManifestEntry(path, g_mediaTypes->value(ext)); } = diff --git a/filters/libmsooxml/MsooXmlDiagramReader_p.h b/filters/libmsoox= ml/MsooXmlDiagramReader_p.h index 9f516b0..967c6b9 100644 --- a/filters/libmsooxml/MsooXmlDiagramReader_p.h +++ b/filters/libmsooxml/MsooXmlDiagramReader_p.h @@ -34,6 +34,7 @@ #include #include #include +#include = extern QVariant val; namespace MSOOXML { diff --git a/filters/libmsooxml/MsooXmlUtils.cpp b/filters/libmsooxml/MsooX= mlUtils.cpp index 25bb0d6..c8ea8a2 100644 --- a/filters/libmsooxml/MsooXmlUtils.cpp +++ b/filters/libmsooxml/MsooXmlUtils.cpp @@ -53,6 +53,7 @@ #include #include = +#include #include #include #include @@ -568,9 +569,10 @@ public: } }; = +Q_GLOBAL_STATIC(ST_HighlightColorMapping, s_ST_HighlightColor_to_QColor) + QBrush Utils::ST_HighlightColor_to_QColor(const QString& colorName) { - K_GLOBAL_STATIC(ST_HighlightColorMapping, s_ST_HighlightColor_to_QColo= r) const QColor c(s_ST_HighlightColor_to_QColor->value(colorName)); if (c.isValid()) return QBrush(c); @@ -703,9 +705,10 @@ public: } }; = +Q_GLOBAL_STATIC(ST_PlaceholderType_to_ODFMapping, s_ST_PlaceholderType_to_= ODF) + QString Utils::ST_PlaceholderType_to_ODF(const QString& ecmaType) { - K_GLOBAL_STATIC(ST_PlaceholderType_to_ODFMapping, s_ST_PlaceholderType= _to_ODF) QHash::ConstIterator it(s_ST_PlaceholderType_t= o_ODF->constFind(ecmaType.toLatin1())); if (it =3D=3D s_ST_PlaceholderType_to_ODF->constEnd()) return QLatin1String("text"); @@ -842,9 +845,11 @@ void Utils::rotateString(const qreal rotation, const q= real width, const qreal he yDiff =3D height/2 - sin(-angle)*width/2 - cos(-angle)*height/2; } = + +Q_GLOBAL_STATIC(UnderlineStylesHash, s_underLineStyles) + void Utils::setupUnderLineStyle(const QString& msooxmlName, KoCharacterSty= le* textStyleProperties) { - K_GLOBAL_STATIC(UnderlineStylesHash, s_underLineStyles) s_underLineStyles->setup(msooxmlName, textStyleProperties); } = diff --git a/filters/libmsooxml/PredefinedShapeHelper.cpp b/filters/libmsoo= xml/PredefinedShapeHelper.cpp index 2a99eb0..c6dec76 100644 --- a/filters/libmsooxml/PredefinedShapeHelper.cpp +++ b/filters/libmsooxml/PredefinedShapeHelper.cpp @@ -21,6 +21,9 @@ * */ = +#include // used in generated/generatedShapes.h, which is incl= uded + // inside a function in this file. + #include "PredefinedShapeHelper.h" = PredefinedShapeHelper::PredefinedShapeHelper()