Kaydet (Commit) df375693 authored tarafından Carsten Driesner's avatar Carsten Driesner

Rebase to DEV300m93

This diff is collapsed.
......@@ -16,7 +16,7 @@
</simple-license>
</registration>
<version value="1.0.3" />
<version value="1.0.4" />
<platform value="UPDATED_SUPPORTED_PLATFORM" />
......
......@@ -20,7 +20,7 @@
<value>pdf_Portable_Document_Format</value>
</prop>
<prop oor:name="UIName">
<value xml:lang="x-default">PDF - Portable Document Format</value>
<value xml:lang="x-default">PDF - Portable Document Format (Draw)</value>
</prop>
<prop oor:name="TemplateName"/>
<prop oor:name="UIComponent"/>
......@@ -49,7 +49,7 @@
<value>pdf_Portable_Document_Format</value>
</prop>
<prop oor:name="UIName">
<value xml:lang="x-default">PDF - Portable Document Format</value>
<value xml:lang="x-default">PDF - Portable Document Format (Impress)</value>
</prop>
<prop oor:name="TemplateName"/>
<prop oor:name="UIComponent"/>
......@@ -78,7 +78,7 @@
<value>pdf_Portable_Document_Format</value>
</prop>
<prop oor:name="UIName">
<value xml:lang="x-default">PDF - Portable Document Format</value>
<value xml:lang="x-default">PDF - Portable Document Format (Writer)</value>
</prop>
<prop oor:name="TemplateName"/>
<prop oor:name="UIComponent"/>
......
......@@ -53,7 +53,7 @@ namespace pdfi
virtual boost::shared_ptr<ElementTreeVisitor> createStyleCollectingVisitor(
StyleContainer&, PDFIProcessor&) const = 0;
/// Create visitor that emits tree to an output target
virtual boost::shared_ptr<ElementTreeVisitor> createEmittingVisitor(EmitContext&) const = 0;
virtual boost::shared_ptr<ElementTreeVisitor> createEmittingVisitor(EmitContext&, PDFIProcessor&) const = 0;
};
typedef boost::shared_ptr<TreeVisitorFactory> TreeVisitorFactorySharedPtr;
......
......@@ -36,13 +36,15 @@
#include "drawtreevisiting.hxx"
#include "genericelements.hxx"
#include <basegfx/polygon/b2dpolypolygontools.hxx>
#include <basegfx/range/b2drange.hxx>
#include "basegfx/polygon/b2dpolypolygontools.hxx"
#include "basegfx/range/b2drange.hxx"
#include <com/sun/star/i18n/XBreakIterator.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include "com/sun/star/i18n/XBreakIterator.hpp"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "comphelper/processfactory.hxx"
#include <com/sun/star/i18n/ScriptType.hpp>
#include "com/sun/star/i18n/ScriptType.hpp"
#include "com/sun/star/i18n/DirectionProperty.hpp"
#include <string.h>
using namespace ::com::sun::star;
......@@ -79,6 +81,18 @@ const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator >
return mxBreakIter;
}
const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCharacterClassification >& DrawXmlEmitter::GetCharacterClassification()
{
if ( !mxCharClass.is() )
{
Reference< XComponentContext > xContext( m_rEmitContext.m_xContext, uno::UNO_SET_THROW );
Reference< XMultiComponentFactory > xMSF( xContext->getServiceManager(), uno::UNO_SET_THROW );
Reference < XInterface > xInterface = xMSF->createInstanceWithContext(::rtl::OUString::createFromAscii("com.sun.star.i18n.CharacterClassification"), xContext);
mxCharClass = uno::Reference< i18n::XCharacterClassification >( xInterface, uno::UNO_QUERY );
}
return mxCharClass;
}
void DrawXmlEmitter::visit( HyperlinkElement& elem, const std::list< Element* >::const_iterator& )
{
if( elem.Children.empty() )
......@@ -119,30 +133,25 @@ void DrawXmlEmitter::visit( TextElement& elem, const std::list< Element* >::cons
rtl::OUString str(elem.Text.getStr());
// Check for CTL
bool isComplex = false;
for(int i=0; i< elem.Text.getLength(); i++)
{
sal_Int16 nType = GetBreakIterator()->getScriptType( str, i + 1);
if (nType == ::com::sun::star::i18n::ScriptType::COMPLEX)
isComplex = true;
}
#if 0
// FIXME: need to have a service to do this mirroring
if (isComplex) // If so, reverse string
// Check for RTL
bool isRTL = false;
Reference< i18n::XCharacterClassification > xCC( GetCharacterClassification() );
if( xCC.is() )
{
rtl::OUString flippedStr(RTL_CONSTASCII_USTRINGPARAM( "" ));
for(int i = str.getLength() - 1; i >= 0; i--)
for(int i=1; i< elem.Text.getLength(); i++)
{
sal_Unicode cChar = str[ i ];
cChar = static_cast<sal_Unicode>(GetMirroredChar( cChar ));
rtl::OUString uC(cChar);
flippedStr += uC;
sal_Int16 nType = xCC->getCharacterDirection( str, i );
if ( nType == ::com::sun::star::i18n::DirectionProperty_RIGHT_TO_LEFT ||
nType == ::com::sun::star::i18n::DirectionProperty_RIGHT_TO_LEFT_ARABIC ||
nType == ::com::sun::star::i18n::DirectionProperty_RIGHT_TO_LEFT_EMBEDDING ||
nType == ::com::sun::star::i18n::DirectionProperty_RIGHT_TO_LEFT_OVERRIDE
)
isRTL = true;
}
str = flippedStr;
}
#endif
if (isRTL) // If so, reverse string
str = m_rProcessor.mirrorString( str );
m_rEmitContext.rEmitter.beginTag( "text:span", aProps );
......
......@@ -29,9 +29,11 @@
#define INCLUDED_PDFI_DRAWTREEVISITING_HXX
#include "treevisiting.hxx"
#include <com/sun/star/i18n/XBreakIterator.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include "com/sun/star/i18n/XBreakIterator.hpp"
#include "com/sun/star/i18n/XCharacterClassification.hpp"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/uno/XComponentContext.hpp"
namespace pdfi
{
......@@ -89,6 +91,9 @@ namespace pdfi
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xCtx;
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > mxBreakIter;
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCharacterClassification > mxCharClass;
PDFIProcessor& m_rProcessor;
EmitContext& m_rEmitContext ;
/// writes Impress doc when false
......@@ -100,8 +105,10 @@ namespace pdfi
public:
const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator >& GetBreakIterator();
const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCharacterClassification >& GetCharacterClassification();
enum DocType{ DRAW_DOC, IMPRESS_DOC };
explicit DrawXmlEmitter(EmitContext& rEmitContext, DocType eDocType) :
explicit DrawXmlEmitter(EmitContext& rEmitContext, DocType eDocType, PDFIProcessor& rProc ) :
m_rProcessor( rProc ),
m_rEmitContext(rEmitContext),
m_bWriteDrawDocument(eDocType==DRAW_DOC)
{}
......
......@@ -28,6 +28,7 @@
#ifndef INCLUDED_PDFI_PROCESSOR_HXX
#define INCLUDED_PDFI_PROCESSOR_HXX
#include <com/sun/star/util/XStringMapping.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <com/sun/star/rendering/XVolatileBitmap.hpp>
......@@ -108,7 +109,10 @@ namespace pdfi
void sortElements( Element* pElement, bool bDeep = false );
void sortDocument( bool bDeep = false );
rtl::OUString mirrorString( const rtl::OUString& i_rInString );
private:
void prepareMirrorMap();
void processGlyphLine();
void processGlyph( double fPreAvarageSpaceValue,
CharGlyph& rGlyph,
......@@ -242,6 +246,11 @@ namespace pdfi
m_xStatusIndicator;
bool m_bHaveTextOnDocLevel;
std::vector< sal_Unicode > m_aMirrorMap;
com::sun::star::uno::Reference<
com::sun::star::util::XStringMapping >
m_xMirrorMapper;
bool m_bMirrorMapperTried;
};
class CharGlyph
{
......
......@@ -50,7 +50,7 @@ namespace pdfi
return boost::shared_ptr<ElementTreeVisitor>(new WriterXmlFinalizer(rStyles,rProc));
}
virtual boost::shared_ptr<ElementTreeVisitor> createEmittingVisitor(EmitContext& rEmitContext) const
virtual boost::shared_ptr<ElementTreeVisitor> createEmittingVisitor(EmitContext& rEmitContext, PDFIProcessor&) const
{
return boost::shared_ptr<ElementTreeVisitor>(new WriterXmlEmitter(rEmitContext));
}
......@@ -72,10 +72,12 @@ namespace pdfi
return boost::shared_ptr<ElementTreeVisitor>(new DrawXmlFinalizer(rStyles,rProc));
}
virtual boost::shared_ptr<ElementTreeVisitor> createEmittingVisitor(EmitContext& rEmitContext) const
virtual boost::shared_ptr<ElementTreeVisitor> createEmittingVisitor(EmitContext& rEmitContext, PDFIProcessor& rProc) const
{
return boost::shared_ptr<ElementTreeVisitor>(new DrawXmlEmitter(rEmitContext,
DrawXmlEmitter::IMPRESS_DOC));
DrawXmlEmitter::IMPRESS_DOC,
rProc
));
}
};
......@@ -95,10 +97,12 @@ namespace pdfi
return boost::shared_ptr<ElementTreeVisitor>(new DrawXmlFinalizer(rStyles,rProc));
}
virtual boost::shared_ptr<ElementTreeVisitor> createEmittingVisitor(EmitContext& rEmitContext) const
virtual boost::shared_ptr<ElementTreeVisitor> createEmittingVisitor(EmitContext& rEmitContext, PDFIProcessor& rProc) const
{
return boost::shared_ptr<ElementTreeVisitor>(new DrawXmlEmitter(rEmitContext,
DrawXmlEmitter::DRAW_DOC));
DrawXmlEmitter::DRAW_DOC,
rProc
));
}
};
......
......@@ -48,7 +48,7 @@ dummy:
TARFILE_NAME=xpdf-3.02
TARFILE_MD5=599dc4cc65a07ee868cf92a667a913d2
PATCH_FILES=$(TARFILE_NAME).patch
PATCH_FILES=$(TARFILE_NAME).patch xpdf-3.02-sec.patch
CONFIGURE_DIR=
BUILD_DIR=$(CONFIGURE_DIR)
......
--- misc/xpdf-3.02/fofi/FoFiType1.cc 2007-02-27 23:05:51.000000000 +0100
+++ misc/build/xpdf-3.02/fofi/FoFiType1.cc 2010-10-20 18:10:09.000000000 +0200
@@ -224,7 +224,7 @@
code = code * 8 + (*p2 - '0');
}
}
- if (code < 256) {
+ if (code < 256 && code >= 0) {
for (p = p2; *p == ' ' || *p == '\t'; ++p) ;
if (*p == '/') {
++p;
--- misc/xpdf-3.02/xpdf/Gfx.cc 2007-02-27 23:05:52.000000000 +0100
+++ misc/build/xpdf-3.02/xpdf/Gfx.cc 2010-10-20 18:14:32.000000000 +0200
@@ -444,6 +444,7 @@
xref = xrefA;
subPage = gFalse;
printCommands = globalParams->getPrintCommands();
+ parser = NULL;
// start the resource stack
res = new GfxResources(xref, resDict, NULL);
@@ -486,6 +487,7 @@
xref = xrefA;
subPage = gTrue;
printCommands = globalParams->getPrintCommands();
+ parser = NULL;
// start the resource stack
res = new GfxResources(xref, resDict, NULL);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment