summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--reportbuilder/util/hidother.src146
-rwxr-xr-x[-rw-r--r--]reportbuilder/util/makefile.pmk0
-rw-r--r--sdext/source/minimizer/graphiccollector.cxx8
-rw-r--r--sdext/source/minimizer/graphiccollector.hxx5
-rw-r--r--sdext/source/minimizer/impoptimizer.cxx116
-rw-r--r--swext/mediawiki/build.xml4
-rw-r--r--swext/mediawiki/makefile.mk8
-rw-r--r--swext/mediawiki/src/com/sun/star/wiki/EditPageParser.java5
-rw-r--r--swext/mediawiki/src/com/sun/star/wiki/Helper.java34
-rw-r--r--swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java2
10 files changed, 122 insertions, 206 deletions
diff --git a/reportbuilder/util/hidother.src b/reportbuilder/util/hidother.src
deleted file mode 100644
index a06b9d89a4ec..000000000000
--- a/reportbuilder/util/hidother.src
+++ /dev/null
@@ -1,146 +0,0 @@
-/*************************************************************************
-*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
-************************************************************************/
-
-#include "../inc/helpids.hrc"
-#include "../inc/rptui_slotid.hrc"
-
-#ifndef _SBASLTID_HRC
-#include <svx/svxids.hrc>
-#endif
-
-hidspecial UID_RPT_RPT_APP_VIEW { HelpId = UID_RPT_RPT_APP_VIEW ; };
-hidspecial UID_RPT_SCROLLWINDOW { HelpId = UID_RPT_SCROLLWINDOW ; };
-hidspecial UID_RPT_REPORTWINDOW { HelpId = UID_RPT_REPORTWINDOW ; };
-hidspecial HID_RPT_HORZ_RULER { HelpId = HID_RPT_HORZ_RULER ; };
-hidspecial UID_RPT_SECTIONSWINDOW { HelpId = UID_RPT_SECTIONSWINDOW ; };
-hidspecial UID_RPT_VIEWSWINDOW { HelpId = UID_RPT_VIEWSWINDOW ; };
-hidspecial HID_RPT_ENDMARKER { HelpId = HID_RPT_ENDMARKER ; };
-hidspecial HID_RPT_SPLITTER { HelpId = HID_RPT_SPLITTER ; };
-hidspecial HID_REPORTSECTION { HelpId = HID_REPORTSECTION ; };
-hidspecial HID_RPT_HORZ_SCROLLBAR { HelpId = HID_RPT_HORZ_SCROLLBAR ; };
-hidspecial HID_RPT_VERT_SCROLLBAR { HelpId = HID_RPT_VERT_SCROLLBAR ; };
-hidspecial HID_RPT_STARTMARKER { HelpId = HID_RPT_STARTMARKER ; };
-
-hidspecial SID_RPT_SHOWREPORTEXPLORER { HelpId = SID_RPT_SHOWREPORTEXPLORER ; };
-hidspecial SID_PAGEHEADERFOOTER { HelpId = SID_PAGEHEADERFOOTER ; };
-hidspecial SID_REPORTHEADERFOOTER { HelpId = SID_REPORTHEADERFOOTER ; };
-hidspecial SID_SORTINGANDGROUPING { HelpId = SID_SORTINGANDGROUPING ; };
-hidspecial SID_INSERT_FLD_PGNUMBER { HelpId = SID_INSERT_FLD_PGNUMBER ; };
-hidspecial SID_CONDITIONALFORMATTING { HelpId = SID_CONDITIONALFORMATTING ; };
-hidspecial SID_PAGEDIALOG { HelpId = SID_PAGEDIALOG ; };
-hidspecial SID_SETCONTROLDEFAULTS { HelpId = SID_SETCONTROLDEFAULTS ; };
-hidspecial SID_INSERTBREAK { HelpId = SID_INSERTBREAK ; };
-hidspecial HID_RPT_FIELDEXPRESSION { HelpId = HID_RPT_FIELDEXPRESSION ; };
-hidspecial HID_RPT_SORTORDER { HelpId = HID_RPT_SORTORDER ; };
-hidspecial HID_RPT_GROUPSBRW { HelpId = HID_RPT_GROUPSBRW ; };
-hidspecial HID_RPT_GROUPSSORTING_DLG { HelpId = HID_RPT_GROUPSSORTING_DLG ; };
-hidspecial HID_RPT_PAGENUMBERS_DLG { HelpId = HID_RPT_PAGENUMBERS_DLG ; };
-hidspecial HID_RPT_DATETIME_DLG { HelpId = HID_RPT_DATETIME_DLG ; };
-hidspecial HID_RPT_CONDFORMAT_DLG { HelpId = HID_RPT_CONDFORMAT_DLG ; };
-hidspecial HID_RPT_CRTL_FORMAT_PREVIEW { HelpId = HID_RPT_CRTL_FORMAT_PREVIEW ; };
-hidspecial HID_RPT_COND_DLG { HelpId = HID_RPT_COND_DLG ; };
-hidspecial HID_RPT_POPUP_COLOR_CTRL { HelpId = HID_RPT_POPUP_COLOR_CTRL ; };
-hidspecial HID_RPT_POPUP_COLOR { HelpId = HID_RPT_POPUP_COLOR ; };
-hidspecial SID_ESCAPE { HelpId = SID_ESCAPE ; };
-hidspecial HID_RPT_PROPDLG_TAB_GENERAL { HelpId = HID_RPT_PROPDLG_TAB_GENERAL ; };
-hidspecial HID_RPT_PROPDLG_TAB_DATA { HelpId = HID_RPT_PROPDLG_TAB_DATA ; };
-
-hidspecial HID_RPT_PROP_FORCENEWPAGE { HelpId = HID_RPT_PROP_FORCENEWPAGE; };
-hidspecial HID_RPT_PROP_NEWROWORCOL { HelpId = HID_RPT_PROP_NEWROWORCOL; };
-hidspecial HID_RPT_PROP_KEEPTOGETHER { HelpId = HID_RPT_PROP_KEEPTOGETHER; };
-hidspecial HID_RPT_PROP_CANGROW { HelpId = HID_RPT_PROP_CANGROW; };
-hidspecial HID_RPT_PROP_CANSHRINK { HelpId = HID_RPT_PROP_CANSHRINK; };
-hidspecial HID_RPT_PROP_REPEATSECTION { HelpId = HID_RPT_PROP_REPEATSECTION; };
-hidspecial HID_RPT_PROP_PRINTREPEATEDVALUES { HelpId = HID_RPT_PROP_PRINTREPEATEDVALUES; };
-hidspecial HID_RPT_PROP_CONDITIONALPRINTEXPRESSION { HelpId = HID_RPT_PROP_CONDITIONALPRINTEXPRESSION; };
-hidspecial HID_RPT_PROP_STARTNEWCOLUMN { HelpId = HID_RPT_PROP_STARTNEWCOLUMN; };
-hidspecial HID_RPT_PROP_STARTNEWPAGE { HelpId = HID_RPT_PROP_STARTNEWPAGE; };
-hidspecial HID_RPT_PROP_RESETPAGENUMBER { HelpId = HID_RPT_PROP_RESETPAGENUMBER; };
-hidspecial HID_RPT_PROP_MINHEIGHTNEWPAGE { HelpId = HID_RPT_PROP_MINHEIGHTNEWPAGE; };
-hidspecial HID_RPT_PROP_PRINTWHENGROUPCHANGE { HelpId = HID_RPT_PROP_PRINTWHENGROUPCHANGE; };
-hidspecial HID_RPT_PROP_VISIBLE { HelpId = HID_RPT_PROP_VISIBLE; };
-hidspecial HID_RPT_PROP_GROUPKEEPTOGETHER { HelpId = HID_RPT_PROP_GROUPKEEPTOGETHER; };
-hidspecial HID_RPT_PROP_PAGEHEADEROPTION { HelpId = HID_RPT_PROP_PAGEHEADEROPTION; };
-hidspecial HID_RPT_PROP_PAGEFOOTEROPTION { HelpId = HID_RPT_PROP_PAGEFOOTEROPTION; };
-hidspecial UID_RPT_PROP_DLG_LINE_STYLE { HelpId = UID_RPT_PROP_DLG_LINE_STYLE; };
-hidspecial HID_RPT_PROP_RPT_POSITIONX { HelpId = HID_RPT_PROP_RPT_POSITIONX; };
-hidspecial HID_RPT_PROP_RPT_POSITIONY { HelpId = HID_RPT_PROP_RPT_POSITIONY; };
-hidspecial HID_RPT_PROP_RPT_WIDTH { HelpId = HID_RPT_PROP_RPT_WIDTH; };
-hidspecial HID_RPT_PROP_RPT_HEIGHT { HelpId = HID_RPT_PROP_RPT_HEIGHT; };
-hidspecial HID_RPT_START_TITLE { HelpId = HID_RPT_START_TITLE; };
-hidspecial HID_RPT_START_IMAGE { HelpId = HID_RPT_START_IMAGE; };
-hidspecial SID_EXECUTE_REPORT { HelpId = SID_EXECUTE_REPORT; };
-
-hidspecial SID_RPT_TEXTDOCUMENT { HelpId = SID_RPT_TEXTDOCUMENT; };
-hidspecial SID_RPT_SPREADSHEET { HelpId = SID_RPT_SPREADSHEET; };
-hidspecial HID_RPT_PROP_DEEPTRAVERSING { HelpId = HID_RPT_PROP_DEEPTRAVERSING; };
-hidspecial HID_RPT_PROP_PREEVALUATED { HelpId = HID_RPT_PROP_PREEVALUATED; };
-hidspecial HID_RPT_NAVIGATOR_DLG { HelpId = HID_RPT_NAVIGATOR_DLG; };
-hidspecial HID_REPORT_NAVIGATOR_TREE { HelpId = HID_REPORT_NAVIGATOR_TREE; };
-hidspecial SID_RPT_NEW_FUNCTION { HelpId = SID_RPT_NEW_FUNCTION; };
-hidspecial HID_RPT_PROP_FORMULA { HelpId = HID_RPT_PROP_FORMULA; };
-hidspecial HID_RPT_PROP_INITIALFORMULA { HelpId = HID_RPT_PROP_INITIALFORMULA; };x
-hidspecial HID_RPT_PROP_DATAFIELD { HelpId = HID_RPT_PROP_DATAFIELD; };
-hidspecial HID_RPT_PROP_RPT_FONT { HelpId = HID_RPT_PROP_RPT_FONT; };
-hidspecial UID_RPT_RPT_PROP_DLG_FONT_TYPE { HelpId = UID_RPT_RPT_PROP_DLG_FONT_TYPE; };
-hidspecial HID_RPT_PROP_BACKCOLOR { HelpId = HID_RPT_PROP_BACKCOLOR; };
-hidspecial HID_RPT_PROP_PRESERVEIRI { HelpId = HID_RPT_PROP_PRESERVEIRI; };
-
-hidspecial SID_OBJECT_SMALLESTWIDTH { HelpId = SID_OBJECT_SMALLESTWIDTH; };
-hidspecial SID_OBJECT_SMALLESTHEIGHT { HelpId = SID_OBJECT_SMALLESTHEIGHT; };
-hidspecial SID_OBJECT_GREATESTWIDTH { HelpId = SID_OBJECT_GREATESTWIDTH; };
-hidspecial SID_OBJECT_GREATESTHEIGHT { HelpId = SID_OBJECT_GREATESTHEIGHT; };
-
-hidspecial HID_RPT_PROP_BACKTRANSPARENT { HelpId = HID_RPT_PROP_BACKTRANSPARENT; };
-hidspecial HID_RPT_PROP_CONTROLBACKGROUNDTRANSPARENT { HelpId = HID_RPT_PROP_CONTROLBACKGROUNDTRANSPARENT; };
-
-hidspecial SID_ARRANGEMENU { HelpId = SID_ARRANGEMENU; };
-hidspecial SID_SELECTALL_IN_SECTION { HelpId = SID_SELECTALL_IN_SECTION; };
-hidspecial SID_SECTION_ALIGN { HelpId = SID_SECTION_ALIGN; };
-hidspecial SID_SECTION_ALIGN_LEFT { HelpId = SID_SECTION_ALIGN_LEFT; };
-hidspecial SID_SECTION_ALIGN_CENTER { HelpId = SID_SECTION_ALIGN_CENTER; };
-hidspecial SID_SECTION_ALIGN_RIGHT { HelpId = SID_SECTION_ALIGN_RIGHT; };
-hidspecial SID_SECTION_ALIGN_UP { HelpId = SID_SECTION_ALIGN_UP; };
-hidspecial SID_SECTION_ALIGN_MIDDLE { HelpId = SID_SECTION_ALIGN_MIDDLE; };
-hidspecial SID_SECTION_ALIGN_DOWN { HelpId = SID_SECTION_ALIGN_DOWN; };
-hidspecial SID_NEXT_MARK { HelpId = SID_NEXT_MARK; };
-hidspecial SID_PREV_MARK { HelpId = SID_PREV_MARK; };
-
-hidspecial UID_RPT_PROP_CHARTTYPE_DLG { HelpId = UID_RPT_PROP_CHARTTYPE_DLG; };
-hidspecial HID_RPT_PROP_CHARTTYPE { HelpId = HID_RPT_PROP_CHARTTYPE; };
-hidspecial HID_RPT_FIELD_SEL_WIN { HelpId = HID_RPT_FIELD_SEL_WIN; };
-hidspecial HID_RPT_FIELD_SEL { HelpId = HID_RPT_FIELD_SEL; };
-hidspecial HID_RPT_PROP_FORMULALIST { HelpId = HID_RPT_PROP_FORMULALIST; };
-hidspecial HID_RPT_PROP_SCOPE { HelpId = HID_RPT_PROP_SCOPE; };
-hidspecial HID_RPT_PROP_TYPE { HelpId = HID_RPT_PROP_TYPE; };
-hidspecial UID_RPT_PROP_DLG_LINKFIELDS { HelpId = UID_RPT_PROP_DLG_LINKFIELDS; };
-hidspecial HID_RPT_PROP_MASTERFIELDS { HelpId = HID_RPT_PROP_MASTERFIELDS; };
-hidspecial HID_RPT_PROP_DETAILFIELDS { HelpId = HID_RPT_PROP_DETAILFIELDS; };
-hidspecial HID_RPT_PROP_PREVIEW_COUNT { HelpId = HID_RPT_PROP_PREVIEW_COUNT; };
-hidspecial HID_RPT_PROP_AREA { HelpId = HID_RPT_PROP_AREA; };
-hidspecial UID_RPT_RPT_PROP_DLG_AREA { HelpId = UID_RPT_RPT_PROP_DLG_AREA; };
-hidspecial HID_RPT_PROP_MIMETYPE { HelpId = HID_RPT_PROP_MIMETYPE; }; \ No newline at end of file
diff --git a/reportbuilder/util/makefile.pmk b/reportbuilder/util/makefile.pmk
index 566132247f9f..566132247f9f 100644..100755
--- a/reportbuilder/util/makefile.pmk
+++ b/reportbuilder/util/makefile.pmk
diff --git a/sdext/source/minimizer/graphiccollector.cxx b/sdext/source/minimizer/graphiccollector.cxx
index 74ed91cbd099..b88f49714396 100644
--- a/sdext/source/minimizer/graphiccollector.cxx
+++ b/sdext/source/minimizer/graphiccollector.cxx
@@ -70,7 +70,7 @@ const DeviceInfo& GraphicCollector::GetDeviceInfo( const Reference< XComponentCo
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 sPackageURL( OUString::createFromAscii( "vnd.sun.star.GraphicObject:" ) );
@@ -93,7 +93,7 @@ void ImpAddEntity( std::vector< GraphicCollector::GraphicEntity >& rGraphicEntit
}
if ( aIter == rGraphicEntities.end() )
{
- GraphicCollector::GraphicEntity aEntity( rxGraphic, rUser );
+ GraphicCollector::GraphicEntity aEntity( rUser );
rGraphicEntities.push_back( aEntity );
}
}
@@ -133,7 +133,7 @@ void ImpAddGraphicEntity( const Reference< XComponentContext >& rxMSF, Reference
}
aUser.maGraphicCropLogic = aGraphicCropLogic;
aUser.maLogicalSize = aLogicalSize;
- ImpAddEntity( rGraphicEntities, xGraphic, rGraphicSettings, aUser );
+ ImpAddEntity( rGraphicEntities, rGraphicSettings, aUser );
}
}
@@ -198,7 +198,7 @@ void ImpAddFillBitmapEntity( const Reference< XComponentContext >& rxMSF, const
aUser.mbFillBitmap = sal_True;
aUser.maLogicalSize = aLogicalSize;
aUser.mxPagePropertySet = rxPagePropertySet;
- ImpAddEntity( rGraphicEntities, xGraphic, rGraphicSettings, aUser );
+ ImpAddEntity( rGraphicEntities, rGraphicSettings, aUser );
}
}
}
diff --git a/sdext/source/minimizer/graphiccollector.hxx b/sdext/source/minimizer/graphiccollector.hxx
index cf2c35e3ae92..f7cd6dd06674 100644
--- a/sdext/source/minimizer/graphiccollector.hxx
+++ b/sdext/source/minimizer/graphiccollector.hxx
@@ -76,14 +76,13 @@ class GraphicCollector
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
sal_Bool mbRemoveCropArea; //
com::sun::star::text::GraphicCrop maGraphicCropLogic;
std::vector< GraphicUser > maUser;
- GraphicEntity( const com::sun::star::uno::Reference< com::sun::star::graphic::XGraphic >& xGraphic, const GraphicUser& rUser )
- : mxGraphic( xGraphic ), maLogicalSize( rUser.maLogicalSize ), mbRemoveCropArea( sal_False ), maGraphicCropLogic( 0, 0, 0, 0 ) { maUser.push_back( rUser ); };
+ GraphicEntity( const GraphicUser& 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 );
diff --git a/sdext/source/minimizer/impoptimizer.cxx b/sdext/source/minimizer/impoptimizer.cxx
index 298c12e6b958..59c5db83711e 100644
--- a/sdext/source/minimizer/impoptimizer.cxx
+++ b/sdext/source/minimizer/impoptimizer.cxx
@@ -409,66 +409,84 @@ void CompressGraphics( ImpOptimizer& rOptimizer, const Reference< XComponentCont
rOptimizer.SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( nProgress ) ) );
rOptimizer.DispatchStatus();
- GraphicSettings aGraphicSettings( rGraphicSettings );
- aGraphicSettings.mbRemoveCropArea = aGraphicIter->mbRemoveCropArea;
-
- Reference< XPropertySet > xNewGraphicPropertySet( aGraphicIter->mxGraphic, UNO_QUERY_THROW );
- awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxMSF, aGraphicIter->mxGraphic ) );
- Reference< XGraphic > xNewGraphic( ImpCompressGraphic( rxMSF, aGraphicIter->mxGraphic, aGraphicIter->maLogicalSize, aGraphicIter->maGraphicCropLogic, aGraphicSettings ) );
- if ( xNewGraphic.is() )
+ if ( aGraphicIter->maUser.size() )
{
- // applying graphic to each user
- std::vector< GraphicCollector::GraphicUser >::iterator aGraphicUserIter( aGraphicIter->maUser.begin() );
- while( aGraphicUserIter != aGraphicIter->maUser.end() )
+ GraphicSettings aGraphicSettings( rGraphicSettings );
+ aGraphicSettings.mbRemoveCropArea = aGraphicIter->mbRemoveCropArea;
+
+ Reference< XGraphic > xGraphic;
+ if ( aGraphicIter->maUser[ 0 ].mbFillBitmap && aGraphicIter->maUser[ 0 ].mxPropertySet.is() )
+ {
+ Reference< XBitmap > xFillBitmap;
+ if ( aGraphicIter->maUser[ 0 ].mxPropertySet->getPropertyValue( TKGet( TK_FillBitmap ) ) >>= xFillBitmap )
+ xGraphic = Reference< XGraphic >( xFillBitmap, UNO_QUERY_THROW );
+ }
+ else if ( aGraphicIter->maUser[ 0 ].mxShape.is() )
+ {
+ Reference< XPropertySet > xShapePropertySet( aGraphicIter->maUser[ 0 ].mxShape, UNO_QUERY_THROW );
+ xShapePropertySet->getPropertyValue( TKGet( TK_Graphic ) ) >>= xGraphic;
+ }
+ if ( xGraphic.is() )
{
- if ( aGraphicUserIter->mxShape.is() )
+ Reference< XPropertySet > xNewGraphicPropertySet( xGraphic, UNO_QUERY_THROW );
+ awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxMSF, xGraphic ) );
+ Reference< XGraphic > xNewGraphic( ImpCompressGraphic( rxMSF, xGraphic, aGraphicIter->maLogicalSize, aGraphicIter->maGraphicCropLogic, aGraphicSettings ) );
+ if ( xNewGraphic.is() )
{
- rtl::OUString sEmptyGraphicURL;
- Reference< XPropertySet > xShapePropertySet( aGraphicUserIter->mxShape, UNO_QUERY_THROW );
- xShapePropertySet->setPropertyValue( TKGet( TK_GraphicURL ), Any( sEmptyGraphicURL ) );
- xShapePropertySet->setPropertyValue( TKGet( TK_Graphic ), Any( xNewGraphic ) );
-
- if ( aGraphicUserIter->maGraphicCropLogic.Left || aGraphicUserIter->maGraphicCropLogic.Top
- || aGraphicUserIter->maGraphicCropLogic.Right || aGraphicUserIter->maGraphicCropLogic.Bottom )
- { // removing crop area was not possible or should't been applied
- text::GraphicCrop aGraphicCropLogic( 0, 0, 0, 0 );
- if ( !aGraphicSettings.mbRemoveCropArea )
+ // applying graphic to each user
+ std::vector< GraphicCollector::GraphicUser >::iterator aGraphicUserIter( aGraphicIter->maUser.begin() );
+ while( aGraphicUserIter != aGraphicIter->maUser.end() )
+ {
+ if ( aGraphicUserIter->mxShape.is() )
{
- awt::Size aNewSize( GraphicCollector::GetOriginalSize( rxMSF, xNewGraphic ) );
- aGraphicCropLogic.Left = (sal_Int32)((double)aGraphicUserIter->maGraphicCropLogic.Left * ((double)aNewSize.Width / (double)aSize100thMM.Width));
- aGraphicCropLogic.Top = (sal_Int32)((double)aGraphicUserIter->maGraphicCropLogic.Top * ((double)aNewSize.Height / (double)aSize100thMM.Height));
- aGraphicCropLogic.Right = (sal_Int32)((double)aGraphicUserIter->maGraphicCropLogic.Right * ((double)aNewSize.Width / (double)aSize100thMM.Width));
- aGraphicCropLogic.Bottom = (sal_Int32)((double)aGraphicUserIter->maGraphicCropLogic.Bottom * ((double)aNewSize.Height / (double)aSize100thMM.Height));
+ rtl::OUString sEmptyGraphicURL;
+ Reference< XPropertySet > xShapePropertySet( aGraphicUserIter->mxShape, UNO_QUERY_THROW );
+ xShapePropertySet->setPropertyValue( TKGet( TK_GraphicURL ), Any( sEmptyGraphicURL ) );
+ xShapePropertySet->setPropertyValue( TKGet( TK_Graphic ), Any( xNewGraphic ) );
+
+ if ( aGraphicUserIter->maGraphicCropLogic.Left || aGraphicUserIter->maGraphicCropLogic.Top
+ || aGraphicUserIter->maGraphicCropLogic.Right || aGraphicUserIter->maGraphicCropLogic.Bottom )
+ { // removing crop area was not possible or should't been applied
+ text::GraphicCrop aGraphicCropLogic( 0, 0, 0, 0 );
+ if ( !aGraphicSettings.mbRemoveCropArea )
+ {
+ awt::Size aNewSize( GraphicCollector::GetOriginalSize( rxMSF, xNewGraphic ) );
+ aGraphicCropLogic.Left = (sal_Int32)((double)aGraphicUserIter->maGraphicCropLogic.Left * ((double)aNewSize.Width / (double)aSize100thMM.Width));
+ aGraphicCropLogic.Top = (sal_Int32)((double)aGraphicUserIter->maGraphicCropLogic.Top * ((double)aNewSize.Height / (double)aSize100thMM.Height));
+ aGraphicCropLogic.Right = (sal_Int32)((double)aGraphicUserIter->maGraphicCropLogic.Right * ((double)aNewSize.Width / (double)aSize100thMM.Width));
+ aGraphicCropLogic.Bottom = (sal_Int32)((double)aGraphicUserIter->maGraphicCropLogic.Bottom * ((double)aNewSize.Height / (double)aSize100thMM.Height));
+ }
+ xShapePropertySet->setPropertyValue( TKGet( TK_GraphicCrop ), Any( aGraphicCropLogic ) );
+ }
}
- xShapePropertySet->setPropertyValue( TKGet( TK_GraphicCrop ), Any( aGraphicCropLogic ) );
- }
- }
- else if ( aGraphicUserIter->mxPropertySet.is() )
- {
- Reference< XBitmap > xFillBitmap( xNewGraphic, UNO_QUERY );
- if ( xFillBitmap.is() )
- {
- awt::Size aSize;
- sal_Bool bLogicalSize;
-
- Reference< XPropertySet >& rxPropertySet( aGraphicUserIter->mxPropertySet );
- rxPropertySet->setPropertyValue( TKGet( TK_FillBitmap ), Any( xFillBitmap ) );
- if ( ( rxPropertySet->getPropertyValue( TKGet( TK_FillBitmapLogicalSize ) ) >>= bLogicalSize )
- && ( rxPropertySet->getPropertyValue( TKGet( TK_FillBitmapSizeX ) ) >>= aSize.Width )
- && ( rxPropertySet->getPropertyValue( TKGet( TK_FillBitmapSizeY ) ) >>= aSize.Height ) )
+ else if ( aGraphicUserIter->mxPropertySet.is() )
{
- if ( !aSize.Width || !aSize.Height )
+ Reference< XBitmap > xFillBitmap( xNewGraphic, UNO_QUERY );
+ if ( xFillBitmap.is() )
{
- rxPropertySet->setPropertyValue( TKGet( TK_FillBitmapLogicalSize ), Any( sal_True ) );
- rxPropertySet->setPropertyValue( TKGet( TK_FillBitmapSizeX ), Any( aGraphicUserIter->maLogicalSize.Width ) );
- rxPropertySet->setPropertyValue( TKGet( TK_FillBitmapSizeY ), Any( aGraphicUserIter->maLogicalSize.Height ) );
+ awt::Size aSize;
+ sal_Bool bLogicalSize;
+
+ Reference< XPropertySet >& rxPropertySet( aGraphicUserIter->mxPropertySet );
+ rxPropertySet->setPropertyValue( TKGet( TK_FillBitmap ), Any( xFillBitmap ) );
+ if ( ( rxPropertySet->getPropertyValue( TKGet( TK_FillBitmapLogicalSize ) ) >>= bLogicalSize )
+ && ( rxPropertySet->getPropertyValue( TKGet( TK_FillBitmapSizeX ) ) >>= aSize.Width )
+ && ( rxPropertySet->getPropertyValue( TKGet( TK_FillBitmapSizeY ) ) >>= aSize.Height ) )
+ {
+ if ( !aSize.Width || !aSize.Height )
+ {
+ rxPropertySet->setPropertyValue( TKGet( TK_FillBitmapLogicalSize ), Any( sal_True ) );
+ rxPropertySet->setPropertyValue( TKGet( TK_FillBitmapSizeX ), Any( aGraphicUserIter->maLogicalSize.Width ) );
+ rxPropertySet->setPropertyValue( TKGet( TK_FillBitmapSizeY ), Any( aGraphicUserIter->maLogicalSize.Height ) );
+ }
+ }
+ if ( aGraphicUserIter->mxPagePropertySet.is() )
+ aGraphicUserIter->mxPagePropertySet->setPropertyValue( TKGet( TK_Background ), Any( rxPropertySet ) );
}
}
- if ( aGraphicUserIter->mxPagePropertySet.is() )
- aGraphicUserIter->mxPagePropertySet->setPropertyValue( TKGet( TK_Background ), Any( rxPropertySet ) );
+ aGraphicUserIter++;
}
}
- aGraphicUserIter++;
}
}
aGraphicIter++;
diff --git a/swext/mediawiki/build.xml b/swext/mediawiki/build.xml
index 8dea0dce0bd2..79cd9cb9eb1c 100644
--- a/swext/mediawiki/build.xml
+++ b/swext/mediawiki/build.xml
@@ -53,7 +53,7 @@
<!-- build options -->
<property name="sourcelevel" value="1.4"/>
<property name="verbose" value="false"/>
- <property name="debug" value="true"/>
+ <property name="debug" value="${antdebug}"/>
<!-- build classpath -->
<path id="classpath">
@@ -75,7 +75,7 @@
</target>
<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}">
<src path="src"/>
</javac>
diff --git a/swext/mediawiki/makefile.mk b/swext/mediawiki/makefile.mk
index 9d051397a319..52d9900ab1e6 100644
--- a/swext/mediawiki/makefile.mk
+++ b/swext/mediawiki/makefile.mk
@@ -41,7 +41,13 @@ COMMONS_LOGGING_JAR=$(SOLARVER)$/$(INPATH)$/bin$(UPDMINOREXT)$/commons-logging-1
COMP=fix_system_commons
.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
ALLTAR: $(COMP) ANTBUILD
diff --git a/swext/mediawiki/src/com/sun/star/wiki/EditPageParser.java b/swext/mediawiki/src/com/sun/star/wiki/EditPageParser.java
index a0ed06ab4399..f91819c6bc2a 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/EditPageParser.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/EditPageParser.java
@@ -35,6 +35,7 @@ public class EditPageParser extends HTMLEditorKit.ParserCallback
protected String m_sEditTime = "";
protected String m_sEditToken = "";
+ protected String m_sLoginToken = "";
protected String m_sMainURL = "";
private int m_nWikiArticleHash = 0;
@@ -100,6 +101,10 @@ public class EditPageParser extends HTMLEditorKit.ParserCallback
{
this.m_sEditToken = ( String ) a.getAttribute( HTML.Attribute.VALUE );
}
+ else if ( sName.equalsIgnoreCase( "wpLoginToken" ) )
+ {
+ this.m_sLoginToken = ( String ) a.getAttribute( HTML.Attribute.VALUE );
+ }
}
}
diff --git a/swext/mediawiki/src/com/sun/star/wiki/Helper.java b/swext/mediawiki/src/com/sun/star/wiki/Helper.java
index 7862cdd42912..7ecd9ecb0e7c 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/Helper.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/Helper.java
@@ -784,6 +784,29 @@ public class Helper
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 )
throws com.sun.star.uno.Exception, java.io.IOException, WikiCancelException
{
@@ -799,10 +822,16 @@ public class Helper
ExecuteMethod( aGetCookie, aNewHostConfig, aURI, xContext, true );
int nResultCode = aGetCookie.getStatusCode();
+ String sLoginPage = null;
+ if ( nResultCode == 200 )
+ sLoginPage = aGetCookie.getResponseBodyAsString();
+
aGetCookie.releaseConnection();
- if ( nResultCode == 200 )
+ if ( sLoginPage != null )
{
+ String sLoginToken = GetLoginToken( sLoginPage );
+
PostMethod aPost = new PostMethod();
URI aPostURI = new URI( aMainURL.getPath() + "index.php?title=Special:Userlogin&action=submitlogin" );
aPost.setPath( aPostURI.getEscapedPathQuery() );
@@ -810,6 +839,9 @@ public class Helper
aPost.addParameter( "wpName", sWikiUser );
aPost.addParameter( "wpRemember", "1" );
aPost.addParameter( "wpPassword", sWikiPass );
+ if ( sLoginToken.length() > 0 )
+ aPost.addParameter( "wpLoginToken", sLoginToken );
+
String[][] pArgs = GetSpecialArgs( xContext, aMainURL.getHost() );
if ( pArgs != null )
for ( int nArgInd = 0; nArgInd < pArgs.length; nArgInd++ )
diff --git a/swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java b/swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java
index 13bb55abcedf..89025ed84513 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/WikiArticle.java
@@ -145,6 +145,8 @@ public class WikiArticle
if ( nResultCode == 200 )
sWebPage = aRequest.getResponseBodyAsString();
+ aRequest.releaseConnection();
+
if ( sWebPage != null )
{
StringReader r = new StringReader(sWebPage);