diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2010-03-29 16:24:13 +0200 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2010-03-29 16:24:13 +0200 |
commit | 75877a17a64411bd6bbad536f0d6885d69b5f149 (patch) | |
tree | 1224598cba20ca18cded549482e1f834b7ef6cf0 /sdext | |
parent | d0f36700a9d96e63ae82ac63edd67a6316398e42 (diff) |
native0ext:#161688# rebranding extensions - transplanted from 28f77bc32e70@native0
Diffstat (limited to 'sdext')
-rw-r--r-- | sdext/prj/d.lst | 2 | ||||
-rw-r--r-- | sdext/source/minimizer/description.xml | 7 | ||||
-rwxr-xr-x | sdext/source/minimizer/help/component.txt | 4 | ||||
-rw-r--r-- | sdext/source/minimizer/makefile.mk | 16 | ||||
-rw-r--r-- | sdext/source/pdfimport/config/description.xml | 6 | ||||
-rwxr-xr-x | sdext/source/pdfimport/help/component.txt | 4 | ||||
-rw-r--r-- | sdext/source/pdfimport/images/pdfiext.png | bin | 1965 -> 5483 bytes | |||
-rw-r--r-- | sdext/source/pdfimport/images/pdfiext_hc.png | bin | 1160 -> 3187 bytes | |||
-rwxr-xr-x | sdext/source/pdfimport/wrapper/wrapper.cxx | 63 | ||||
-rw-r--r-- | sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx | 53 |
10 files changed, 130 insertions, 25 deletions
diff --git a/sdext/prj/d.lst b/sdext/prj/d.lst index 802a8b348c35..71a91653c3d2 100644 --- a/sdext/prj/d.lst +++ b/sdext/prj/d.lst @@ -4,5 +4,5 @@ mkdir: %_DEST%\bin%_EXT%\pdfimport ..\%__SRC%\bin\pdf2xml.* %_DEST%\bin%_EXT%\pdf2xml.* ..\%__SRC%\bin\pdfunzip.* %_DEST%\bin%_EXT%\pdfunzip.* ..\%__SRC%\bin\pdfimport.oxt %_DEST%\bin%_EXT%\pdfimport\pdfimport.oxt -..\%__SRC%\bin\sun-presentation-minimizer.oxt %_DEST%\bin%_EXT%\minimizer\sun-presentation-minimizer.oxt +..\%__SRC%\bin\presentation-minimizer.oxt %_DEST%\bin%_EXT%\minimizer\presentation-minimizer.oxt ..\%__SRC%\bin\presenter-screen.oxt %_DEST%\bin%_EXT%\presenter\presenter-screen.oxt diff --git a/sdext/source/minimizer/description.xml b/sdext/source/minimizer/description.xml index 54cb88762a4d..777e3afff558 100644 --- a/sdext/source/minimizer/description.xml +++ b/sdext/source/minimizer/description.xml @@ -17,7 +17,7 @@ </simple-license> </registration> - <version value="1.0"/> + <version value="1.0.2"/> <platform value="UPDATED_SUPPORTED_PLATFORM"/> @@ -29,4 +29,9 @@ <name lang="en-US">Presentation Minimizer</name> </display-name> + <icon> + <default xlink:href="images/em42.png" /> + <high-contrast xlink:href="images/em42_hc.png" /> + </icon> + </description> diff --git a/sdext/source/minimizer/help/component.txt b/sdext/source/minimizer/help/component.txt index f6222edc2386..1ba57790087c 100755 --- a/sdext/source/minimizer/help/component.txt +++ b/sdext/source/minimizer/help/component.txt @@ -1,3 +1 @@ -The Presentation Minimizer is used to reduce the file size of the current -presentation. Images will be compressed, and data that is no longer needed -will be removed. +The Presentation Minimizer is used to reduce the file size of the current presentation. Images will be compressed, and data that is no longer needed will be removed. diff --git a/sdext/source/minimizer/makefile.mk b/sdext/source/minimizer/makefile.mk index 1140494e17de..a0b89e185fa7 100644 --- a/sdext/source/minimizer/makefile.mk +++ b/sdext/source/minimizer/makefile.mk @@ -27,7 +27,7 @@ PRJ=..$/.. PRJNAME=sdext -TARGET=SunPresentationMinimizer +TARGET=PresentationMinimizer GEN_HID=FALSE ENABLE_EXCEPTIONS=TRUE @@ -38,8 +38,8 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : $(PRJ)$/util$/makefile.pmk # set in minimizer.pmk -#EXTENSIONNAME:=SunPresentationMinimizer -EXTENSION_ZIPNAME:=sun-presentation-minimizer +#EXTENSIONNAME:=PresentationMinimizer +EXTENSION_ZIPNAME:=presentation-minimizer .IF "$(ENABLE_MINIMIZER)" != "YES" @all: @@ -106,6 +106,10 @@ COMPONENT_BITMAPS= \ $(EXTENSIONDIR)$/bitmaps$/minimizepresi_80.png \ $(EXTENSIONDIR)$/bitmaps$/minimizepresi_80_h.png +COMPONENT_IMAGES=\ + $(EXTENSIONDIR)$/bitmaps$/em42.png \ + $(EXTENSIONDIR)$/bitmaps$/em42_hc.png + # rather freestyle or common to all? COMPONENT_HELP= \ $(EXTENSIONDIR)$/help$/help_de.odt \ @@ -113,7 +117,7 @@ COMPONENT_HELP= \ $(EXTENSIONDIR)$/help$/component.txt # make sure to add your custom files here -EXTENSION_PACKDEPS=$(COMPONENT_BITMAPS) $(COMPONENT_HELP) +EXTENSION_PACKDEPS=$(COMPONENT_BITMAPS) $(COMPONENT_IMAGES) $(COMPONENT_HELP) # --- Targets ---------------------------------- @@ -129,6 +133,10 @@ $(COMPONENT_BITMAPS) : $(SOLARSRC)$/$(RSCDEFIMG)$/minimizer$/$$(@:f) @@-$(MKDIRHIER) $(@:d) $(COPY) $< $@ +$(COMPONENT_IMAGES) : images$/$$(@:f) + @@-$(MKDIRHIER) $(@:d) + $(COPY) $< $@ + $(COMPONENT_HELP) : help$/$$(@:f) @@-$(MKDIRHIER) $(@:d) $(COPY) $< $@ diff --git a/sdext/source/pdfimport/config/description.xml b/sdext/source/pdfimport/config/description.xml index 08e2f505653a..c2d36bd58be1 100644 --- a/sdext/source/pdfimport/config/description.xml +++ b/sdext/source/pdfimport/config/description.xml @@ -11,7 +11,7 @@ </dependencies> <registration> - <simple-license accept-by="admin" default-license-id="lic-en-US"> + <simple-license accept-by="admin" default-license-id="lic-en-US" suppress-if-required="true" > <license-text xlink:href="licensefile" lang="isocode" license-id="lic-isocode"/> </simple-license> </registration> @@ -21,11 +21,11 @@ <platform value="UPDATED_SUPPORTED_PLATFORM" /> <publisher> - <name xlink:href="http://www.sun.com/software/star/staroffice/extensions.jsp?cid=925095" lang="en">Sun Microsystems</name> + <name xlink:href="http://www.sun.com/software/star/staroffice/extensions.jsp?cid=925095" lang="en">Oracle</name> </publisher> <display-name> - <name lang="en-US">PDF Import Extension</name> + <name lang="en-US">PDF Import</name> </display-name> <icon> diff --git a/sdext/source/pdfimport/help/component.txt b/sdext/source/pdfimport/help/component.txt index e2dfbc9b99f6..dc138d891f80 100755 --- a/sdext/source/pdfimport/help/component.txt +++ b/sdext/source/pdfimport/help/component.txt @@ -1,3 +1 @@ -PDF documents are imported in Draw and Impress to preserve the layout and to -allow basic editing. It is the perfect solution for changing dates, numbers -or small portions of text. +PDF documents are imported in Draw and Impress to preserve the layout and to allow basic editing. It is the perfect solution for changing dates, numbers or small portions of text. diff --git a/sdext/source/pdfimport/images/pdfiext.png b/sdext/source/pdfimport/images/pdfiext.png Binary files differindex 31f48ea8fb69..cf3fe5f0d598 100644 --- a/sdext/source/pdfimport/images/pdfiext.png +++ b/sdext/source/pdfimport/images/pdfiext.png diff --git a/sdext/source/pdfimport/images/pdfiext_hc.png b/sdext/source/pdfimport/images/pdfiext_hc.png Binary files differindex 3870cc4709d4..881a1c3b3601 100644 --- a/sdext/source/pdfimport/images/pdfiext_hc.png +++ b/sdext/source/pdfimport/images/pdfiext_hc.png diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx index abab9d783225..0eafbbb83327 100755 --- a/sdext/source/pdfimport/wrapper/wrapper.cxx +++ b/sdext/source/pdfimport/wrapper/wrapper.cxx @@ -197,6 +197,60 @@ public: void parseLine( const ::rtl::OString& rLine ); }; + +namespace +{ + + /** Unescapes line-ending characters in input string. These + characters are encoded as pairs of characters: '\\' 'n', resp. + '\\' 'r'. This function converts them back to '\n', resp. '\r'. + */ + rtl::OString lcl_unescapeLineFeeds(const rtl::OString& i_rStr) + { + const size_t nOrigLen(sal::static_int_cast<size_t>(i_rStr.getLength())); + const sal_Char* const pOrig(i_rStr.getStr()); + sal_Char* const pBuffer(new sal_Char[nOrigLen + 1]); + + const sal_Char* pRead(pOrig); + sal_Char* pWrite(pBuffer); + const sal_Char* pCur(pOrig); + while ((pCur = strchr(pCur, '\\')) != 0) + { + const sal_Char cNext(pCur[1]); + if (cNext == 'n' || cNext == 'r' || cNext == '\\') + { + const size_t nLen(pCur - pRead); + strncpy(pWrite, pRead, nLen); + pWrite += nLen; + *pWrite = cNext == 'n' ? '\n' : (cNext == 'r' ? '\r' : '\\'); + ++pWrite; + pCur = pRead = pCur + 2; + } + else + { + // Just continue on the next character. The current + // block will be copied the next time it goes through the + // 'if' branch. + ++pCur; + } + } + // maybe there are some data to copy yet + if (sal::static_int_cast<size_t>(pRead - pOrig) < nOrigLen) + { + const size_t nLen(nOrigLen - (pRead - pOrig)); + strncpy(pWrite, pRead, nLen); + pWrite += nLen; + } + *pWrite = '\0'; + + rtl::OString aResult(pBuffer); + delete[] pBuffer; + return aResult; + } + +} + + ::rtl::OString Parser::readNextToken() { OSL_PRECOND(m_nCharIndex!=-1,"insufficient input"); @@ -322,7 +376,7 @@ void Parser::readChar() readDouble(aUnoMatrix.m10); readDouble(aUnoMatrix.m11); - rtl::OString aChars = m_aLine.copy( m_nCharIndex ); + rtl::OString aChars = lcl_unescapeLineFeeds( m_aLine.copy( m_nCharIndex ) ); // chars gobble up rest of line m_nCharIndex = -1; @@ -476,7 +530,7 @@ void Parser::readFont() readInt32(nFileLen); nSize = nSize < 0.0 ? -nSize : nSize; - aFontName = m_aLine.copy( m_nCharIndex ); + aFontName = lcl_unescapeLineFeeds( m_aLine.copy( m_nCharIndex ) ); // name gobbles up rest of line m_nCharIndex = -1; @@ -668,8 +722,9 @@ void Parser::readLink() readDouble(aBounds.Y2); m_pSink->hyperLink( aBounds, - rtl::OStringToOUString( m_aLine.copy(m_nCharIndex), - RTL_TEXTENCODING_UTF8 )); + rtl::OStringToOUString( lcl_unescapeLineFeeds( + m_aLine.copy(m_nCharIndex) ), + RTL_TEXTENCODING_UTF8 ) ); // name gobbles up rest of line m_nCharIndex = -1; } diff --git a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx index 1fa9ff32b530..5361330fd697 100644 --- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx +++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx @@ -37,6 +37,8 @@ #include <math.h> #include <vector> +#include <boost/shared_array.hpp> + #if defined __SUNPRO_CC #pragma disable_warn #elif defined _MSC_VER @@ -78,10 +80,44 @@ inline double normalize( double val ) return fabs(val) < 0.0000001 ? 0.0 : val; } -const char* escapeLineFeed( const char* pStr ) +namespace +{ + +/** Escapes line-ending characters (\n and \r) in input string. + */ +boost::shared_array<char> lcl_escapeLineFeeds(const char* const i_pStr) { - // TODO(Q3): Escape linefeeds - return pStr; + size_t nLength(strlen(i_pStr)); + char* pBuffer = new char[2*nLength+1]; + + const char* pRead = i_pStr; + char* pWrite = pBuffer; + while( nLength-- ) + { + if( *pRead == '\r' ) + { + *pWrite++ = '\\'; + *pWrite++ = 'r'; + } + else if( *pRead == '\n' ) + { + *pWrite++ = '\\'; + *pWrite++ = 'n'; + } + else if( *pRead == '\\' ) + { + *pWrite++ = '\\'; + *pWrite++ = '\\'; + } + else + *pWrite++ = *pRead; + pRead++; + } + *pWrite++ = 0; + + return boost::shared_array<char>(pBuffer); +} + } /// for the temp char buffer the header gets snprintfed in @@ -464,12 +500,14 @@ void PDFOutDev::processLink(Link* link, Catalog*) { const char* pURI = static_cast<LinkURI*>(pAction)->getURI()->getCString(); + boost::shared_array<char> pEsc( lcl_escapeLineFeeds(pURI) ); + printf( "drawLink %f %f %f %f %s\n", normalize(x1), normalize(y1), normalize(x2), normalize(y2), - escapeLineFeed(pURI) ); + pEsc.get() ); } } @@ -634,6 +672,8 @@ void PDFOutDev::updateFont(GfxState *state) printf( " %lld", fontID ); aFont = it->second; + + boost::shared_array<char> pEsc( lcl_escapeLineFeeds(aFont.familyName.getCString()) ); printf( " %d %d %d %d %f %d %s", aFont.isEmbedded, aFont.isBold, @@ -641,7 +681,7 @@ void PDFOutDev::updateFont(GfxState *state) aFont.isUnderline, normalize(state->getTransformedFontSize()), nEmbedSize, - escapeLineFeed(aFont.familyName.getCString()) ); + pEsc.get() ); } printf( "\n" ); @@ -765,7 +805,8 @@ void PDFOutDev::drawChar(GfxState *state, double x, double y, for( int i=0; i<uLen; ++i ) { buf[ m_pUtf8Map->mapUnicode(u[i], buf, sizeof(buf)-1) ] = 0; - printf( "%s", escapeLineFeed(buf) ); + boost::shared_array<char> pEsc( lcl_escapeLineFeeds(buf) ); + printf( "%s", pEsc.get() ); } printf( "\n" ); |