Kaydet (Commit) cf64a0ad authored tarafından Daniel Rentz [dr]'s avatar Daniel Rentz [dr]

dr77: rebase to DEV300m92

This diff is collapsed.
...@@ -70,7 +70,7 @@ const DeviceInfo& GraphicCollector::GetDeviceInfo( const Reference< XComponentCo ...@@ -70,7 +70,7 @@ const DeviceInfo& GraphicCollector::GetDeviceInfo( const Reference< XComponentCo
return aDeviceInfo; return aDeviceInfo;
} }
void ImpAddEntity( std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities, Reference< XGraphic >& rxGraphic, const GraphicSettings& rGraphicSettings, const GraphicCollector::GraphicUser& rUser ) void ImpAddEntity( std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities, const GraphicSettings& rGraphicSettings, const GraphicCollector::GraphicUser& rUser )
{ {
const rtl::OUString aGraphicURL( rUser.maGraphicURL ); const rtl::OUString aGraphicURL( rUser.maGraphicURL );
const rtl::OUString sPackageURL( OUString::createFromAscii( "vnd.sun.star.GraphicObject:" ) ); const rtl::OUString sPackageURL( OUString::createFromAscii( "vnd.sun.star.GraphicObject:" ) );
...@@ -93,7 +93,7 @@ void ImpAddEntity( std::vector< GraphicCollector::GraphicEntity >& rGraphicEntit ...@@ -93,7 +93,7 @@ void ImpAddEntity( std::vector< GraphicCollector::GraphicEntity >& rGraphicEntit
} }
if ( aIter == rGraphicEntities.end() ) if ( aIter == rGraphicEntities.end() )
{ {
GraphicCollector::GraphicEntity aEntity( rxGraphic, rUser ); GraphicCollector::GraphicEntity aEntity( rUser );
rGraphicEntities.push_back( aEntity ); rGraphicEntities.push_back( aEntity );
} }
} }
...@@ -133,7 +133,7 @@ void ImpAddGraphicEntity( const Reference< XComponentContext >& rxMSF, Reference ...@@ -133,7 +133,7 @@ void ImpAddGraphicEntity( const Reference< XComponentContext >& rxMSF, Reference
} }
aUser.maGraphicCropLogic = aGraphicCropLogic; aUser.maGraphicCropLogic = aGraphicCropLogic;
aUser.maLogicalSize = aLogicalSize; aUser.maLogicalSize = aLogicalSize;
ImpAddEntity( rGraphicEntities, xGraphic, rGraphicSettings, aUser ); ImpAddEntity( rGraphicEntities, rGraphicSettings, aUser );
} }
} }
...@@ -198,7 +198,7 @@ void ImpAddFillBitmapEntity( const Reference< XComponentContext >& rxMSF, const ...@@ -198,7 +198,7 @@ void ImpAddFillBitmapEntity( const Reference< XComponentContext >& rxMSF, const
aUser.mbFillBitmap = sal_True; aUser.mbFillBitmap = sal_True;
aUser.maLogicalSize = aLogicalSize; aUser.maLogicalSize = aLogicalSize;
aUser.mxPagePropertySet = rxPagePropertySet; aUser.mxPagePropertySet = rxPagePropertySet;
ImpAddEntity( rGraphicEntities, xGraphic, rGraphicSettings, aUser ); ImpAddEntity( rGraphicEntities, rGraphicSettings, aUser );
} }
} }
} }
......
...@@ -76,14 +76,13 @@ class GraphicCollector ...@@ -76,14 +76,13 @@ class GraphicCollector
struct GraphicEntity struct GraphicEntity
{ {
com::sun::star::uno::Reference< com::sun::star::graphic::XGraphic > mxGraphic; // the corresponding XGraphic of the Shape
com::sun::star::awt::Size maLogicalSize; // the biggest logical size the graphic will be displayed com::sun::star::awt::Size maLogicalSize; // the biggest logical size the graphic will be displayed
sal_Bool mbRemoveCropArea; // sal_Bool mbRemoveCropArea; //
com::sun::star::text::GraphicCrop maGraphicCropLogic; com::sun::star::text::GraphicCrop maGraphicCropLogic;
std::vector< GraphicUser > maUser; std::vector< GraphicUser > maUser;
GraphicEntity( const com::sun::star::uno::Reference< com::sun::star::graphic::XGraphic >& xGraphic, const GraphicUser& rUser ) GraphicEntity( const GraphicUser& rUser )
: mxGraphic( xGraphic ), maLogicalSize( rUser.maLogicalSize ), mbRemoveCropArea( sal_False ), maGraphicCropLogic( 0, 0, 0, 0 ) { maUser.push_back( rUser ); }; : maLogicalSize( rUser.maLogicalSize ), mbRemoveCropArea( sal_False ), maGraphicCropLogic( 0, 0, 0, 0 ) { maUser.push_back( rUser ); };
}; };
static const com::sun::star::awt::DeviceInfo& GetDeviceInfo( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxFact ); static const com::sun::star::awt::DeviceInfo& GetDeviceInfo( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxFact );
......
...@@ -76,7 +76,7 @@ SHL1DEPN= ...@@ -76,7 +76,7 @@ SHL1DEPN=
SHL1IMPLIB= i$(SHL1TARGET) SHL1IMPLIB= i$(SHL1TARGET)
SHL1LIBS= $(SLB)$/$(TARGET).lib SHL1LIBS= $(SLB)$/$(TARGET).lib
SHL1DEF= $(MISC)$/$(SHL1TARGET).def SHL1DEF= $(MISC)$/$(SHL1TARGET).def
SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1VERSIONMAP=$(SOLARENV)/src/reg-component.map
SHL1RPATH= OXT SHL1RPATH= OXT
DEF1NAME= $(SHL1TARGET) DEF1NAME= $(SHL1TARGET)
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</simple-license> </simple-license>
</registration> </registration>
<version value="1.0.3" /> <version value="1.0.4" />
<platform value="UPDATED_SUPPORTED_PLATFORM" /> <platform value="UPDATED_SUPPORTED_PLATFORM" />
......
...@@ -53,7 +53,7 @@ namespace pdfi ...@@ -53,7 +53,7 @@ namespace pdfi
virtual boost::shared_ptr<ElementTreeVisitor> createStyleCollectingVisitor( virtual boost::shared_ptr<ElementTreeVisitor> createStyleCollectingVisitor(
StyleContainer&, PDFIProcessor&) const = 0; StyleContainer&, PDFIProcessor&) const = 0;
/// Create visitor that emits tree to an output target /// 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; typedef boost::shared_ptr<TreeVisitorFactory> TreeVisitorFactorySharedPtr;
......
...@@ -90,7 +90,7 @@ SHL1STDLIBS=\ ...@@ -90,7 +90,7 @@ SHL1STDLIBS=\
SHL1DEPN= SHL1DEPN=
SHL1IMPLIB= i$(SHL1TARGET) SHL1IMPLIB= i$(SHL1TARGET)
SHL1DEF= $(MISC)$/$(SHL1TARGET).def SHL1DEF= $(MISC)$/$(SHL1TARGET).def
SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1VERSIONMAP=$(SOLARENV)/src/reg-component.map
SHL1RPATH=OXT SHL1RPATH=OXT
DEF1NAME=$(SHL1TARGET) DEF1NAME=$(SHL1TARGET)
......
...@@ -36,13 +36,15 @@ ...@@ -36,13 +36,15 @@
#include "drawtreevisiting.hxx" #include "drawtreevisiting.hxx"
#include "genericelements.hxx" #include "genericelements.hxx"
#include <basegfx/polygon/b2dpolypolygontools.hxx> #include "basegfx/polygon/b2dpolypolygontools.hxx"
#include <basegfx/range/b2drange.hxx> #include "basegfx/range/b2drange.hxx"
#include <com/sun/star/i18n/XBreakIterator.hpp> #include "com/sun/star/i18n/XBreakIterator.hpp"
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "comphelper/processfactory.hxx" #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> #include <string.h>
using namespace ::com::sun::star; using namespace ::com::sun::star;
...@@ -79,6 +81,18 @@ const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator > ...@@ -79,6 +81,18 @@ const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator >
return mxBreakIter; 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& ) void DrawXmlEmitter::visit( HyperlinkElement& elem, const std::list< Element* >::const_iterator& )
{ {
if( elem.Children.empty() ) if( elem.Children.empty() )
...@@ -119,30 +133,25 @@ void DrawXmlEmitter::visit( TextElement& elem, const std::list< Element* >::cons ...@@ -119,30 +133,25 @@ void DrawXmlEmitter::visit( TextElement& elem, const std::list< Element* >::cons
rtl::OUString str(elem.Text.getStr()); rtl::OUString str(elem.Text.getStr());
// Check for CTL // Check for RTL
bool isComplex = false; bool isRTL = false;
for(int i=0; i< elem.Text.getLength(); i++) Reference< i18n::XCharacterClassification > xCC( GetCharacterClassification() );
{ if( xCC.is() )
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
{ {
rtl::OUString flippedStr(RTL_CONSTASCII_USTRINGPARAM( "" )); for(int i=1; i< elem.Text.getLength(); i++)
for(int i = str.getLength() - 1; i >= 0; i--)
{ {
sal_Unicode cChar = str[ i ]; sal_Int16 nType = xCC->getCharacterDirection( str, i );
cChar = static_cast<sal_Unicode>(GetMirroredChar( cChar )); if ( nType == ::com::sun::star::i18n::DirectionProperty_RIGHT_TO_LEFT ||
rtl::OUString uC(cChar); nType == ::com::sun::star::i18n::DirectionProperty_RIGHT_TO_LEFT_ARABIC ||
flippedStr += uC; 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 ); m_rEmitContext.rEmitter.beginTag( "text:span", aProps );
......
...@@ -29,9 +29,11 @@ ...@@ -29,9 +29,11 @@
#define INCLUDED_PDFI_DRAWTREEVISITING_HXX #define INCLUDED_PDFI_DRAWTREEVISITING_HXX
#include "treevisiting.hxx" #include "treevisiting.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/uno/XComponentContext.hpp> #include "com/sun/star/i18n/XCharacterClassification.hpp"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/uno/XComponentContext.hpp"
namespace pdfi namespace pdfi
{ {
...@@ -89,6 +91,9 @@ 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::lang::XMultiServiceFactory > xFactory;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > xCtx; ::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::XBreakIterator > mxBreakIter;
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCharacterClassification > mxCharClass;
PDFIProcessor& m_rProcessor;
EmitContext& m_rEmitContext ; EmitContext& m_rEmitContext ;
/// writes Impress doc when false /// writes Impress doc when false
...@@ -100,8 +105,10 @@ namespace pdfi ...@@ -100,8 +105,10 @@ namespace pdfi
public: public:
const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XBreakIterator >& GetBreakIterator(); 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 }; 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_rEmitContext(rEmitContext),
m_bWriteDrawDocument(eDocType==DRAW_DOC) m_bWriteDrawDocument(eDocType==DRAW_DOC)
{} {}
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#ifndef INCLUDED_PDFI_PROCESSOR_HXX #ifndef INCLUDED_PDFI_PROCESSOR_HXX
#define 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/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp> #include <com/sun/star/task/XStatusIndicator.hpp>
#include <com/sun/star/rendering/XVolatileBitmap.hpp> #include <com/sun/star/rendering/XVolatileBitmap.hpp>
...@@ -108,7 +109,10 @@ namespace pdfi ...@@ -108,7 +109,10 @@ namespace pdfi
void sortElements( Element* pElement, bool bDeep = false ); void sortElements( Element* pElement, bool bDeep = false );
void sortDocument( bool bDeep = false ); void sortDocument( bool bDeep = false );
rtl::OUString mirrorString( const rtl::OUString& i_rInString );
private: private:
void prepareMirrorMap();
void processGlyphLine(); void processGlyphLine();
void processGlyph( double fPreAvarageSpaceValue, void processGlyph( double fPreAvarageSpaceValue,
CharGlyph& rGlyph, CharGlyph& rGlyph,
...@@ -242,6 +246,11 @@ namespace pdfi ...@@ -242,6 +246,11 @@ namespace pdfi
m_xStatusIndicator; m_xStatusIndicator;
bool m_bHaveTextOnDocLevel; 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 class CharGlyph
{ {
......
...@@ -50,7 +50,7 @@ namespace pdfi ...@@ -50,7 +50,7 @@ namespace pdfi
return boost::shared_ptr<ElementTreeVisitor>(new WriterXmlFinalizer(rStyles,rProc)); 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)); return boost::shared_ptr<ElementTreeVisitor>(new WriterXmlEmitter(rEmitContext));
} }
...@@ -72,10 +72,12 @@ namespace pdfi ...@@ -72,10 +72,12 @@ namespace pdfi
return boost::shared_ptr<ElementTreeVisitor>(new DrawXmlFinalizer(rStyles,rProc)); 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, return boost::shared_ptr<ElementTreeVisitor>(new DrawXmlEmitter(rEmitContext,
DrawXmlEmitter::IMPRESS_DOC)); DrawXmlEmitter::IMPRESS_DOC,
rProc
));
} }
}; };
...@@ -95,10 +97,12 @@ namespace pdfi ...@@ -95,10 +97,12 @@ namespace pdfi
return boost::shared_ptr<ElementTreeVisitor>(new DrawXmlFinalizer(rStyles,rProc)); 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, return boost::shared_ptr<ElementTreeVisitor>(new DrawXmlEmitter(rEmitContext,
DrawXmlEmitter::DRAW_DOC)); DrawXmlEmitter::DRAW_DOC,
rProc
));
} }
}; };
......
...@@ -108,7 +108,7 @@ SHL1DEPN= ...@@ -108,7 +108,7 @@ SHL1DEPN=
SHL1IMPLIB= i$(SHL1TARGET) SHL1IMPLIB= i$(SHL1TARGET)
SHL1LIBS= $(SLB)$/$(TARGET).lib SHL1LIBS= $(SLB)$/$(TARGET).lib
SHL1DEF= $(MISC)$/$(SHL1TARGET).def SHL1DEF= $(MISC)$/$(SHL1TARGET).def
SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1VERSIONMAP=$(SOLARENV)/src/reg-component.map
SHL1RPATH= OXT SHL1RPATH= OXT
DEF1NAME= $(SHL1TARGET) DEF1NAME= $(SHL1TARGET)
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<!-- build options --> <!-- build options -->
<property name="sourcelevel" value="1.4"/> <property name="sourcelevel" value="1.4"/>
<property name="verbose" value="false"/> <property name="verbose" value="false"/>
<property name="debug" value="true"/> <property name="debug" value="${antdebug}"/>
<!-- build classpath --> <!-- build classpath -->
<path id="classpath"> <path id="classpath">
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
</target> </target>
<target name="compile" depends="init"> <target name="compile" depends="init">
<javac debug="${debug}" destdir="${classes}" classpathref="classpath" <javac debug="${debug}" debuglevel="lines,vars,source" destdir="${classes}" classpathref="classpath"
source="${sourcelevel}" verbose="${verbose}"> source="${sourcelevel}" verbose="${verbose}">
<src path="src"/> <src path="src"/>
</javac> </javac>
......
...@@ -41,7 +41,13 @@ COMMONS_LOGGING_JAR=$(SOLARVER)$/$(INPATH)$/bin$(UPDMINOREXT)$/commons-logging-1 ...@@ -41,7 +41,13 @@ COMMONS_LOGGING_JAR=$(SOLARVER)$/$(INPATH)$/bin$(UPDMINOREXT)$/commons-logging-1
COMP=fix_system_commons COMP=fix_system_commons
.ENDIF .ENDIF
ANT_FLAGS+=-Dcommons-codec-jar=$(COMMONS_CODEC_JAR) -Dcommons-lang-jar=$(COMMONS_LANG_JAR) -Dcommons-httpclient-jar=$(COMMONS_HTTPCLIENT_JAR) -Dcommons-logging-jar=$(COMMONS_LOGGING_JAR) .IF defined(debug) || defined(DEBUG)
ANTDEBUG=true
.ELSE
ANTDEBUG=off
.ENDIF
ANT_FLAGS+=-Dcommons-codec-jar=$(COMMONS_CODEC_JAR) -Dcommons-lang-jar=$(COMMONS_LANG_JAR) -Dcommons-httpclient-jar=$(COMMONS_HTTPCLIENT_JAR) -Dcommons-logging-jar=$(COMMONS_LOGGING_JAR) -Dantdebug=$(ANTDEBUG)
# creates two files wiki-publisher.oxt and mediawiki_develop.zip, the second one might be used in further build process # creates two files wiki-publisher.oxt and mediawiki_develop.zip, the second one might be used in further build process
ALLTAR: $(COMP) ANTBUILD ALLTAR: $(COMP) ANTBUILD
......
...@@ -35,6 +35,7 @@ public class EditPageParser extends HTMLEditorKit.ParserCallback ...@@ -35,6 +35,7 @@ public class EditPageParser extends HTMLEditorKit.ParserCallback
protected String m_sEditTime = ""; protected String m_sEditTime = "";
protected String m_sEditToken = ""; protected String m_sEditToken = "";
protected String m_sLoginToken = "";
protected String m_sMainURL = ""; protected String m_sMainURL = "";
private int m_nWikiArticleHash = 0; private int m_nWikiArticleHash = 0;
...@@ -100,6 +101,10 @@ public class EditPageParser extends HTMLEditorKit.ParserCallback ...@@ -100,6 +101,10 @@ public class EditPageParser extends HTMLEditorKit.ParserCallback
{ {
this.m_sEditToken = ( String ) a.getAttribute( HTML.Attribute.VALUE ); this.m_sEditToken = ( String ) a.getAttribute( HTML.Attribute.VALUE );
} }
else if ( sName.equalsIgnoreCase( "wpLoginToken" ) )
{
this.m_sLoginToken = ( String ) a.getAttribute( HTML.Attribute.VALUE );
}
} }
} }
......
...@@ -784,6 +784,29 @@ public class Helper ...@@ -784,6 +784,29 @@ public class Helper
return bResult; return bResult;
} }
static protected String GetLoginToken( String sLoginPage )
{
String sResult = "";
if ( sLoginPage != null && sLoginPage.length() > 0 )
{
try
{
StringReader aReader = new StringReader( sLoginPage );
HTMLEditorKit.Parser aParser = Helper.GetHTMLParser();
EditPageParser aCallbacks = new EditPageParser();
aParser.parse( aReader, aCallbacks, true );
sResult = aCallbacks.m_sLoginToken;
}
catch( Exception e )
{
e.printStackTrace();
}
}
return sResult;
}
static protected HostConfiguration Login( URI aMainURL, String sWikiUser, String sWikiPass, XComponentContext xContext ) static protected HostConfiguration Login( URI aMainURL, String sWikiUser, String sWikiPass, XComponentContext xContext )
throws com.sun.star.uno.Exception, java.io.IOException, WikiCancelException throws com.sun.star.uno.Exception, java.io.IOException, WikiCancelException
{ {
...@@ -799,10 +822,16 @@ public class Helper ...@@ -799,10 +822,16 @@ public class Helper
ExecuteMethod( aGetCookie, aNewHostConfig, aURI, xContext, true ); ExecuteMethod( aGetCookie, aNewHostConfig, aURI, xContext, true );
int nResultCode = aGetCookie.getStatusCode(); int nResultCode = aGetCookie.getStatusCode();
String sLoginPage = null;
if ( nResultCode == 200 )
sLoginPage = aGetCookie.getResponseBodyAsString();
aGetCookie.releaseConnection(); aGetCookie.releaseConnection();
if ( nResultCode == 200 ) if ( sLoginPage != null )
{ {
String sLoginToken = GetLoginToken( sLoginPage );
PostMethod aPost = new PostMethod(); PostMethod aPost = new PostMethod();
URI aPostURI = new URI( aMainURL.getPath() + "index.php?title=Special:Userlogin&action=submitlogin" ); URI aPostURI = new URI( aMainURL.getPath() + "index.php?title=Special:Userlogin&action=submitlogin" );
aPost.setPath( aPostURI.getEscapedPathQuery() ); aPost.setPath( aPostURI.getEscapedPathQuery() );
...@@ -810,6 +839,9 @@ public class Helper ...@@ -810,6 +839,9 @@ public class Helper
aPost.addParameter( "wpName", sWikiUser ); aPost.addParameter( "wpName", sWikiUser );
aPost.addParameter( "wpRemember", "1" ); aPost.addParameter( "wpRemember", "1" );
aPost.addParameter( "wpPassword", sWikiPass ); aPost.addParameter( "wpPassword", sWikiPass );
if ( sLoginToken.length() > 0 )
aPost.addParameter( "wpLoginToken", sLoginToken );
String[][] pArgs = GetSpecialArgs( xContext, aMainURL.getHost() ); String[][] pArgs = GetSpecialArgs( xContext, aMainURL.getHost() );
if ( pArgs != null ) if ( pArgs != null )
for ( int nArgInd = 0; nArgInd < pArgs.length; nArgInd++ ) for ( int nArgInd = 0; nArgInd < pArgs.length; nArgInd++ )
......
...@@ -145,6 +145,8 @@ public class WikiArticle ...@@ -145,6 +145,8 @@ public class WikiArticle
if ( nResultCode == 200 ) if ( nResultCode == 200 )
sWebPage = aRequest.getResponseBodyAsString(); sWebPage = aRequest.getResponseBodyAsString();
aRequest.releaseConnection();
if ( sWebPage != null ) if ( sWebPage != null )
{ {
StringReader r = new StringReader(sWebPage); StringReader r = new StringReader(sWebPage);
......
...@@ -48,7 +48,7 @@ dummy: ...@@ -48,7 +48,7 @@ dummy:
TARFILE_NAME=xpdf-3.02 TARFILE_NAME=xpdf-3.02
TARFILE_MD5=599dc4cc65a07ee868cf92a667a913d2 TARFILE_MD5=599dc4cc65a07ee868cf92a667a913d2
PATCH_FILES=$(TARFILE_NAME).patch PATCH_FILES=$(TARFILE_NAME).patch xpdf-3.02-sec.patch
CONFIGURE_DIR= CONFIGURE_DIR=
BUILD_DIR=$(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