download.lst | 4 external/libetonyek/0001-Comma-at-the-end-of-emum-list.patch.1 | 26 --- external/libetonyek/UnpackedTarball_libetonyek.mk | 5 external/libetonyek/libetonyek-0.0.3-lexical_cast.patch | 56 -------- oox/CustomTarget_generated.mk | 6 oox/Library_oox.mk | 4 oox/Package_generated.mk | 1 oox/source/export/preset-definitions-to-shape-types.pl | 70 +++------- oox/source/export/vmlexport.cxx | 30 +++- scp2/source/ooo/module_filter.scp | 10 + sw/source/filter/html/htmlform.cxx | 63 --------- sw/source/filter/html/swhtml.hxx | 1 12 files changed, 72 insertions(+), 204 deletions(-)
New commits: commit ab76f36af0c77ce30c6934b7c8f0104d73a1ddf0 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Tue Apr 15 12:30:05 2014 +0200 oox: generate data, not code for VML export preset definitions Change-Id: Ied9171715de948d30b360eb56626b93b695b7b93 diff --git a/oox/CustomTarget_generated.mk b/oox/CustomTarget_generated.mk index 0b81f11..70aa0d2 100644 --- a/oox/CustomTarget_generated.mk +++ b/oox/CustomTarget_generated.mk @@ -14,14 +14,14 @@ oox_MISC := $(call gb_CustomTarget_get_workdir,oox/generated)/misc oox_INC := $(call gb_CustomTarget_get_workdir,oox/generated) oox_GENHEADERPATH := $(oox_INC)/oox/token -$(oox_MISC)/vmlexport-shape-types.cxx : \ +$(oox_MISC)/vml-shape-types : \ $(SRCDIR)/oox/source/export/preset-definitions-to-shape-types.pl \ $(SRCDIR)/oox/source/drawingml/customshapes/presetShapeDefinitions.xml \ $(SRCDIR)/oox/source/export/presetTextWarpDefinitions.xml \ $(SRCDIR)/oox/CustomTarget_generated.mk $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),build,PRL,1) mkdir -p $(dir $@) - perl $^ > $@.in_progress 2> $@.log && mv $@.in_progress $@ + perl $< --vml-shape-types-data $(filter-out $<,$^) > $@.in_progress 2> $@.log && mv $@.in_progress $@ $(oox_MISC)/oox-drawingml-adj-names : \ $(SRCDIR)/oox/source/export/preset-definitions-to-shape-types.pl \ @@ -58,8 +58,8 @@ $(eval $(call oox_GenTarget,properties,property,)) $(eval $(call oox_GenTarget,tokens,token,tokenhash.gperf)) $(call gb_CustomTarget_get_target,oox/generated) : \ - $(oox_MISC)/vmlexport-shape-types.cxx \ $(oox_MISC)/oox-drawingml-adj-names \ + $(oox_MISC)/vml-shape-types \ $(oox_INC)/tokenhash.inc \ $(oox_INC)/tokennames.inc \ $(oox_INC)/namespacenames.inc \ diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk index 007c22f..06f0477 100644 --- a/oox/Library_oox.mk +++ b/oox/Library_oox.mk @@ -296,8 +296,4 @@ $(eval $(call gb_Library_add_exception_objects,oox,\ oox/source/vml/vmltextbox \ )) -$(eval $(call gb_Library_add_generated_exception_objects,oox,\ - CustomTarget/oox/generated/misc/vmlexport-shape-types \ -)) - # vim: set noet sw=4 ts=4: diff --git a/oox/Package_generated.mk b/oox/Package_generated.mk index e233662..6ed8f83 100644 --- a/oox/Package_generated.mk +++ b/oox/Package_generated.mk @@ -11,6 +11,7 @@ $(eval $(call gb_Package_Package,oox_generated,$(call gb_CustomTarget_get_workdi $(eval $(call gb_Package_add_files,oox_generated,$(LIBO_SHARE_FOLDER)/filter,\ misc/oox-drawingml-adj-names \ + misc/vml-shape-types \ )) # vim: set noet sw=4 ts=4: diff --git a/oox/source/export/preset-definitions-to-shape-types.pl b/oox/source/export/preset-definitions-to-shape-types.pl index 005d9cd..cd324d1 100644 --- a/oox/source/export/preset-definitions-to-shape-types.pl +++ b/oox/source/export/preset-definitions-to-shape-types.pl @@ -22,7 +22,7 @@ use warnings; sub usage() { print STDERR <<EOF; -Usage: preset-definitions-to-shape-types.pl <shapes> <text> +Usage: preset-definitions-to-shape-types.pl [ --drawingml-adj-names-data | --vml-shape-types-data ] <shapes> <text> Converts presetShapeDefinitions.xml and presetTextWarpDefinitions.xml to a .cxx that contains VML with the definitions of the shapes. The result is @@ -47,10 +47,14 @@ sub show_call_stack } my $drawingml_adj_names_data = 0; +my $vml_shape_types_data = 0; my $src_shapes = shift; if ($src_shapes eq "--drawingml-adj-names-data") { $drawingml_adj_names_data = 1; $src_shapes = shift; +} elsif ($src_shapes eq "--vml-shape-types-data") { + $vml_shape_types_data = 1; + $src_shapes = shift; } my $src_text = shift; @@ -1191,7 +1195,7 @@ if ( !defined( $result_shapes{'textBox'} ) ) { "</v:shapetype>"; } -# Generate the code +# Generate the data if ($drawingml_adj_names_data eq 1) { foreach my $adj_name (keys %adj_names) { @@ -1201,52 +1205,32 @@ if ($drawingml_adj_names_data eq 1) { } } exit 0; -} - -print <<EOF; -// Shape types generated from -// '$src_shapes' -// and -// '$src_text' -// which are part of the OOXML documentation - -#include <map> -#include <filter/msfilter/escherex.hxx> - -const char* pShapeTypes[ ESCHER_ShpInst_COUNT ] = -{ -EOF - -for ( my $i = 0; $i < 203; ++$i ) { - if ( $i < 4 ) { - print " /* $i - $shapes_ids{$i} - handled separately */\n NULL,\n"; - } - else { - print " /* $i - $shapes_ids{$i} */\n"; - my $out = $result_shapes{$shapes_ids{$i}}; - if ( defined( $out ) ) { - # set the id - $out =~ s/__ID__/$i/g; - - # escape the '"'s - $out =~ s/"/\\"/g; - - # output as string - $out =~ s/^/ "/; - $out =~ s/\n/"\n "/g; - $out =~ s/$/"/; - - print "$out,\n"; +} elsif ($vml_shape_types_data eq 1) { + for ( my $i = 0; $i < 203; ++$i ) { + if ( $i < 4 ) { + print "/* $i - $shapes_ids{$i} - handled separately */\nNULL\n"; } else { - print " NULL,\n"; + print "/* $i - $shapes_ids{$i} */\n"; + my $out = $result_shapes{$shapes_ids{$i}}; + if ( defined( $out ) ) { + # set the id + $out =~ s/__ID__/$i/g; + + # output as string + $out =~ s/\n//g; + + print "$out\n"; + } + else { + print "NULL\n"; + } } } + exit 0; } -print <<EOF; -}; - -EOF +# should not happen +exit 1; # vim:set ft=perl shiftwidth=4 softtabstop=4 expandtab: # diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index b4b97b5..0f3038b 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_folders.h> +#include "rtl/bootstrap.hxx" #include <oox/export/vmlexport.hxx> #include <oox/token/tokens.hxx> @@ -927,7 +929,26 @@ void VMLExport::AddShapeAttribute( sal_Int32 nAttribute, const OString& rValue ) m_pShapeAttrList->add( nAttribute, rValue ); } -extern const char* pShapeTypes[]; +std::vector<OString> lcl_getShapeTypes() +{ + std::vector<OString> aRet; + + OUString aPath("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER "/filter/vml-shape-types"); + rtl::Bootstrap::expandMacros(aPath); + SvFileStream aStream(aPath, STREAM_READ); + if (aStream.GetError() != ERRCODE_NONE) + SAL_WARN("oox", "failed to open vml-shape-types"); + OString aLine; + bool bNotDone = aStream.ReadLine(aLine); + while (bNotDone) + { + // Filter out comments. + if (!aLine.startsWith("/")) + aRet.push_back(aLine); + bNotDone = aStream.ReadLine(aLine); + } + return aRet; +} sal_Int32 VMLExport::StartShape() { @@ -951,13 +972,14 @@ sal_Int32 VMLExport::StartShape() nShapeElement = XML_shape; // a predefined shape? - const char* pShapeType = pShapeTypes[ m_nShapeType ]; - if ( pShapeType ) + static std::vector<OString> aShapeTypes = lcl_getShapeTypes(); + OString aShapeType = aShapeTypes[ m_nShapeType ]; + if ( aShapeType != "NULL" ) { bReferToShapeType = true; if ( !m_pShapeTypeWritten[ m_nShapeType ] ) { - m_pSerializer->write( pShapeType ); + m_pSerializer->write( aShapeType.getStr() ); m_pShapeTypeWritten[ m_nShapeType ] = true; } } diff --git a/scp2/source/ooo/module_filter.scp b/scp2/source/ooo/module_filter.scp index 2caac9c..e4fdeae 100644 --- a/scp2/source/ooo/module_filter.scp +++ b/scp2/source/ooo/module_filter.scp @@ -17,7 +17,8 @@ Module gid_Module_Filter Styles = (HIDDEN_ROOT); Dirs = (gid_Dir_Share_Filter); Files = ( - gid_File_Dat_OoxDrawingmlAdjNames); + gid_File_Dat_OoxDrawingmlAdjNames, + gid_File_Dat_VmlShapeTypes); End Directory gid_Dir_Share_Filter @@ -32,4 +33,11 @@ File gid_File_Dat_OoxDrawingmlAdjNames Styles = (PACKED); End +File gid_File_Dat_OoxVmlShapeTypes + TXT_FILE_BODY; + Dir = gid_Dir_Share_Filter; + Name = "vml-shape-types"; + Styles = (PACKED); +End + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit c171a83502cb9080be581a345af57b07f58e622f Author: Stephan Bergmann <sberg...@redhat.com> Date: Tue Apr 15 12:29:25 2014 +0200 The only instantiation of SwHTMLFormPendingStackData_Impl is long gone ...since ff09ed094d6b1d9b41f482a5b349c4fd9e80d857 "INTEGRATION: CWS ab53: #i47763# synchronous html import," so lets hope that SetPendingControlSize was indeed a leftover that would never have been called. Change-Id: I63f91fbde4dd3162bacdb935e8b0f1e590f1d378 diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index 1a78810..6744184 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -634,45 +634,6 @@ static void lcl_html_setFixedFontProperty( rPropSet->setPropertyValue("FontHeight", aTmp ); } -class SwHTMLFormPendingStackData_Impl: public SwPendingStackData -{ - uno::Reference< drawing::XShape > xShape; - Size aTextSz; - sal_Bool bMinWidth; - sal_Bool bMinHeight; - -public: - SwHTMLFormPendingStackData_Impl( - const uno::Reference< drawing::XShape > & rShape, const Size& rTextSz, - sal_Bool bMinW, sal_Bool bMinH ) : - xShape( rShape ), - aTextSz( rTextSz ), - bMinWidth( bMinW ), - bMinHeight( bMinH ) - {} - - const uno::Reference< drawing::XShape >& GetShape() const { return xShape; } - const Size& GetTextSize() const { return aTextSz; } - sal_Bool IsMinWidth() const { return bMinWidth; } - sal_Bool IsMinHeight() const { return bMinHeight; } -}; - -void SwHTMLParser::SetPendingControlSize() -{ - OSL_ENSURE( pPendStack, "Wo ist der Pending Stack?" ); - SwHTMLFormPendingStackData_Impl *pData = - (SwHTMLFormPendingStackData_Impl *)pPendStack->pData; - - SwPendingStack* pTmp = pPendStack->pNext; - delete pPendStack; - pPendStack = pTmp; - OSL_ENSURE( !pPendStack, "Wo kommt der Pending-Stack her?" ); - - SetControlSize( pData->GetShape(), pData->GetTextSize(), - pData->IsMinWidth(), pData->IsMinHeight() ); - delete pData; -} - void SwHTMLParser::SetControlSize( const uno::Reference< drawing::XShape >& rShape, const Size& rTextSz, sal_Bool bMinWidth, @@ -1453,11 +1414,7 @@ void SwHTMLParser::EndForm( sal_Bool bAppend ) void SwHTMLParser::InsertInput() { - if( pPendStack ) - { - SetPendingControlSize(); - return; - } + assert(pPendStack == 0); if( !pFormImpl || !pFormImpl->GetFormComps().is() ) return; @@ -1947,11 +1904,7 @@ void SwHTMLParser::InsertInput() void SwHTMLParser::NewTextArea() { - if( pPendStack ) - { - SetPendingControlSize(); - return; - } + assert(pPendStack == 0); OSL_ENSURE( !bTextArea, "TextArea in TextArea???" ); OSL_ENSURE( !pFormImpl || !pFormImpl->GetFCompPropSet().is(), @@ -2243,11 +2196,7 @@ void SwHTMLParser::InsertTextAreaText( sal_uInt16 nToken ) void SwHTMLParser::NewSelect() { - if( pPendStack ) - { - SetPendingControlSize(); - return; - } + assert(pPendStack == 0); OSL_ENSURE( !bSelect, "Select in Select???" ); OSL_ENSURE( !pFormImpl || !pFormImpl->GetFCompPropSet().is(), @@ -2467,11 +2416,7 @@ void SwHTMLParser::NewSelect() void SwHTMLParser::EndSelect() { - if( pPendStack ) - { - SetPendingControlSize(); - return; - } + assert(pPendStack == 0); OSL_ENSURE( bSelect, "keine Select" ); OSL_ENSURE( pFormImpl && pFormImpl->GetFCompPropSet().is(), diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index 70648b7..86e39fb 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -788,7 +788,6 @@ private: sal_Bool bHidden = sal_False ); void SetControlSize( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rShape, const Size& rTextSz, sal_Bool bMinWidth, sal_Bool bMinHeight ); - void SetPendingControlSize(); public: void ResizeDrawObject( SdrObject* pObj, SwTwips nWidth ); commit f1bef898250c1291a280c5041d914ff500bed7b5 Author: David Tardon <dtar...@redhat.com> Date: Tue Apr 15 12:24:09 2014 +0200 upload libetonyek 0.0.4 Change-Id: I64a35ca0902ba40a4fba3080181147b4facac2ee diff --git a/download.lst b/download.lst index 12cf008..40f9ff2 100644 --- a/download.lst +++ b/download.lst @@ -10,8 +10,8 @@ COINMP_MD5SUM := 1cce53bf4b40ae29790d2c5c9f8b1129 export COINMP_TARBALL := CoinMP-1.7.6.tgz EBOOK_MD5SUM := 2f1ceaf2ac8752ed278e175447d9b978 export EBOOK_TARBALL := libe-book-0.0.3.tar.bz2 -ETONYEK_MD5SUM := 9dad826726da4d4ad60084968691f5f4 -export ETONYEK_TARBALL := libetonyek-0.0.3.tar.bz2 +ETONYEK_MD5SUM := 3c50bc60394d1f2675fbf9bd22581363 +export ETONYEK_TARBALL := libetonyek-0.0.4.tar.bz2 FREEHAND_MD5SUM := 496dd00028afcc19f896b01394769043 export FREEHAND_TARBALL := libfreehand-0.0.0.tar.bz2 MSPUB_MD5SUM := 1120705cd0f0d9bd5506360bf57b6c2e diff --git a/external/libetonyek/0001-Comma-at-the-end-of-emum-list.patch.1 b/external/libetonyek/0001-Comma-at-the-end-of-emum-list.patch.1 deleted file mode 100644 index 816039b..0000000 --- a/external/libetonyek/0001-Comma-at-the-end-of-emum-list.patch.1 +++ /dev/null @@ -1,26 +0,0 @@ -From c2065764ae0826409f1dd683e52b7ca65f092972 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.st...@bluewin.ch> -Date: Fri, 6 Dec 2013 18:35:28 +0100 -Subject: [PATCH] Comma at the end of emum list - -Change-Id: I1370488e5bf682e23a923f37c09e76081aee7493 ---- - src/lib/KEYEnum.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/lib/KEYEnum.h b/src/lib/KEYEnum.h -index f0e027f..9e5e61f 100644 ---- a/src/lib/KEYEnum.h -+++ b/src/lib/KEYEnum.h -@@ -33,7 +33,7 @@ enum KEYCapitalization - KEY_CAPITALIZATION_NONE, - KEY_CAPITALIZATION_ALL_CAPS, - KEY_CAPITALIZATION_SMALL_CAPS, -- KEY_CAPITALIZATION_TITLE, -+ KEY_CAPITALIZATION_TITLE - }; - - } --- -1.8.4.2 - diff --git a/external/libetonyek/UnpackedTarball_libetonyek.mk b/external/libetonyek/UnpackedTarball_libetonyek.mk index 0db9596..52e6a95 100644 --- a/external/libetonyek/UnpackedTarball_libetonyek.mk +++ b/external/libetonyek/UnpackedTarball_libetonyek.mk @@ -11,9 +11,4 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,libetonyek)) $(eval $(call gb_UnpackedTarball_set_tarball,libetonyek,$(ETONYEK_TARBALL))) -$(eval $(call gb_UnpackedTarball_add_patches,libetonyek,\ - external/libetonyek/0001-Comma-at-the-end-of-emum-list.patch.1 \ - external/libetonyek/libetonyek-0.0.3-lexical_cast.patch \ -)) - # vim: set noet sw=4 ts=4: diff --git a/external/libetonyek/libetonyek-0.0.3-lexical_cast.patch b/external/libetonyek/libetonyek-0.0.3-lexical_cast.patch deleted file mode 100644 index fbd8bf6..0000000 --- a/external/libetonyek/libetonyek-0.0.3-lexical_cast.patch +++ /dev/null @@ -1,56 +0,0 @@ ---- a/libetonyek-0.0.3/src/lib/KEY2ParserUtils.cpp 2013-12-01 21:44:51.000000000 +0100 -+++ b/libetonyek-0.0.3/src/lib/KEY2ParserUtils.cpp 2013-12-15 06:53:07.474721349 +0100 -@@ -125,7 +125,7 @@ - return KEYSize(size.second, size.first); - } - --bool KEY2ParserUtils::bool_cast(const char *const value) -+bool KEY2ParserUtils::bool_cast(const char *value) - { - KEY2Tokenizer tok; - switch (tok(value)) -@@ -142,6 +142,16 @@ - return false; - } - -+double KEY2ParserUtils::double_cast(const char *value) -+{ -+ return lexical_cast<double, const char *>(value); -+} -+ -+int KEY2ParserUtils::int_cast(const char *value) -+{ -+ return lexical_cast<int, const char *>(value); -+} -+ - double KEY2ParserUtils::deg2rad(double value) - { - // normalize range ---- a/libetonyek-0.0.3/src/lib/KEY2ParserUtils.h 2013-10-30 22:04:38.000000000 +0100 -+++ b/libetonyek-0.0.3/src/lib/KEY2ParserUtils.h 2013-12-15 06:50:40.296884951 +0100 -@@ -81,6 +81,8 @@ - * @returns the boolean value of the string - */ - static bool bool_cast(const char *value); -+ static double double_cast(const char *value); -+ static int int_cast(const char *value); - - static double deg2rad(double value); - ---- a/libetonyek-0.0.3/src/lib/KEY2StyleParser.cpp 2013-12-06 10:36:13.000000000 +0100 -+++ b/libetonyek-0.0.3/src/lib/KEY2StyleParser.cpp 2013-12-15 06:53:45.353451061 +0100 -@@ -62,12 +62,12 @@ - - optional<double> readDouble(const KEYXMLReader &reader) - { -- return readNumber<double>(reader, KEY2Token::f, &lexical_cast<double, const char *>); -+ return readNumber<double>(reader, KEY2Token::f, &KEY2ParserUtils::double_cast); - } - - optional<int> readInt(const KEYXMLReader &reader) - { -- return readNumber<int>(reader, KEY2Token::i, &lexical_cast<int, const char *>); -+ return readNumber<int>(reader, KEY2Token::i, &KEY2ParserUtils::double_cast); - } - - optional<KEYColor> readColor(const KEYXMLReader &reader) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits