[Libreoffice-commits] core.git: Branch 'private/kohei/new-chart-type-skeleton' - 52 commits - accessibility/inc accessibility/source animations/source avmedia/source basctl/source basebmp/source basebmp/test basegfx/test basic/inc basic/source binaryurp/source bridges/source canvas/source chart2/qa chart2/source chart2/uiconfig codemaker/source comphelper/qa comphelper/source configmgr/source connectivity/qa connectivity/source cppcanvas/source cppuhelper/qa cppuhelper/source cppu/qa cppu/source cpputools/source cui/source dbaccess/source desktop/source drawinglayer/source dtrans/source editeng/qa editeng/source embeddedobj/source eventattacher/source extensions/qa extensions/source external/mysqlcppconn filter/qa filter/source fpicker/source framework/inc framework/source hwpfilter/qa hwpfilter/source i18npool/inc i18npool/qa i18npool/source idlc/inc idl/inc include/avmedia include/basegfx include/basic include/canvas include/comphelper include/connectivity include/cppuhelper include/drawinglaye r include/editeng include/formula include/framework include/i18nutil include/linguistic include/salhelper include/sax include/sfx2 include/sot include/svl include/svtools include/svx include/test include/toolkit include/tools include/ucbhelper include/unotest include/unotools include/vcl include/xmloff include/xmlscript io/source javaunohelper/source jvmfwk/plugins l10ntools/inc lingucomponent/source linguistic/inc linguistic/source lotuswordpro/qa mysqlc/source oox/source package/inc package/qa package/source pyuno/source registry/tools remotebridges/source reportdesign/inc reportdesign/source rsc/inc sal/cppunittester salhelper/qa salhelper/source sal/qa sax/qa sax/source scaddins/source sccomp/source sc/inc scripting/source sc/source sdext/source sd/inc sd/source sfx2/inc sfx2/source shell/source slideshow/source smoketest/smoketest.cxx sot/qa sot/source starmath/inc stoc/source store/source svgio/inc svgio/source svl/qa svl/source svtools/source svx/inc svx/source sw/inc sw/qa s w/source test/source testtools/source toolkit/source tools/qa tools/source ucbhelper/source ucb/Library_ucpdav1.mk ucb/source udkapi/com UnoControls/inc UnoControls/source unoidl/source unotest/source unotools/source unoxml/source uui/source vcl/generic vcl/headless vcl/inc vcl/qa vcl/quartz vcl/source vcl/unx vcl/win writerfilter/source writerperfect/qa writerperfect/source xmlhelp/source xmloff/inc xmloff/qa xmloff/source xmlscript/source xmlsecurity/source
Kohei Yoshida
kohei.yoshida at collabora.com
Thu Mar 27 06:17:19 PDT 2014
Rebased ref, commits from common ancestor:
commit 2375828132107e7129e5811388bafa03305653d6
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Wed Mar 26 11:11:49 2014 -0400
Re-enable the new chart type.
Change-Id: If060d101c4a8f2486d3532f4048f9042df0cd204
diff --git a/chart2/source/inc/macros.hxx b/chart2/source/inc/macros.hxx
index 21e5911..2319afe 100644
--- a/chart2/source/inc/macros.hxx
+++ b/chart2/source/inc/macros.hxx
@@ -30,7 +30,7 @@
typeid( ex ).name() << ", Message: " << \
ex.Message )
-#define ENABLE_GL3D_BARCHART 0
+#define ENABLE_GL3D_BARCHART 1
#endif
commit d87240c0b2fba39b437f87be2b3c9cf54ad0ee5f
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Wed Mar 26 23:07:14 2014 -0400
Make sure to set the RoundedEdge check box on load.
Change-Id: Ic62e3f26b2cda28e823c465efb78a397fe781d51
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index 37e63f8..ab7f525 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -37,27 +37,6 @@ namespace chart
using namespace ::com::sun::star;
using namespace ::com::sun::star::chart2;
-namespace
-{
- sal_Bool lcl_getSortByXValues( const uno::Reference< chart2::XChartDocument >& xChartDoc )
- {
- sal_Bool bRet = sal_False;
- if( xChartDoc.is() )
- {
- try
- {
- uno::Reference< beans::XPropertySet > xDiaProp( xChartDoc->getFirstDiagram(), uno::UNO_QUERY_THROW );
- xDiaProp->getPropertyValue( "SortByXValues" ) >>= bRet;
- }
- catch( const uno::Exception & ex )
- {
- ASSERT_EXCEPTION( ex );
- }
- }
- return bRet;
- }
-}
-
#define POS_3DSCHEME_SIMPLE 0
#define POS_3DSCHEME_REALISTIC 1
@@ -848,8 +827,18 @@ void ChartTypeTabPage::stateChanged( ChangingResource* /*pResource*/ )
commitToModel( aParameter );
//detect the new ThreeDLookScheme
- aParameter.eThreeDLookScheme = ThreeDHelper::detectScheme( ChartModelHelper::findDiagram( m_xChartModel ) );
- aParameter.bSortByXValues = lcl_getSortByXValues( m_xChartModel );
+ uno::Reference<XDiagram> xDiagram = ChartModelHelper::findDiagram(m_xChartModel);
+ aParameter.eThreeDLookScheme = ThreeDHelper::detectScheme(xDiagram);
+ try
+ {
+ uno::Reference<beans::XPropertySet> xPropSet(xDiagram, uno::UNO_QUERY_THROW);
+ xPropSet->getPropertyValue("SortByXValues") >>= aParameter.bSortByXValues;
+ xPropSet->getPropertyValue("RoundedEdge") >>= aParameter.mbRoundedEdge;
+ }
+ catch ( const uno::Exception& ex )
+ {
+ ASSERT_EXCEPTION(ex);
+ }
//the controls have to be enabled/disabled accordingly
this->fillAllControls( aParameter );
@@ -906,7 +895,18 @@ void ChartTypeTabPage::selectMainType()
if(!aParameter.b3DLook && aParameter.eThreeDLookScheme!=ThreeDLookScheme_Realistic )
aParameter.eThreeDLookScheme=ThreeDLookScheme_Realistic;
- aParameter.bSortByXValues = lcl_getSortByXValues( m_xChartModel );
+ uno::Reference<XDiagram> xDiagram = ChartModelHelper::findDiagram(m_xChartModel);
+ try
+ {
+ uno::Reference<beans::XPropertySet> xPropSet(xDiagram, uno::UNO_QUERY_THROW);
+ xPropSet->getPropertyValue("SortByXValues") >>= aParameter.bSortByXValues;
+ xPropSet->getPropertyValue("RoundedEdge") >>= aParameter.mbRoundedEdge;
+ }
+ catch ( const uno::Exception& ex )
+ {
+ ASSERT_EXCEPTION(ex);
+ }
+
this->fillAllControls( aParameter );
uno::Reference< beans::XPropertySet > xTemplateProps( this->getCurrentTemplate(), uno::UNO_QUERY );
m_pCurrentMainType->fillExtraControls(aParameter,m_xChartModel,xTemplateProps);
@@ -981,7 +981,16 @@ void ChartTypeTabPage::initializePage()
if(!aParameter.b3DLook && aParameter.eThreeDLookScheme!=ThreeDLookScheme_Realistic )
aParameter.eThreeDLookScheme=ThreeDLookScheme_Realistic;
- aParameter.bSortByXValues = lcl_getSortByXValues( m_xChartModel );
+ try
+ {
+ uno::Reference<beans::XPropertySet> xPropSet(xDiagram, uno::UNO_QUERY_THROW);
+ xPropSet->getPropertyValue("SortByXValues") >>= aParameter.bSortByXValues;
+ xPropSet->getPropertyValue("RoundedEdge") >>= aParameter.mbRoundedEdge;
+ }
+ catch (const uno::Exception& ex)
+ {
+ ASSERT_EXCEPTION(ex);
+ }
this->fillAllControls( aParameter );
if( m_pCurrentMainType )
commit defa767632511fd1c0ebcb9388b2a1ddc1ffb2db
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Wed Mar 26 22:46:43 2014 -0400
Export RoundedEdge property to ODF.
Change-Id: I3b20ef70dac4dc9905a169245e0b48b98a20c697
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 3a5996a..6f6ad44 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -1533,6 +1533,7 @@ namespace xmloff { namespace token {
XML_ROTATION_ALIGN,
XML_ROTATION_ANGLE,
XML_ROUND,
+ XML_ROUNDED_EDGE,
XML_ROW,
XML_ROW_HEIGHT,
XML_ROW_NUMBER,
diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx
index 81a18dd..4f307b0 100644
--- a/xmloff/source/chart/PropertyMap.hxx
+++ b/xmloff/source/chart/PropertyMap.hxx
@@ -143,6 +143,9 @@ const XMLPropertyMapEntry aXMLChartPropMap[] =
MAP_ENTRY_ODF_EXT( "BuiltInUnit", LO_EXT, XML_CHART_DUNITS_BUILTINUNIT, XML_TYPE_STRING ),
MAP_ENTRY_ODF_EXT( "ExternalData", LO_EXT, XML_EXTERNALDATA, XML_TYPE_STRING),
+ // OpenGL 3D chart flags
+ MAP_ENTRY_ODF_EXT( "RoundedEdge", LO_EXT, XML_ROUNDED_EDGE, XML_TYPE_BOOL),
+
MAP_ENTRY( "ScaleText", CHART, XML_SCALE_TEXT, XML_TYPE_BOOL ),
// spline settings
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index e013431..4002ae0 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -1538,6 +1538,7 @@ namespace xmloff { namespace token {
TOKEN( "rotation-align", XML_ROTATION_ALIGN ),
TOKEN( "rotation-angle", XML_ROTATION_ANGLE ),
TOKEN( "round", XML_ROUND ),
+ TOKEN( "rounded-edge", XML_ROUNDED_EDGE ),
TOKEN( "row", XML_ROW ),
TOKEN( "row-height", XML_ROW_HEIGHT ),
TOKEN( "row-number", XML_ROW_NUMBER ),
commit f6f179c502506ecc6bdbd689e1cd0c1972a628c2
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Wed Mar 26 20:52:16 2014 -0400
Pass the rounded edge property to the diagram object.
Change-Id: I71fa1bf82b879a1da69ca78d53bcf8072bdfa9ae
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index 04670ad..a10ee39 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -137,7 +137,9 @@ enum
PROP_DIAGRAM_DATATABLEHBORDER,
PROP_DIAGRAM_DATATABLEVBORDER,
PROP_DIAGRAM_DATATABLEOUTLINE,
- PROP_DIAGRAM_EXTERNALDATA
+ PROP_DIAGRAM_EXTERNALDATA,
+
+ PROP_DIAGRAM_ROUNDED_EDGE
};
void lcl_AddPropertiesToVector(
@@ -444,6 +446,12 @@ void lcl_AddPropertiesToVector(
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID ));
+ rOutProperties.push_back(
+ Property( "RoundedEdge",
+ PROP_DIAGRAM_ROUNDED_EDGE,
+ ::getCppuBooleanType(),
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEVOID));
}
struct StaticDiagramWrapperPropertyArray_Initializer
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
index 835de9e6..4ade1fd 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
@@ -60,7 +60,7 @@ ChartTypeParameter::ChartTypeParameter()
, nGeometry3D(DataPointGeometry3D::CUBOID)
, eThreeDLookScheme(ThreeDLookScheme_Realistic)
, bSortByXValues(false)
- , mbGLRoundedEdge(false)
+ , mbRoundedEdge(false)
{
}
@@ -80,7 +80,7 @@ ChartTypeParameter::ChartTypeParameter( sal_Int32 SubTypeIndex, bool HasXAxisWit
, nGeometry3D(DataPointGeometry3D::CUBOID)
, eThreeDLookScheme(ThreeDLookScheme_Realistic)
, bSortByXValues(false)
- , mbGLRoundedEdge(false)
+ , mbRoundedEdge(false)
{
}
ChartTypeParameter::~ChartTypeParameter()
@@ -214,7 +214,7 @@ void ChartTypeDialogController::adjustParameterToMainType( ChartTypeParameter& r
CurveStyle eCurveStyle = rParameter.eCurveStyle;
sal_Int32 nGeometry3D = rParameter.nGeometry3D;
bool bSortByXValues = rParameter.bSortByXValues;
- bool bGLRoundedEdge = rParameter.mbGLRoundedEdge;
+ bool bRoundedEdge = rParameter.mbRoundedEdge;
rParameter = (*aIter).second;
@@ -225,7 +225,7 @@ void ChartTypeDialogController::adjustParameterToMainType( ChartTypeParameter& r
rParameter.eCurveStyle = eCurveStyle;
rParameter.nGeometry3D = nGeometry3D;
rParameter.bSortByXValues = bSortByXValues;
- rParameter.mbGLRoundedEdge = bGLRoundedEdge;
+ rParameter.mbRoundedEdge = bRoundedEdge;
bFoundSomeMatch = true;
break;
@@ -338,11 +338,11 @@ bool ChartTypeDialogController::commitToModel( const ChartTypeParameter& rParame
if( rParameter.b3DLook )
ThreeDHelper::setScheme( xDiagram, rParameter.eThreeDLookScheme );
- //SortByXValues
+ uno::Reference<beans::XPropertySet> xDiaProp(xDiagram, uno::UNO_QUERY);
+ if (xDiaProp.is())
{
- uno::Reference< beans::XPropertySet > xDiaProp( xDiagram, uno::UNO_QUERY );
- if( xDiaProp.is() )
- xDiaProp->setPropertyValue( "SortByXValues" , uno::makeAny( rParameter.bSortByXValues ) );
+ xDiaProp->setPropertyValue("SortByXValues" , uno::makeAny(rParameter.bSortByXValues));
+ xDiaProp->setPropertyValue("RoundedEdge", uno::makeAny(rParameter.mbRoundedEdge));
}
}
return false;
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
index 991c806..c4aee62 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
@@ -80,7 +80,7 @@ public:
ThreeDLookScheme eThreeDLookScheme;
bool bSortByXValues;
- bool mbGLRoundedEdge;
+ bool mbRoundedEdge;
};
typedef ::comphelper::MakeMap< OUString, ChartTypeParameter > tTemplateServiceChartTypeParameterMap;
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index b0c5c1f..37e63f8 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -296,12 +296,15 @@ public:
void fillParameter( ChartTypeParameter& rParam );
private:
+ DECL_LINK( SettingChangedHdl, void* );
+private:
CheckBox* m_pCB_RoundedEdge;
};
GL3DResourceGroup::GL3DResourceGroup( VclBuilderContainer* pWindow )
{
pWindow->get(m_pCB_RoundedEdge, "rounded-edge");
+ m_pCB_RoundedEdge->SetToggleHdl( LINK(this, GL3DResourceGroup, SettingChangedHdl) );
}
void GL3DResourceGroup::showControls( bool bShow )
@@ -311,12 +314,19 @@ void GL3DResourceGroup::showControls( bool bShow )
void GL3DResourceGroup::fillControls( const ChartTypeParameter& rParam )
{
- m_pCB_RoundedEdge->Check(rParam.mbGLRoundedEdge);
+ m_pCB_RoundedEdge->Check(rParam.mbRoundedEdge);
}
void GL3DResourceGroup::fillParameter( ChartTypeParameter& rParam )
{
- rParam.mbGLRoundedEdge = m_pCB_RoundedEdge->IsChecked();
+ rParam.mbRoundedEdge = m_pCB_RoundedEdge->IsChecked();
+}
+
+IMPL_LINK_NOARG( GL3DResourceGroup, SettingChangedHdl )
+{
+ if (m_pChangeListener)
+ m_pChangeListener->stateChanged(this);
+ return 0;
}
class SplinePropertiesDialog : public ModalDialog
diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx
index 6b80d36..157df26 100644
--- a/chart2/source/model/main/Diagram.cxx
+++ b/chart2/source/model/main/Diagram.cxx
@@ -75,7 +75,8 @@ enum
PROP_DIAGRAM_DATATABLEHBORDER,
PROP_DIAGRAM_DATATABLEVBORDER,
PROP_DIAGRAM_DATATABLEOUTLINE,
- PROP_DIAGRAM_EXTERNALDATA
+ PROP_DIAGRAM_EXTERNALDATA,
+ PROP_DIAGRAM_ROUNDED_EDGE
};
void lcl_AddPropertiesToVector(
@@ -197,6 +198,11 @@ void lcl_AddPropertiesToVector(
::getCppuType( reinterpret_cast< const OUString * >(0)),
beans::PropertyAttribute::MAYBEVOID ));
+ rOutProperties.push_back(
+ Property( "RoundedEdge",
+ PROP_DIAGRAM_ROUNDED_EDGE,
+ ::getCppuBooleanType(),
+ beans::PropertyAttribute::MAYBEVOID));
}
struct StaticDiagramDefaults_Initializer
@@ -219,6 +225,7 @@ private:
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_DATATABLEHBORDER, false );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_DATATABLEVBORDER, false );
::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_DATATABLEOUTLINE, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_ROUNDED_EDGE, false );
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DIAGRAM_STARTING_ANGLE, 90 );
::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DIAGRAM_3DRELATIVEHEIGHT, 100 );
::chart::SceneProperties::AddDefaultsToMap( rOutMap );
diff --git a/chart2/source/model/template/GL3DBarChartType.cxx b/chart2/source/model/template/GL3DBarChartType.cxx
index b2a13cb..4dc4e46 100644
--- a/chart2/source/model/template/GL3DBarChartType.cxx
+++ b/chart2/source/model/template/GL3DBarChartType.cxx
@@ -22,7 +22,7 @@ namespace {
enum
{
- PROP_GL3DCHARTTYPE_ROUNDED_RECTANGLE
+ PROP_GL3DCHARTTYPE_ROUNDED_EDGE
};
struct DefaultsInitializer
@@ -40,7 +40,7 @@ private:
void addDefaults( tPropertyValueMap & rOutMap )
{
- PropertyHelper::setPropertyValueDefault(rOutMap, PROP_GL3DCHARTTYPE_ROUNDED_RECTANGLE, false);
+ PropertyHelper::setPropertyValueDefault(rOutMap, PROP_GL3DCHARTTYPE_ROUNDED_EDGE, false);
}
};
@@ -59,8 +59,8 @@ struct InfoHelperInitializer
uno::Sequence<beans::Property> aRet(1);
aRet[0] = beans::Property(
- "RoundedRectangle",
- PROP_GL3DCHARTTYPE_ROUNDED_RECTANGLE,
+ "RoundedEdge",
+ PROP_GL3DCHARTTYPE_ROUNDED_EDGE,
::getCppuBooleanType(),
beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT);
commit cea725111c239216324604c430e6084a828cf5f7
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Wed Mar 26 15:38:25 2014 -0400
Add the UI bits for showing "rounded edge" property for GL3D chart.
Change-Id: Ia6083c423bf8286a0b562d490283f8e1328a0124
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
index c3faa74..835de9e6 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
@@ -60,6 +60,7 @@ ChartTypeParameter::ChartTypeParameter()
, nGeometry3D(DataPointGeometry3D::CUBOID)
, eThreeDLookScheme(ThreeDLookScheme_Realistic)
, bSortByXValues(false)
+ , mbGLRoundedEdge(false)
{
}
@@ -79,6 +80,7 @@ ChartTypeParameter::ChartTypeParameter( sal_Int32 SubTypeIndex, bool HasXAxisWit
, nGeometry3D(DataPointGeometry3D::CUBOID)
, eThreeDLookScheme(ThreeDLookScheme_Realistic)
, bSortByXValues(false)
+ , mbGLRoundedEdge(false)
{
}
ChartTypeParameter::~ChartTypeParameter()
@@ -212,6 +214,7 @@ void ChartTypeDialogController::adjustParameterToMainType( ChartTypeParameter& r
CurveStyle eCurveStyle = rParameter.eCurveStyle;
sal_Int32 nGeometry3D = rParameter.nGeometry3D;
bool bSortByXValues = rParameter.bSortByXValues;
+ bool bGLRoundedEdge = rParameter.mbGLRoundedEdge;
rParameter = (*aIter).second;
@@ -222,6 +225,7 @@ void ChartTypeDialogController::adjustParameterToMainType( ChartTypeParameter& r
rParameter.eCurveStyle = eCurveStyle;
rParameter.nGeometry3D = nGeometry3D;
rParameter.bSortByXValues = bSortByXValues;
+ rParameter.mbGLRoundedEdge = bGLRoundedEdge;
bFoundSomeMatch = true;
break;
@@ -372,6 +376,11 @@ bool ChartTypeDialogController::shouldShow_SortByXValuesResourceGroup() const
return false;
}
+bool ChartTypeDialogController::shouldShow_GL3DResourceGroup() const
+{
+ return false;
+}
+
void ChartTypeDialogController::showExtraControls( VclBuilderContainer* /*pParent*/ )
{
}
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
index 4d450b0..991c806 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
@@ -79,6 +79,8 @@ public:
ThreeDLookScheme eThreeDLookScheme;
bool bSortByXValues;
+
+ bool mbGLRoundedEdge;
};
typedef ::comphelper::MakeMap< OUString, ChartTypeParameter > tTemplateServiceChartTypeParameterMap;
@@ -100,6 +102,7 @@ public:
virtual bool shouldShow_SplineControl() const;
virtual bool shouldShow_GeometryControl() const;
virtual bool shouldShow_SortByXValuesResourceGroup() const;
+ virtual bool shouldShow_GL3DResourceGroup() const;
virtual void showExtraControls(VclBuilderContainer* pParent);
virtual void hideExtraControls() const;
diff --git a/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx b/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx
index 1b3bfdc..08cb2ec 100644
--- a/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx
+++ b/chart2/source/controller/dialogs/GL3DBarChartDialogController.cxx
@@ -20,6 +20,11 @@ GL3DBarChartDialogController::GL3DBarChartDialogController() {}
GL3DBarChartDialogController::~GL3DBarChartDialogController() {}
+bool GL3DBarChartDialogController::shouldShow_GL3DResourceGroup() const
+{
+ return true;
+}
+
OUString GL3DBarChartDialogController::getName()
{
return SchResId(STR_TYPE_GL3D_BAR).toString();
diff --git a/chart2/source/controller/dialogs/GL3DBarChartDialogController.hxx b/chart2/source/controller/dialogs/GL3DBarChartDialogController.hxx
index e2f31e2..0adba32 100644
--- a/chart2/source/controller/dialogs/GL3DBarChartDialogController.hxx
+++ b/chart2/source/controller/dialogs/GL3DBarChartDialogController.hxx
@@ -20,6 +20,8 @@ public:
GL3DBarChartDialogController();
virtual ~GL3DBarChartDialogController();
+ virtual bool shouldShow_GL3DResourceGroup() const;
+
virtual OUString getName();
virtual Image getImage();
virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const;
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index 3a880ec..b0c5c1f 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -285,6 +285,40 @@ IMPL_LINK_NOARG(StackingResourceGroup, StackingEnableHdl)
m_pChangeListener->stateChanged(this);
return 0;
}
+
+class GL3DResourceGroup : public ChangingResource
+{
+public:
+ GL3DResourceGroup( VclBuilderContainer* pWindow );
+
+ void showControls( bool bShow );
+ void fillControls( const ChartTypeParameter& rParam );
+ void fillParameter( ChartTypeParameter& rParam );
+
+private:
+ CheckBox* m_pCB_RoundedEdge;
+};
+
+GL3DResourceGroup::GL3DResourceGroup( VclBuilderContainer* pWindow )
+{
+ pWindow->get(m_pCB_RoundedEdge, "rounded-edge");
+}
+
+void GL3DResourceGroup::showControls( bool bShow )
+{
+ m_pCB_RoundedEdge->Show(bShow);
+}
+
+void GL3DResourceGroup::fillControls( const ChartTypeParameter& rParam )
+{
+ m_pCB_RoundedEdge->Check(rParam.mbGLRoundedEdge);
+}
+
+void GL3DResourceGroup::fillParameter( ChartTypeParameter& rParam )
+{
+ rParam.mbGLRoundedEdge = m_pCB_RoundedEdge->IsChecked();
+}
+
class SplinePropertiesDialog : public ModalDialog
{
public:
@@ -662,6 +696,7 @@ ChartTypeTabPage::ChartTypeTabPage(Window* pParent
, m_pSplineResourceGroup( new SplineResourceGroup(this) )
, m_pGeometryResourceGroup( new GeometryResourceGroup( this ) )
, m_pSortByXValuesResourceGroup( new SortByXValuesResourceGroup( this ) )
+ , m_pGL3DResourceGroup(new GL3DResourceGroup(this))
, m_xChartModel( xChartModel )
, m_xCC( xContext )
, m_aChartTypeDialogControllerList(0)
@@ -744,6 +779,7 @@ ChartTypeTabPage::ChartTypeTabPage(Window* pParent
m_pSplineResourceGroup->setChangeListener( this );
m_pGeometryResourceGroup->setChangeListener( this );
m_pSortByXValuesResourceGroup->setChangeListener( this );
+ m_pGL3DResourceGroup->setChangeListener(this);
}
ChartTypeTabPage::~ChartTypeTabPage()
@@ -763,6 +799,7 @@ ChartTypeTabPage::~ChartTypeTabPage()
delete m_pSplineResourceGroup;
delete m_pGeometryResourceGroup;
delete m_pSortByXValuesResourceGroup;
+ delete m_pGL3DResourceGroup;
}
ChartTypeParameter ChartTypeTabPage::getCurrentParamter() const
{
@@ -773,6 +810,7 @@ ChartTypeParameter ChartTypeTabPage::getCurrentParamter() const
m_pSplineResourceGroup->fillParameter( aParameter );
m_pGeometryResourceGroup->fillParameter( aParameter );
m_pSortByXValuesResourceGroup->fillParameter( aParameter );
+ m_pGL3DResourceGroup->fillParameter(aParameter);
return aParameter;
}
void ChartTypeTabPage::commitToModel( const ChartTypeParameter& rParameter )
@@ -879,6 +917,8 @@ void ChartTypeTabPage::showAllControls( ChartTypeDialogController& rTypeControll
m_pGeometryResourceGroup->showControls( bShow );
bShow = rTypeController.shouldShow_SortByXValuesResourceGroup();
m_pSortByXValuesResourceGroup->showControls( bShow );
+ bShow = rTypeController.shouldShow_GL3DResourceGroup();
+ m_pGL3DResourceGroup->showControls(bShow);
rTypeController.showExtraControls(this);
}
@@ -895,6 +935,7 @@ void ChartTypeTabPage::fillAllControls( const ChartTypeParameter& rParameter, bo
m_pSplineResourceGroup->fillControls( rParameter );
m_pGeometryResourceGroup->fillControls( rParameter );
m_pSortByXValuesResourceGroup->fillControls( rParameter );
+ m_pGL3DResourceGroup->fillControls(rParameter);
m_nChangingCalls--;
}
@@ -947,6 +988,7 @@ void ChartTypeTabPage::initializePage()
m_pSplineResourceGroup->showControls( false );
m_pGeometryResourceGroup->showControls( false );
m_pSortByXValuesResourceGroup->showControls( false );
+ m_pGL3DResourceGroup->showControls(false);
}
}
diff --git a/chart2/source/controller/dialogs/tp_ChartType.hxx b/chart2/source/controller/dialogs/tp_ChartType.hxx
index ea46e2bb..87c59c2 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.hxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.hxx
@@ -45,6 +45,7 @@ class SplineResourceGroup;
class GeometryResourceGroup;
class ChartTypeParameter;
class SortByXValuesResourceGroup;
+class GL3DResourceGroup;
class ChartTypeTabPage : public ResourceChangeListener, public svt::OWizardPage, public ChartTypeTemplateProvider
{
@@ -87,6 +88,7 @@ protected:
SplineResourceGroup* m_pSplineResourceGroup;
GeometryResourceGroup* m_pGeometryResourceGroup;
SortByXValuesResourceGroup* m_pSortByXValuesResourceGroup;
+ GL3DResourceGroup* m_pGL3DResourceGroup;
::com::sun::star::uno::Reference<
::com::sun::star::chart2::XChartDocument > m_xChartModel;
diff --git a/chart2/source/model/template/GL3DBarChartType.cxx b/chart2/source/model/template/GL3DBarChartType.cxx
index 7b94095..b2a13cb 100644
--- a/chart2/source/model/template/GL3DBarChartType.cxx
+++ b/chart2/source/model/template/GL3DBarChartType.cxx
@@ -104,9 +104,10 @@ APPHELPER_XSERVICEINFO_IMPL(
uno::Sequence<OUString> GL3DBarChartType::getSupportedServiceNames_Static()
{
- uno::Sequence<OUString> aServices(2);
+ uno::Sequence<OUString> aServices(3);
aServices[0] = CHART2_SERVICE_NAME_CHARTTYPE_GL3DBAR;
aServices[1] = "com.sun.star.chart2.ChartType";
+ aServices[2] = "com.sun.star.beans.PropertySet";
return aServices;
}
diff --git a/chart2/uiconfig/ui/tp_ChartType.ui b/chart2/uiconfig/ui/tp_ChartType.ui
index 27067d0..cc4452b 100644
--- a/chart2/uiconfig/ui/tp_ChartType.ui
+++ b/chart2/uiconfig/ui/tp_ChartType.ui
@@ -412,6 +412,31 @@
<property name="height">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkGrid" id="gl3dblock">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkCheckButton" id="rounded-edge">
+ <property name="label" translatable="yes">Rounded edge</property>
+ <property name="can_focus">True</property>
+ <property name="no_show_all">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="left_attach">1</property>
commit e1823a9f8abc8907f155215bc5f5280d06c41d82
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Wed Mar 26 14:28:19 2014 -0400
Add a boolean "RoundedRectangle" property to the GL 3D chart.
Change-Id: I3cb23461718c5713c1e76d0b37d92b3e7849d13b
diff --git a/chart2/source/model/template/GL3DBarChartType.cxx b/chart2/source/model/template/GL3DBarChartType.cxx
index 033c38c..7b94095 100644
--- a/chart2/source/model/template/GL3DBarChartType.cxx
+++ b/chart2/source/model/template/GL3DBarChartType.cxx
@@ -9,11 +9,84 @@
#include "GL3DBarChartType.hxx"
#include <servicenames_charttypes.hxx>
+#include <PropertyHelper.hxx>
+
+#include <com/sun/star/beans/Property.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
using namespace com::sun::star;
namespace chart {
+namespace {
+
+enum
+{
+ PROP_GL3DCHARTTYPE_ROUNDED_RECTANGLE
+};
+
+struct DefaultsInitializer
+{
+ tPropertyValueMap* operator()()
+ {
+ static tPropertyValueMap aStaticDefaults;
+
+ if (aStaticDefaults.empty())
+ addDefaults(aStaticDefaults);
+
+ return &aStaticDefaults;
+ }
+private:
+
+ void addDefaults( tPropertyValueMap & rOutMap )
+ {
+ PropertyHelper::setPropertyValueDefault(rOutMap, PROP_GL3DCHARTTYPE_ROUNDED_RECTANGLE, false);
+ }
+};
+
+struct Defaults : public rtl::StaticAggregate<tPropertyValueMap, DefaultsInitializer> {};
+
+struct InfoHelperInitializer
+{
+ cppu::OPropertyArrayHelper* operator()()
+ {
+ static cppu::OPropertyArrayHelper aHelper(getProperties());
+ return &aHelper;
+ }
+
+ uno::Sequence<beans::Property> getProperties()
+ {
+ uno::Sequence<beans::Property> aRet(1);
+
+ aRet[0] = beans::Property(
+ "RoundedRectangle",
+ PROP_GL3DCHARTTYPE_ROUNDED_RECTANGLE,
+ ::getCppuBooleanType(),
+ beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT);
+
+ return aRet;
+ }
+};
+
+struct InfoHelper : public rtl::StaticAggregate<cppu::OPropertyArrayHelper, InfoHelperInitializer> {};
+
+struct ChartTypeInfoInitializer
+{
+ uno::Reference<beans::XPropertySetInfo>* operator()()
+ {
+ static uno::Reference<beans::XPropertySetInfo> xPropertySetInfo;
+
+ if (!xPropertySetInfo.is())
+ xPropertySetInfo = cppu::OPropertySetHelper::createPropertySetInfo(*InfoHelper::get());
+
+ return &xPropertySetInfo;
+ }
+};
+
+struct ChartTypeInfo : public rtl::StaticAggregate<uno::Reference<beans::XPropertySetInfo>, ChartTypeInfoInitializer> {};
+
+}
+
GL3DBarChartType::GL3DBarChartType( const uno::Reference<uno::XComponentContext>& xContext ) :
ChartType(xContext)
{
@@ -50,6 +123,25 @@ GL3DBarChartType::createClone()
return uno::Reference<util::XCloneable>(new GL3DBarChartType(*this));
}
+css::uno::Any GL3DBarChartType::GetDefaultValue( sal_Int32 nHandle ) const
+ throw (css::beans::UnknownPropertyException)
+{
+ const tPropertyValueMap& rDefaults = *Defaults::get();
+ tPropertyValueMap::const_iterator it = rDefaults.find(nHandle);
+ return it == rDefaults.end() ? uno::Any() : it->second;
+}
+
+cppu::IPropertyArrayHelper& GL3DBarChartType::getInfoHelper()
+{
+ return *InfoHelper::get();
+}
+
+css::uno::Reference<css::beans::XPropertySetInfo> GL3DBarChartType::getPropertySetInfo()
+ throw (css::uno::RuntimeException, std::exception)
+{
+ return *ChartTypeInfo::get();
+}
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/model/template/GL3DBarChartType.hxx b/chart2/source/model/template/GL3DBarChartType.hxx
index ee9d0ab..c5da45c 100644
--- a/chart2/source/model/template/GL3DBarChartType.hxx
+++ b/chart2/source/model/template/GL3DBarChartType.hxx
@@ -33,11 +33,22 @@ protected:
GL3DBarChartType( const GL3DBarChartType& rOther );
virtual OUString SAL_CALL getChartType()
- throw (com::sun::star::uno::RuntimeException, std::exception);
+ throw (css::uno::RuntimeException, std::exception);
- virtual com::sun::star::uno::Reference<com::sun::star::util::XCloneable>
- SAL_CALL createClone()
- throw (com::sun::star::uno::RuntimeException, std::exception);
+ virtual css::uno::Reference<css::util::XCloneable> SAL_CALL
+ createClone()
+ throw (css::uno::RuntimeException, std::exception);
+
+ // OPropertySet
+ virtual css::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
+ throw (css::beans::UnknownPropertyException);
+
+ virtual cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+ // XPropertySet
+ virtual css::uno::Reference<css::beans::XPropertySetInfo> SAL_CALL
+ getPropertySetInfo()
+ throw (css::uno::RuntimeException, std::exception);
};
}
commit 1f5659fcd1928cd82c6f57331f1147049b40bce8
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Wed Mar 26 13:15:08 2014 -0400
Close those <p> tags.
Change-Id: I72ba74164e660bfbe496cc63b98e397ee1e2425c
diff --git a/udkapi/com/sun/star/beans/PropertyAttribute.idl b/udkapi/com/sun/star/beans/PropertyAttribute.idl
index 5ab1de9..a75f4af 100644
--- a/udkapi/com/sun/star/beans/PropertyAttribute.idl
+++ b/udkapi/com/sun/star/beans/PropertyAttribute.idl
@@ -30,7 +30,7 @@ published constants PropertyAttribute
/** indicates that a property value can be void.
- <p>It does not mean that the type of the property is void!
+ <p>It does not mean that the type of the property is void!</p>
*/
const short MAYBEVOID = 1;
@@ -85,7 +85,7 @@ published constants PropertyAttribute
<p>This attribute is not of interest for concrete property
implementations. It's needed for property specifications inside
- service specifications in UNOIDL.
+ service specifications in UNOIDL.</p>
@see com::sun::star::reflection::XPropertyTypeDescription
@see com::sun::star::reflection::XServiceTypeDescription
commit da46a0cbcc656dea15a42d4cfc10e2058258b8cc
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Thu Mar 27 00:21:43 2014 +0100
show negative values correctly in pie charts, fdo#69143
Change-Id: I2a33095f7dceb564911478a30aed1137ddacd531
diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx
index 81d3539..d4636ee 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -488,13 +488,14 @@ void PieChart::createShapes()
aScreenPosition2D.Y += aDirection.getY();
}
+ double nVal = pSeries->getYValue( nPointIndex );
aPieLabelInfo.xTextShape = this->createDataLabel( xTextTarget, *pSeries, nPointIndex
- , fLogicYValue, fLogicYSum, aScreenPosition2D, eAlignment );
+ , nVal, fLogicYSum, aScreenPosition2D, eAlignment );
uno::Reference< container::XChild > xChild( aPieLabelInfo.xTextShape, uno::UNO_QUERY );
if( xChild.is() )
aPieLabelInfo.xLabelGroupShape = uno::Reference<drawing::XShape>( xChild->getParent(), uno::UNO_QUERY );
- aPieLabelInfo.fValue = fLogicYValue;
+ aPieLabelInfo.fValue = nVal;
aPieLabelInfo.bMovementAllowed = bMovementAllowed;
aPieLabelInfo.bMoved= false;
aPieLabelInfo.xTextTarget = xTextTarget;
commit 0b4712812fa78b5bbfb9313c36a14f46e1bc662d
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed Mar 26 23:55:56 2014 +0100
enable the export validation for chart ODS tests
Don't even think about using the new skip flag for your shiny new test.
If you itnroduce tests that show validation errors fix them!!
Change-Id: I21bf61a113a35ca204a54d18246848a5788ae559
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index a817c59f..7697bab 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -421,6 +421,7 @@ void Chart2ExportTest::testErrorBarXLSX()
// in an export -> import cycle using different file formats - ODS, XLS and XLSX.
void Chart2ExportTest::testTrendline()
{
+ mbSkipValidation = true;
load("/chart2/qa/extras/data/ods/", "trendline.ods");
checkTrendlinesInChart(getChartDocFromSheet( 0, mxComponent));
reload("calc8");
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index e9f0047..7a2b22c 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -52,6 +52,7 @@ using namespace com::sun::star::uno;
class ChartTest : public test::BootstrapFixture, public unotest::MacrosTest
{
public:
+ ChartTest():mbSkipValidation(false) {}
void load( const OUString& rDir, const OUString& rFileName );
boost::shared_ptr<utl::TempFile> reload( const OUString& rFileName );
uno::Sequence < OUString > getImpressChartColumnDescriptions( const char* pDir, const char* pName );
@@ -65,6 +66,7 @@ public:
protected:
Reference< lang::XComponent > mxComponent;
OUString maServiceName;
+ bool mbSkipValidation; // if you set this flag for a new test I'm going to haunt you!
};
OUString ChartTest::getFileExtension( const OUString& aFileName )
@@ -112,7 +114,8 @@ boost::shared_ptr<utl::TempFile> ChartTest::reload(const OUString& rFilterName)
}
else if(rFilterName == "calc8")
{
- validate(pTempFile->GetFileName(), test::ODF);
+ if(!mbSkipValidation)
+ validate(pTempFile->GetFileName(), test::ODF);
}
CPPUNIT_ASSERT(mxComponent.is());
commit 712daf33c826101a43e918d0a6285e21ac6e339a
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed Mar 26 23:46:04 2014 +0100
remove unimplemented method
Change-Id: I28c735478142bcb438ac24482612d5fb52a65f6e
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index 05ffda9..e9f0047 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -59,7 +59,6 @@ public:
uno::Reference< chart::XChartDocument > getChartDocFromImpress( const char* pDir, const char* pName );
- void loadDocx(const char* pDir, const char* pName);
virtual void setUp();
virtual void tearDown();
commit e8ed900016f0c51bc0374bae2a2963510e1ddbdc
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed Mar 26 23:45:42 2014 +0100
improve formatting
Change-Id: Ic174dee2b0c3005b15b30348bf6aebf20ce50fb8
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index e1ce5a5..05ffda9 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -49,7 +49,6 @@
using namespace com::sun::star;
using namespace com::sun::star::uno;
-
class ChartTest : public test::BootstrapFixture, public unotest::MacrosTest
{
public:
@@ -114,7 +113,7 @@ boost::shared_ptr<utl::TempFile> ChartTest::reload(const OUString& rFilterName)
}
else if(rFilterName == "calc8")
{
- // validate(pTempFile->GetFileName(), test::ODF);
+ validate(pTempFile->GetFileName(), test::ODF);
}
CPPUNIT_ASSERT(mxComponent.is());
@@ -136,6 +135,7 @@ void ChartTest::tearDown()
test::BootstrapFixture::tearDown();
}
+
Reference< lang::XComponent > getChartCompFromSheet( sal_Int32 nSheet, uno::Reference< lang::XComponent > xComponent )
{
// let us assume that we only have one chart per sheet
@@ -165,6 +165,7 @@ Reference< lang::XComponent > getChartCompFromSheet( sal_Int32 nSheet, uno::Refe
return xChartComp;
}
+
Reference< chart2::XChartDocument > getChartDocFromSheet( sal_Int32 nSheet, uno::Reference< lang::XComponent > xComponent )
{
uno::Reference< chart2::XChartDocument > xChartDoc ( getChartCompFromSheet(nSheet, xComponent), UNO_QUERY_THROW );
@@ -210,7 +211,6 @@ Reference< chart2::XDataSeries > getDataSeriesFromDoc( uno::Reference< chart2::X
return xSeries;
}
-
uno::Sequence < OUString > getWriterChartColumnDescriptions( Reference< lang::XComponent > mxComponent )
{
uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
commit eaeaf871f1d77bf15e262451bc103b4eb976ca72
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed Mar 26 23:43:41 2014 +0100
improve validation failure message
Change-Id: I1a613899d18a004149d3e637d796bc2f6687e6c4
diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx
index a980731..c7f8da1 100644
--- a/test/source/bootstrapfixture.cxx
+++ b/test/source/bootstrapfixture.cxx
@@ -191,7 +191,7 @@ void test::BootstrapFixture::validate(const OUString& rPath, test::ValidationFor
if( aContentOUString.indexOf("Error") != -1 )
{
SAL_WARN("test", aContentOUString);
- CPPUNIT_FAIL("validation errors during export");
+ CPPUNIT_FAIL(aContentString.getStr());
}
}
#endif
commit e940e177af57de12211d00049f773bcbf9bffe7d
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed Mar 26 23:34:04 2014 +0100
handle xlsx files correctly as well
Change-Id: I24d63386d158e130aeb340235d71eb05cbd679f4
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index a659945..e1ce5a5 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -79,7 +79,7 @@ OUString ChartTest::getFileExtension( const OUString& aFileName )
void ChartTest::load( const OUString& aDir, const OUString& aName )
{
OUString extension = getFileExtension(aName);
- if(extension == "ods")
+ if(extension == "ods" || extension == "xlsx")
{
maServiceName = "com.sun.star.sheet.SpreadsheetDocument";
}
commit 70c96dc14784aab5a209f7f5b0021540ab74c502
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed Mar 26 23:33:03 2014 +0100
unimplemented method
Change-Id: I5820bde974a42f32c404aa2b14b410534f10db29
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index d4edddd..a659945 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -61,7 +61,6 @@ public:
uno::Reference< chart::XChartDocument > getChartDocFromImpress( const char* pDir, const char* pName );
void loadDocx(const char* pDir, const char* pName);
- utl::TempFile reloadDocx();
virtual void setUp();
virtual void tearDown();
commit b0d99224c777fa8f532fa8014207240c60220008
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed Mar 26 23:29:21 2014 +0100
add test for improved overlap chart export
Change-Id: Id1466f7a95470a7c90a7752971e126d3f4b45766
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index c0d20f1..a817c59f 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -53,6 +53,7 @@ public:
void testChartCrash();
void testPieChartRotation();
void testEmbeddingsOleObjectGrabBag();
+ void testGapWidthXLSX();
CPPUNIT_TEST_SUITE(Chart2ExportTest);
CPPUNIT_TEST(test);
@@ -78,6 +79,7 @@ public:
CPPUNIT_TEST(testChartCrash);
CPPUNIT_TEST(testPieChartRotation);
CPPUNIT_TEST(testEmbeddingsOleObjectGrabBag);
+ CPPUNIT_TEST(testGapWidthXLSX);
CPPUNIT_TEST_SUITE_END();
protected:
@@ -712,6 +714,63 @@ void Chart2ExportTest::testEmbeddingsOleObjectGrabBag()
CPPUNIT_ASSERT(bEmbeddings); // Grab Bag has all the expected elements
}
+namespace {
+
+void checkGapWidth(Reference<beans::XPropertySet> xPropSet, sal_Int32 nValue)
+{
+ uno::Any aAny = xPropSet->getPropertyValue("GapwidthSequence");
+ CPPUNIT_ASSERT(aAny.hasValue());
+ uno::Sequence< sal_Int32 > aSequence;
+ aAny >>= aSequence;
+ CPPUNIT_ASSERT(aSequence.getLength());
+ CPPUNIT_ASSERT_EQUAL(nValue, aSequence[0]);
+}
+
+void checkOverlap(Reference<beans::XPropertySet> xPropSet, sal_Int32 nValue)
+{
+ uno::Any aAny = xPropSet->getPropertyValue("OverlapSequence");
+ CPPUNIT_ASSERT(aAny.hasValue());
+ uno::Sequence< sal_Int32 > aSequence;
+ aAny >>= aSequence;
+ CPPUNIT_ASSERT(aSequence.getLength());
+ CPPUNIT_ASSERT_EQUAL(nValue, aSequence[0]);
+}
+
+void checkSheetForGapWidthAndOverlap(uno::Reference< chart2::XChartDocument > xChartDoc,
+ sal_Int32 nExpectedGapWidth, sal_Int32 nExpectedOverlap)
+{
+ CPPUNIT_ASSERT(xChartDoc.is());
+
+ Reference< chart2::XChartType > xChartType = getChartTypeFromDoc( xChartDoc, 0, 0 );
+ CPPUNIT_ASSERT(xChartType.is());
+
+ Reference< beans::XPropertySet > xPropSet( xChartType, uno::UNO_QUERY_THROW );
+ checkGapWidth(xPropSet, nExpectedGapWidth);
+ checkOverlap(xPropSet, nExpectedOverlap);
+
+}
+
+}
+
+void Chart2ExportTest::testGapWidthXLSX()
+{
+ load("/chart2/qa/extras/data/xlsx/", "gapWidth.xlsx");
+
+ uno::Reference< chart2::XChartDocument > xChartDoc = getChartDocFromSheet( 0, mxComponent );
+ checkSheetForGapWidthAndOverlap(xChartDoc, 120, -60);
+
+ xChartDoc = getChartDocFromSheet( 1, mxComponent );
+ checkSheetForGapWidthAndOverlap(xChartDoc, 50, 30);
+
+ reload("Calc Office Open XML");
+
+ xChartDoc = getChartDocFromSheet( 0, mxComponent );
+ checkSheetForGapWidthAndOverlap(xChartDoc, 120, -60);
+
+ xChartDoc = getChartDocFromSheet( 1, mxComponent );
+ checkSheetForGapWidthAndOverlap(xChartDoc, 50, 30);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/xlsx/gapWidth.xlsx b/chart2/qa/extras/data/xlsx/gapWidth.xlsx
new file mode 100644
index 0000000..0e9c0ee
Binary files /dev/null and b/chart2/qa/extras/data/xlsx/gapWidth.xlsx differ
commit a1f85043237b6b02549b69aad90d687c0d4e08fc
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed Mar 26 22:50:57 2014 +0100
support negative overlap
Change-Id: I1ec67a8697148d650f56650c6320964ac39dfedf
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 0d30e29..b38f308 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1364,8 +1364,7 @@ void ChartExport::exportBarChart( Reference< chart2::XChartType > xChartType )
if( aBarPositionSequence.getLength() )
{
sal_Int32 nOverlap = aBarPositionSequence[0];
- if( nOverlap > 0 )
- pFS->singleElement( FSNS( XML_c, XML_overlap ),
+ pFS->singleElement( FSNS( XML_c, XML_overlap ),
XML_val, I32S( nOverlap ),
FSEND );
}
commit ec2b4ea9b4525b4470f2eace64e43cf30195ad92
Author: LuboÅ¡ LuÅák <l.lunak at collabora.com>
Date: Wed Mar 26 21:05:17 2014 +0100
fix test doc again
Change-Id: Icd728e03ac605a05fc9a1f001e2becaf1536ce7d
diff --git a/sw/qa/extras/ooxmlimport/data/negative-table-cell-twips.docx b/sw/qa/extras/ooxmlimport/data/negative-cell-margin-twips.docx
similarity index 100%
rename from sw/qa/extras/ooxmlimport/data/negative-table-cell-twips.docx
rename to sw/qa/extras/ooxmlimport/data/negative-cell-margin-twips.docx
commit ea4ce88bf60e46c3caa2e57b6550b52bb58ad861
Author: LuboÅ¡ LuÅák <l.lunak at collabora.com>
Date: Wed Mar 26 20:30:12 2014 +0100
fix test document name
Change-Id: I029c77aac896cefacd685705881a3259affee921
diff --git a/sw/qa/extras/ooxmlimport/data/negative_table_cell_twips.docx b/sw/qa/extras/ooxmlimport/data/negative-table-cell-twips.docx
similarity index 100%
rename from sw/qa/extras/ooxmlimport/data/negative_table_cell_twips.docx
rename to sw/qa/extras/ooxmlimport/data/negative-table-cell-twips.docx
commit b26f2645d30de5ef86eaeb91ef5346135cfe256d
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Wed Mar 26 18:59:33 2014 +0100
Resolves: fdo#76638 Patch retrieve_grants.patch.1 fails
Let's remove this since the future is MariaDB
Change-Id: I39641f81c59e7d024aaf48e8e3cc9fc9a7c3127c
diff --git a/external/mysqlcppconn/UnpackedTarball_mysqlcppconn.mk b/external/mysqlcppconn/UnpackedTarball_mysqlcppconn.mk
index ddcb522..9c2282e 100644
--- a/external/mysqlcppconn/UnpackedTarball_mysqlcppconn.mk
+++ b/external/mysqlcppconn/UnpackedTarball_mysqlcppconn.mk
@@ -18,7 +18,6 @@ $(eval $(call gb_UnpackedTarball_add_file,mysqlcppconn,driver/nativeapi/binding_
$(eval $(call gb_UnpackedTarball_add_patches,mysqlcppconn,\
external/mysqlcppconn/patches/mysql-connector-c++-1.1.0.patch \
external/mysqlcppconn/patches/default_to_protocol_tcp.patch \
- external/mysqlcppconn/patches/retrieve_grants.patch.1 \
external/mysqlcppconn/patches/warnings.patch.0 \
))
diff --git a/external/mysqlcppconn/patches/retrieve_grants.patch.1 b/external/mysqlcppconn/patches/retrieve_grants.patch.1
deleted file mode 100644
index eb63cff..0000000
--- a/external/mysqlcppconn/patches/retrieve_grants.patch.1
+++ /dev/null
@@ -1,31 +0,0 @@
-diff -ur mysqlcppconn.org/driver/mysql_metadata.cpp mysqlcppconn/driver/mysql_metadata.cpp
---- mysqlcppconn.org/driver/mysql_metadata.cpp 2013-12-20 22:12:07.044698692 +0100
-+++ mysqlcppconn/driver/mysql_metadata.cpp 2013-12-20 22:14:56.320394472 +0100
-@@ -3633,12 +3633,14 @@
-- sql::SQLString strAllPrivs("ALTER, DELETE, DROP, INDEX, INSERT, LOCK TABLES, SELECT, UPDATE");
-+ sql::SQLString strAllPrivs("SELECT, INSERT, UPDATE, DELETE, CREATE, DROPT, GRANT, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW, TRIGGER");
-
- sql::SQLString cQuote(getIdentifierQuoteString());
-+ size_t posIsGrantable = sql::SQLString::npos;
-
- while (rs->next() ) {
- sql::SQLString aGrant = rs->getString(1);
- aGrant = aGrant.replace(0, 6, "");
-
- size_t pos = aGrant.find("ALL PRIVILEGES");
-+ posIsGrantable = aGrant.find("WITH GRANT OPTION");
-
- if (pos != sql::SQLString::npos) {
- aGrant = aGrant.replace(pos, sizeof("ALL PRIVILEGES") - 1, strAllPrivs);
-@@ -3737,7 +3739,10 @@
- rs_data_row.push_back(""); // GRANTOR
- rs_data_row.push_back(getUserName()); // GRANTEE
- rs_data_row.push_back(privToken); // PRIVILEGE
-- rs_data_row.push_back(""); // IS_GRANTABLE - ToDo maybe here WITH GRANT OPTION??
-+ if (posIsGrantable != sql::SQLString::npos)
-+ rs_data_row.push_back("YES");
-+ else
-+ rs_data_row.push_back(""); // IS_GRANTABLE
-
- rs_data->push_back(rs_data_row);
- }
commit 190085dd4d1bc8cdfa5573158c8986b757ac1faf
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Mar 26 17:45:14 2014 +0100
Work around MSC "'override' cannot be used with 'inline'" bug
Change-Id: I35170712b8f0c83ab35cb5ef7115a6dc434a7a4f
diff --git a/framework/inc/threadhelp/gate.hxx b/framework/inc/threadhelp/gate.hxx
index a8b87a8..b4e9ab0 100644
--- a/framework/inc/threadhelp/gate.hxx
+++ b/framework/inc/threadhelp/gate.hxx
@@ -98,7 +98,7 @@ class Gate : public IGate
@onerror -
*//*-*****************************************************************************************************/
- inline virtual void open() SAL_OVERRIDE
+ virtual void open() SAL_OVERRIDE
{
// We must safe access to our internal member!
::osl::MutexGuard aLock( m_aAccessLock );
@@ -121,7 +121,7 @@ class Gate : public IGate
@onerror -
*//*-*****************************************************************************************************/
- inline virtual void close() SAL_OVERRIDE
+ virtual void close() SAL_OVERRIDE
{
// We must safe access to our internal member!
::osl::MutexGuard aLock( m_aAccessLock );
@@ -147,7 +147,7 @@ class Gate : public IGate
@onerror -
*//*-*****************************************************************************************************/
- inline virtual void openGap() SAL_OVERRIDE
+ virtual void openGap() SAL_OVERRIDE
{
// We must safe access to our internal member!
::osl::MutexGuard aLock( m_aAccessLock );
@@ -174,7 +174,7 @@ class Gate : public IGate
@onerror We return false.
*//*-*****************************************************************************************************/
- inline virtual sal_Bool wait( const TimeValue* pTimeOut = NULL ) SAL_OVERRIDE
+ virtual sal_Bool wait( const TimeValue* pTimeOut = NULL ) SAL_OVERRIDE
{
// We must safe access to our internal member!
::osl::ClearableMutexGuard aLock( m_aAccessLock );
commit 0d1abac3a3131a9419cedb4385edf6ab8ccb58de
Author: LuboÅ¡ LuÅák <l.lunak at collabora.com>
Date: Wed Mar 26 17:31:03 2014 +0100
test for ignoring negative cell margin values
Change-Id: I7e56762a7097dd7369f9d8d71b499888ee5c081d
diff --git a/sw/qa/extras/ooxmlimport/data/negative_table_cell_twips.docx b/sw/qa/extras/ooxmlimport/data/negative_table_cell_twips.docx
new file mode 100644
index 0000000..3ae73db
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/negative_table_cell_twips.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index b86d26d..da5472d 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1981,6 +1981,14 @@ DECLARE_OOXMLIMPORT_TEST(testLargeTwips, "large-twips.docx" )
CPPUNIT_ASSERT( width.toInt32() > 0 );
}
+DECLARE_OOXMLIMPORT_TEST(testNegativeCellMarginTwips, "negative-cell-margin-twips.docx" )
+{
+ // Sligtly related to cp#1000043, the twips value was negative, which wrapped around somewhere,
+ // while MSO seems to ignore that as well.
+ OUString width = parseDump( "/root/page/body/tab/row[1]/cell[1]/txt/infos/bounds", "width" );
+ CPPUNIT_ASSERT( width.toInt32() > 0 );
+}
+
DECLARE_OOXMLIMPORT_TEST(testFdo38414, "fdo38414.docx" )
{
// The cells in the last (4th) column were merged properly and so the result didn't have the same height.
commit 1e47614cdb84b018a22a334dad0cdd9f0f53892c
Author: LuboÅ¡ LuÅák <l.lunak at collabora.com>
Date: Wed Mar 26 17:28:51 2014 +0100
apparently some table .docx properties shouldn't be < 0
Somewhat related to 10b4da63e3143108ba75891e9e98fdaa2f7953ab , a similar
doc has negative value inside w:tblCellMar, which MSO seems to ignore
(altering the value has no visible effect), so ignore it as well.
Change-Id: I846e9b55fea0d4e66f03ce615584516360b8b7dd
diff --git a/writerfilter/source/dmapper/CellMarginHandler.cxx b/writerfilter/source/dmapper/CellMarginHandler.cxx
index 380a8d9..6bbb525 100644
--- a/writerfilter/source/dmapper/CellMarginHandler.cxx
+++ b/writerfilter/source/dmapper/CellMarginHandler.cxx
@@ -57,7 +57,7 @@ void CellMarginHandler::lcl_attribute(Id rName, Value & rVal)
{
case NS_ooxml::LN_CT_TblWidth_w:
m_nWidth = nIntValue;
- m_nValue = ConversionHelper::convertTwipToMM100( nIntValue );
+ m_nValue = ConversionHelper::convertTwipToMM100Unsigned( nIntValue );
break;
case NS_ooxml::LN_CT_TblWidth_type:
OSL_ENSURE( NS_ooxml::LN_Value_ST_TblWidth_dxa == sal::static_int_cast<Id>(nIntValue), "cell margins work for absolute values, only");
diff --git a/writerfilter/source/dmapper/ConversionHelper.cxx b/writerfilter/source/dmapper/ConversionHelper.cxx
index cba58b7..9de86ee 100644
--- a/writerfilter/source/dmapper/ConversionHelper.cxx
+++ b/writerfilter/source/dmapper/ConversionHelper.cxx
@@ -226,18 +226,24 @@ OUString ConvertMSFormatStringToSO(
}
+#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
sal_Int32 convertTwipToMM100(sal_Int32 _t)
{
+ return TWIP_TO_MM100( _t );
+}
+
+sal_uInt32 convertTwipToMM100Unsigned(sal_Int32 _t)
+{
+ if( _t < 0 )
+ return 0;
// It appears that MSO handles large twip values specially, probably legacy 16bit handling,
// anything that's bigger than 32767 appears to be simply ignored.
if( _t >= 0x8000 )
return 0;
-#define TWIP_TO_MM100(TWIP) ((TWIP) >= 0 ? (((TWIP)*127L+36L)/72L) : (((TWIP)*127L-36L)/72L))
return TWIP_TO_MM100( _t );
}
-
sal_Int32 convertEMUToMM100(sal_Int32 _t)
{
return _t / 360;
diff --git a/writerfilter/source/dmapper/ConversionHelper.hxx b/writerfilter/source/dmapper/ConversionHelper.hxx
index 5b3b4fd..247da5c 100644
--- a/writerfilter/source/dmapper/ConversionHelper.hxx
+++ b/writerfilter/source/dmapper/ConversionHelper.hxx
@@ -44,6 +44,7 @@ namespace ConversionHelper{
OUString ConvertMSFormatStringToSO(
const OUString& rFormat, ::com::sun::star::lang::Locale& rLocale, bool bHijri);
sal_Int32 convertTwipToMM100(sal_Int32 _t);
+ sal_uInt32 convertTwipToMM100Unsigned(sal_Int32 _t);
// probably the most useless unit in the world - English Metric Units (EMU) 360 000 EMU == 1cm
sal_Int32 convertEMUToMM100(sal_Int32 _t);
sal_Int16 convertTableJustification( sal_Int32 nIntValue );
commit 77f4c4b8db2671921dd378ac4e255b700c7cf332
Author: LuboÅ¡ LuÅák <l.lunak at collabora.com>
Date: Wed Mar 26 17:01:27 2014 +0100
Revert "rhbz#1075124: writerfilter: fix tables with negative left margin"
It appears that this was just a workaround that incidentally worked.
Making the negative value even larger (in abs value) doesn't seem to make
a difference for MSO, but LO fails again. A proper fix (better workaround?)
will follow.
This reverts commit 76aa23c59b4c81ea7b9d974a1a0a9e39c6bf8741.
diff --git a/sw/qa/extras/ooxmlimport/data/rhbz1075124.docx b/sw/qa/extras/ooxmlimport/data/rhbz1075124.docx
deleted file mode 100644
index 3b31701..0000000
Binary files a/sw/qa/extras/ooxmlimport/data/rhbz1075124.docx and /dev/null differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 6943c4b..b86d26d 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -47,7 +47,6 @@
#include <com/sun/star/view/XFormLayerAccess.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/table/TableBorder2.hpp>
-#include <com/sun/star/table/TableBorderDistances.hpp>
#include <com/sun/star/text/SizeType.hpp>
#include <com/sun/star/xml/dom/XDocument.hpp>
#include <com/sun/star/text/XDocumentIndex.hpp>
@@ -211,21 +210,6 @@ DECLARE_OOXMLIMPORT_TEST(testRhbz988516, "rhbz988516.docx")
getProperty<OUString>(getParagraph(3), "NumberingStyleName"));
}
-DECLARE_OOXMLIMPORT_TEST(testRhbz1075124, "rhbz1075124.docx")
-{
- // negative left margin on table wrapped around to 64k unsigned
- uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent,
- uno::UNO_QUERY);
- uno::Reference<container::XIndexAccess> xTables(
- xTablesSupplier->getTextTables(), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(-243),
- getProperty<sal_Int32>(xTables->getByIndex(0), "LeftMargin"));
- table::TableBorderDistances dists(
- getProperty<table::TableBorderDistances>(xTables->getByIndex(0),
- "TableBorderDistances"));
- CPPUNIT_ASSERT_EQUAL(sal_Int16(26), dists.LeftDistance);
-}
-
DECLARE_OOXMLIMPORT_TEST(testFdo49940, "fdo49940.docx")
{
uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
index a6ade15..a9a4221 100644
--- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx
@@ -406,6 +406,18 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
m_aTableProperties->getValue( TablePropertyMap::CELL_MAR_BOTTOM,
rInfo.nBottomBorderDistance );
+ table::TableBorderDistances aDistances;
+ aDistances.IsTopDistanceValid =
+ aDistances.IsBottomDistanceValid =
+ aDistances.IsLeftDistanceValid =
+ aDistances.IsRightDistanceValid = sal_True;
+ aDistances.TopDistance = static_cast<sal_Int16>( rInfo.nTopBorderDistance );
+ aDistances.BottomDistance = static_cast<sal_Int16>( rInfo.nBottomBorderDistance );
+ aDistances.LeftDistance = static_cast<sal_Int16>( rInfo.nLeftBorderDistance );
+ aDistances.RightDistance = static_cast<sal_Int16>( rInfo.nRightBorderDistance );
+
+ m_aTableProperties->Insert( PROP_TABLE_BORDER_DISTANCES, uno::makeAny( aDistances ) );
+
if (rFrameProperties.hasElements())
lcl_DecrementHoriOrientPosition(rFrameProperties, rInfo.nLeftBorderDistance);
@@ -465,18 +477,6 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo
lcl_debug_TableBorder(aTableBorder);
#endif
- table::TableBorderDistances aDistances;
- aDistances.IsTopDistanceValid =
- aDistances.IsBottomDistanceValid =
- aDistances.IsLeftDistanceValid =
- aDistances.IsRightDistanceValid = sal_True;
- aDistances.TopDistance = static_cast<sal_Int16>( rInfo.nTopBorderDistance );
- aDistances.BottomDistance = static_cast<sal_Int16>( rInfo.nBottomBorderDistance );
- aDistances.LeftDistance = static_cast<sal_Int16>( rInfo.nLeftBorderDistance );
- aDistances.RightDistance = static_cast<sal_Int16>( rInfo.nRightBorderDistance );
-
- m_aTableProperties->Insert( PROP_TABLE_BORDER_DISTANCES, uno::makeAny( aDistances ) );
-
// Table position in Office is computed in 2 different ways :
// - top level tables: the goal is to have in-cell text starting at table indent pos (tblInd),
// so table's position depends on table's cells margin
diff --git a/writerfilter/source/dmapper/TablePropertiesHandler.cxx b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
index d71e9ae..7777ed9 100644
--- a/writerfilter/source/dmapper/TablePropertiesHandler.cxx
+++ b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
@@ -370,8 +370,8 @@ namespace dmapper {
if (m_pCurrentInteropGrabBag)
m_pCurrentInteropGrabBag->push_back(pHandler->getInteropGrabBag());
TablePropertyMapPtr pTblIndMap(new TablePropertyMap);
- sal_Int32 nTblInd = pHandler->getMeasureValue();
- pTblIndMap->setValue(TablePropertyMap::LEFT_MARGIN, nTblInd);
+ sal_uInt32 nTblInd = pHandler->getMeasureValue();
+ pTblIndMap->setValue( TablePropertyMap::LEFT_MARGIN, nTblInd);
insertTableProps(pTblIndMap);
}
}
commit a3b0d947b026731af6d29891876593c82c2bc65b
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Mar 26 17:27:01 2014 +0100
Work around MSC "'override' cannot be used with 'inline'" bug
Change-Id: If736316402c49153d4c8552672c90552548f90b8
diff --git a/stoc/source/javavm/interact.cxx b/stoc/source/javavm/interact.cxx
index e51d278..3edc3ff 100644
--- a/stoc/source/javavm/interact.cxx
+++ b/stoc/source/javavm/interact.cxx
@@ -38,7 +38,7 @@ class AbortContinuation:
public:
inline AbortContinuation() {}
- virtual inline void SAL_CALL select() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE {}
+ virtual void SAL_CALL select() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE {}
private:
AbortContinuation(AbortContinuation &); // not implemented
commit b3847f3dfda6ed18f5f09f01354c529925c25889
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Mar 26 17:10:41 2014 +0100
Work around MSC "'override' cannot be used with 'inline'" bug
Change-Id: Icd3b09f098c19268ac888dd6195fb535979557ed
diff --git a/include/comphelper/listenernotification.hxx b/include/comphelper/listenernotification.hxx
index cac3a79..5ae133b 100644
--- a/include/comphelper/listenernotification.hxx
+++ b/include/comphelper/listenernotification.hxx
@@ -203,10 +203,16 @@ namespace comphelper
inline bool notify( const EventClass& _rEvent, NotificationMethod _pNotify ) SAL_THROW(( ::com::sun::star::uno::Exception ));
protected:
- inline virtual bool implNotify(
+ virtual bool implNotify(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& _rxListener,
const ::com::sun::star::lang::EventObject& _rEvent
- ) SAL_THROW( ( ::com::sun::star::uno::Exception ) ) SAL_OVERRIDE;
+ ) SAL_THROW( ( ::com::sun::star::uno::Exception ) ) SAL_OVERRIDE
+ {
+ const EventClass& rTypedEvent( static_cast< const EventClass& >( _rEvent ) );
+ ListenerClass* pTypedListener( static_cast< ListenerClass* >( _rxListener.get() ) );
+ (pTypedListener->*m_pNotificationMethod)( rTypedEvent );
+ return true;
+ }
};
@@ -219,19 +225,6 @@ namespace comphelper
return bRet;
}
-
- template< class LISTENER, class EVENT >
- inline bool OSimpleListenerContainer< LISTENER, EVENT >::implNotify(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& _rxListener,
- const ::com::sun::star::lang::EventObject& _rEvent ) SAL_THROW( ( ::com::sun::star::uno::Exception ) )
- {
- const EventClass& rTypedEvent( static_cast< const EventClass& >( _rEvent ) );
- ListenerClass* pTypedListener( static_cast< ListenerClass* >( _rxListener.get() ) );
- (pTypedListener->*m_pNotificationMethod)( rTypedEvent );
- return true;
- }
-
-
//= OListenerContainerBase
/** is a specialization of OListenerContainer which saves you some additional type casts,
@@ -267,10 +260,16 @@ namespace comphelper
using OListenerContainer::impl_notify;
protected:
- inline virtual bool implNotify(
+ virtual bool implNotify(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& _rxListener,
const ::com::sun::star::lang::EventObject& _rEvent
- ) SAL_THROW( ( ::com::sun::star::uno::Exception ) ) SAL_OVERRIDE;
+ ) SAL_THROW( ( ::com::sun::star::uno::Exception ) ) SAL_OVERRIDE
+ {
+ return implTypedNotify(
+ ::com::sun::star::uno::Reference< ListenerClass >( static_cast< ListenerClass* >( _rxListener.get() ) ),
+ static_cast< const EventClass& >( _rEvent )
+ );
+ }
virtual bool implTypedNotify(
const ::com::sun::star::uno::Reference< ListenerClass >& _rxListener,
@@ -278,18 +277,6 @@ namespace comphelper
) SAL_THROW( ( ::com::sun::star::uno::Exception ) ) = 0;
};
- template< class LISTENER, class EVENT >
- inline bool OListenerContainerBase< LISTENER, EVENT >::implNotify(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& _rxListener,
- const ::com::sun::star::lang::EventObject& _rEvent ) SAL_THROW( ( ::com::sun::star::uno::Exception ) )
- {
- return implTypedNotify(
- ::com::sun::star::uno::Reference< ListenerClass >( static_cast< ListenerClass* >( _rxListener.get() ) ),
- static_cast< const EventClass& >( _rEvent )
- );
- }
-
-
} // namespace comphelper
commit 35ddbcbc42628c57c3e5fda1a3e221231d21803b
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Mar 26 16:56:44 2014 +0100
Fix merge conflicts
Change-Id: I6e099911afec9c4086f620b45656880135decff0
diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx
index 2713567..2b82d2c 100644
--- a/include/vcl/virdev.hxx
+++ b/include/vcl/virdev.hxx
@@ -113,7 +113,7 @@ public:
virtual ~VirtualDevice();
- virtual void EnableRTL( bool bEnable = true ) SAL_OVERRIDE;
+ virtual void EnableRTL( bool bEnable = true );
bool SetOutputSizePixel( const Size& rNewSize, bool bErase = true );
bool SetOutputSizePixelScaleOffsetAndBuffer( const Size& rNewSize, const Fraction& rScale, const Point& rNewOffset, const basebmp::RawMemorySharedArray &pBuffer );
@@ -134,8 +134,8 @@ public:
void SetReferenceDevice( sal_Int32 i_nDPIX, sal_Int32 i_nDPIY );
- sal_uInt16 GetBitCount() const SAL_OVERRIDE;
- sal_uInt16 GetAlphaBitCount() const SAL_OVERRIDE;
+ sal_uInt16 GetBitCount() const;
+ sal_uInt16 GetAlphaBitCount() const;
private:
SAL_DLLPRIVATE void ImplSetReferenceDevice( RefDevMode, sal_Int32 i_nDPIX, sal_Int32 i_nDPIY );
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 5751489..ecd350e 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -595,7 +595,7 @@ public:
OutputDevice const* GetOutDev() const { return mpOutputDevice; };
OutputDevice* GetOutDev() { return mpOutputDevice; };
- virtual void EnableRTL ( bool bEnable = true ) SAL_OVERRIDE;
+ virtual void EnableRTL ( bool bEnable = true );
virtual void MouseMove( const MouseEvent& rMEvt );
virtual void MouseButtonDown( const MouseEvent& rMEvt );
virtual void MouseButtonUp( const MouseEvent& rMEvt );
commit 2d832c264801a8b1e155d33d1506af55dc6e207f
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Wed Mar 26 16:17:21 2014 +0100
webdav: Workaround failing unlocking by ignoring certificates when closing.
In neon version, we use xml::crypto::SEInitializer in
NeonSession_CertificationNotify which I see called only once.
For some reason in serf, Serf_ConnectSetup is called every time
we send a command to the server. But that leads to not working
verifySerfCertificateChain in __run_exit_handlers because
xml::crypto::SEInitializer is not available anymore.
Change-Id: I15685256790375dd86eb1b7614da25838d5ce244
diff --git a/ucb/source/ucp/webdav/SerfLockStore.cxx b/ucb/source/ucp/webdav/SerfLockStore.cxx
index 183d393..2053598 100644
--- a/ucb/source/ucp/webdav/SerfLockStore.cxx
+++ b/ucb/source/ucp/webdav/SerfLockStore.cxx
@@ -75,6 +75,7 @@ void TickerThread::run()
SerfLockStore::SerfLockStore()
: m_pTickerThread( 0 )
+ , m_bFinishing( false )
{
}
@@ -82,6 +83,7 @@ SerfLockStore::SerfLockStore()
SerfLockStore::~SerfLockStore()
{
stopTicker();
+ m_bFinishing = true;
// release active locks, if any.
SAL_WARN_IF( !m_aLockInfoMap.empty(), "ucb.ucp.webdav",
@@ -96,6 +98,10 @@ SerfLockStore::~SerfLockStore()
}
}
+bool SerfLockStore::finishing() const
+{
+ return m_bFinishing;
+}
void SerfLockStore::startTicker()
{
diff --git a/ucb/source/ucp/webdav/SerfLockStore.hxx b/ucb/source/ucp/webdav/SerfLockStore.hxx
index 8205a20..a995ced 100644
--- a/ucb/source/ucp/webdav/SerfLockStore.hxx
+++ b/ucb/source/ucp/webdav/SerfLockStore.hxx
@@ -55,12 +55,14 @@ class SerfLockStore
{
osl::Mutex m_aMutex;
TickerThread * m_pTickerThread;
+ bool m_bFinishing;
LockInfoMap m_aLockInfoMap;
public:
SerfLockStore();
~SerfLockStore();
+ bool finishing() const;
OUString getLockToken( const OUString& rLock );
void addLock( const OUString& rLock,
diff --git a/ucb/source/ucp/webdav/SerfSession.cxx b/ucb/source/ucp/webdav/SerfSession.cxx
index cff90be..eea9644 100644
--- a/ucb/source/ucp/webdav/SerfSession.cxx
+++ b/ucb/source/ucp/webdav/SerfSession.cxx
@@ -352,6 +352,13 @@ apr_status_t SerfSession::verifySerfCertificateChain (
return SERF_SSL_CERT_UNKNOWN_FAILURE;
}
+ // When called from SerfLockStore::~SerfLockStore(),
+ // css::xml::crypto::SEInitializer::create() will fail
+ // but we want to send unlock commands anyway,
+ // so just ignore certificates and return here.
+ if (apr_environment::AprEnv::getAprEnv()->getSerfLockStore()->finishing())
+ return APR_SUCCESS;
+
// Create some crypto objects to decode and handle the base64
// encoded certificate chain.
uno::Reference< security::XCertificateContainer > xCertificateContainer;
commit 06072a9707ecebf97758a50255863ee7d3383162
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Tue Mar 25 22:38:27 2014 +0100
remove SerfTypes.hxx
Change-Id: I189e7168562db2ca03fd64745eb1f826b6c9adc2
diff --git a/ucb/source/ucp/webdav/DAVProperties.hxx b/ucb/source/ucp/webdav/DAVProperties.hxx
index 8bf3ca3..f7c2911 100644
--- a/ucb/source/ucp/webdav/DAVProperties.hxx
+++ b/ucb/source/ucp/webdav/DAVProperties.hxx
@@ -22,11 +22,12 @@
#define _DAVPROPERTIES_HXX_
#include <rtl/ustring.hxx>
-#include "SerfTypes.hxx"
namespace http_dav_ucp
{
+typedef struct { const char *nspace, *name; } SerfPropName;
+
struct DAVProperties
{
static const OUString CREATIONDATE;
diff --git a/ucb/source/ucp/webdav/SerfLockStore.hxx b/ucb/source/ucp/webdav/SerfLockStore.hxx
index eefd7b8..8205a20 100644
--- a/ucb/source/ucp/webdav/SerfLockStore.hxx
+++ b/ucb/source/ucp/webdav/SerfLockStore.hxx
@@ -25,7 +25,6 @@
#include <osl/mutex.hxx>
#include <rtl/ref.hxx>
#include <rtl/ustring.hxx>
-#include <SerfTypes.hxx>
#include <SerfSession.hxx>
namespace http_dav_ucp
diff --git a/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx b/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx
index 2661e10..8117b1b 100644
--- a/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx
+++ b/ucb/source/ucp/webdav/SerfPropFindReqProcImpl.cxx
@@ -18,7 +18,6 @@
*/
#include "SerfPropFindReqProcImpl.hxx"
-#include "SerfTypes.hxx"
#include "DAVProperties.hxx"
#include "webdavresponseparser.hxx"
diff --git a/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx b/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx
index 950eb16..06e539d 100644
--- a/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx
+++ b/ucb/source/ucp/webdav/SerfPropPatchReqProcImpl.cxx
@@ -23,7 +23,6 @@
#include "UCBDeadPropertyValue.hxx"
#include "SerfPropPatchReqProcImpl.hxx"
-#include "SerfTypes.hxx"
namespace http_dav_ucp
{
diff --git a/ucb/source/ucp/webdav/SerfSession.cxx b/ucb/source/ucp/webdav/SerfSession.cxx
index 017b978..cff90be 100644
--- a/ucb/source/ucp/webdav/SerfSession.cxx
+++ b/ucb/source/ucp/webdav/SerfSession.cxx
@@ -28,7 +28,6 @@
#include <apr_strings.h>
#include "DAVAuthListener.hxx"
-#include "SerfTypes.hxx"
#include "SerfSession.hxx"
#include "SerfUri.hxx"
#include "SerfRequestProcessor.hxx"
@@ -193,7 +192,7 @@ serf_context_t* SerfSession::getSerfContext()
return m_pSerfContext;
}
-SerfConnection* SerfSession::getSerfConnection()
+serf_connection_t* SerfSession::getSerfConnection()
{
return m_pSerfConnection;
}
diff --git a/ucb/source/ucp/webdav/SerfSession.hxx b/ucb/source/ucp/webdav/SerfSession.hxx
index f580a47..92cecf7 100644
--- a/ucb/source/ucp/webdav/SerfSession.hxx
+++ b/ucb/source/ucp/webdav/SerfSession.hxx
@@ -26,9 +26,10 @@
#include <boost/shared_ptr.hpp>
#include <osl/mutex.hxx>
#include "DAVSession.hxx"
-#include "SerfTypes.hxx"
#include "SerfUri.hxx"
+#include <serf.h>
+
namespace ucbhelper { class ProxyDecider; }
namespace http_dav_ucp
@@ -51,7 +52,7 @@ private:
OUString m_aProxyName;
sal_Int32 m_nProxyPort;
- SerfConnection* m_pSerfConnection;
+ serf_connection_t* m_pSerfConnection;
serf_context_t* m_pSerfContext;
serf_bucket_alloc_t* m_pSerfBucket_Alloc;
bool m_bIsHeadRequestInProgress;
@@ -104,7 +105,7 @@ public:
apr_pool_t* getAprPool();
serf_bucket_alloc_t* getSerfBktAlloc();
serf_context_t* getSerfContext();
- SerfConnection* getSerfConnection();
+ serf_connection_t* getSerfConnection();
// DAVSession methods
virtual sal_Bool CanUse( const OUString & inUri );
@@ -274,7 +275,7 @@ private:
/*
// low level GET implementation, used by public GET implementations
- static int GET( SerfConnection * sess,
+ static int GET( serf_connection_t * sess,
const char * uri,
//ne_block_reader reader,
bool getheaders,
@@ -282,14 +283,14 @@ private:
// Buffer-based PUT implementation. Serf only has file descriptor-
// based API.
- static int PUT( SerfConnection * sess,
+ static int PUT( serf_connection_t * sess,
const char * uri,
const char * buffer,
size_t size );
// Buffer-based POST implementation. Serf only has file descriptor-
// based API.
- int POST( SerfConnection * sess,
+ int POST( serf_connection_t * sess,
const char * uri,
const char * buffer,
//ne_block_reader reader,
diff --git a/ucb/source/ucp/webdav/SerfTypes.hxx b/ucb/source/ucp/webdav/SerfTypes.hxx
deleted file mode 100644
index 2393458..0000000
--- a/ucb/source/ucp/webdav/SerfTypes.hxx
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-
-
-#ifndef INCLUDED_SERFTYPES_HXX
-#define INCLUDED_SERFTYPES_HXX
-
-#include <serf.h>
-
-typedef serf_connection_t SerfConnection;
-
-// TODO, check if we need it later on
-typedef struct { const char *nspace, *name; } SerfPropName;
-
-#endif // INCLUDED_SERFTYPES_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 05671c1f01c73bd3f4773c9653d95e3188657eb3
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Tue Mar 25 22:17:59 2014 +0100
unused variables and simplify
Change-Id: Ib2412d5bd3e3db42b972783bb8d17bc6559c9c21
diff --git a/ucb/source/ucp/webdav/DAVSessionFactory.cxx b/ucb/source/ucp/webdav/DAVSessionFactory.cxx
index c2f1dd2..43a2a85 100644
--- a/ucb/source/ucp/webdav/DAVSessionFactory.cxx
+++ b/ucb/source/ucp/webdav/DAVSessionFactory.cxx
@@ -34,8 +34,6 @@ rtl::Reference< DAVSession > DAVSessionFactory::createDAVSession(
const uno::Reference< uno::XComponentContext > & rxContext )
throw( DAVException )
{
- m_xMSF = rxContext;
-
osl::MutexGuard aGuard( m_aMutex );
if ( !m_xProxyDecider.get() )
diff --git a/ucb/source/ucp/webdav/DAVSessionFactory.hxx b/ucb/source/ucp/webdav/DAVSessionFactory.hxx
index 6617e8c..9f9f5c5 100644
--- a/ucb/source/ucp/webdav/DAVSessionFactory.hxx
+++ b/ucb/source/ucp/webdav/DAVSessionFactory.hxx
@@ -56,7 +56,6 @@ public:
rxContext )
throw( DAVException );
- ::uno::Reference< ::uno::XComponentContext > getServiceFactory() { return m_xMSF; }
private:
typedef std::map< OUString, DAVSession * > Map;
@@ -64,8 +63,6 @@ private:
osl::Mutex m_aMutex;
std::auto_ptr< ucbhelper::InternetProxyDecider > m_xProxyDecider;
- ::uno::Reference< ::uno::XComponentContext > m_xMSF;
-
void releaseElement( DAVSession * pElement ) SAL_THROW(());
friend class DAVSession;
diff --git a/ucb/source/ucp/webdav/SerfLockStore.cxx b/ucb/source/ucp/webdav/SerfLockStore.cxx
index a9696b3..183d393 100644
--- a/ucb/source/ucp/webdav/SerfLockStore.cxx
+++ b/ucb/source/ucp/webdav/SerfLockStore.cxx
@@ -91,8 +91,7 @@ SerfLockStore::~SerfLockStore()
const LockInfoMap::const_iterator end( m_aLockInfoMap.end() );
while ( it != end )
{
- const OUString& rLock = (*it).first;
- (*it).second.m_xSession->UNLOCK( rLock );
+ (*it).second.m_xSession->UNLOCK( (*it).first );
++it;
}
}
diff --git a/ucb/source/ucp/webdav/SerfSession.cxx b/ucb/source/ucp/webdav/SerfSession.cxx
index 65fd5dc..017b978 100644
--- a/ucb/source/ucp/webdav/SerfSession.cxx
+++ b/ucb/source/ucp/webdav/SerfSession.cxx
@@ -36,6 +36,7 @@
#include "SerfInputStream.hxx"
#include "UCBDeadPropertyValue.hxx"
+#include <com/sun/star/xml/crypto/SEInitializer.hpp>
#include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
#include <com/sun/star/security/XCertificate.hpp>
#include <com/sun/star/security/CertificateValidity.hpp>
@@ -354,7 +355,6 @@ apr_status_t SerfSession::verifySerfCertificateChain (
// Create some crypto objects to decode and handle the base64
// encoded certificate chain.
- uno::Reference< xml::crypto::XSEInitializer > xSEInitializer;
uno::Reference< security::XCertificateContainer > xCertificateContainer;
uno::Reference< xml::crypto::XXMLSecurityContext > xSecurityContext;
uno::Reference< xml::crypto::XSecurityEnvironment > xSecurityEnv;
@@ -365,10 +365,8 @@ apr_status_t SerfSession::verifySerfCertificateChain (
// Create a certificate container.
xCertificateContainer = security::CertificateContainer::create( xContext );
- xSEInitializer = uno::Reference< xml::crypto::XSEInitializer >(
- xContext->getServiceManager()->createInstanceWithContext(
- OUString( "com.sun.star.xml.crypto.SEInitializer" ), xContext ),
- uno::UNO_QUERY_THROW);
+ css::uno::Reference< css::xml::crypto::XSEInitializer > xSEInitializer =
+ css::xml::crypto::SEInitializer::create( xContext );
xSecurityContext = xSEInitializer->createSecurityContext( OUString() );
if (xSecurityContext.is())
diff --git a/ucb/source/ucp/webdav/webdavprovider.cxx b/ucb/source/ucp/webdav/webdavprovider.cxx
index 16684d8..0cf92da 100644
--- a/ucb/source/ucp/webdav/webdavprovider.cxx
+++ b/ucb/source/ucp/webdav/webdavprovider.cxx
@@ -39,7 +39,6 @@ using namespace http_dav_ucp;
ContentProvider::ContentProvider(
const uno::Reference< uno::XComponentContext >& rContext )
: ::ucbhelper::ContentProviderImplHelper( rContext ),
- m_xDAVSessionFactory( new DAVSessionFactory() ),
m_pProps( 0 )
{
}
@@ -196,7 +195,7 @@ ContentProvider::queryContent(
try
{
xContent = new ::http_dav_ucp::Content(
- m_xContext, this, xCanonicId, m_xDAVSessionFactory );
+ m_xContext, this, xCanonicId, new DAVSessionFactory() );
registerNewContent( xContent );
}
catch ( ucb::ContentCreationException const & )
diff --git a/ucb/source/ucp/webdav/webdavprovider.hxx b/ucb/source/ucp/webdav/webdavprovider.hxx
index 6947650..caf95600 100644
--- a/ucb/source/ucp/webdav/webdavprovider.hxx
+++ b/ucb/source/ucp/webdav/webdavprovider.hxx
@@ -68,7 +68,6 @@ namespace http_dav_ucp {
class ContentProvider : public ::ucbhelper::ContentProviderImplHelper
{
- rtl::Reference< DAVSessionFactory > m_xDAVSessionFactory;
PropertyMap * m_pProps;
public:
@@ -121,9 +120,6 @@ public:
// Non-interface methods.
- rtl::Reference< DAVSessionFactory > getDAVSessionFactory()
- { return m_xDAVSessionFactory; }
-
bool getProperty( const OUString & rPropName,
::com::sun::star::beans::Property & rProp,
bool bStrict = false );
commit 166a934cdf6b3adc89bca8ce6b2489d225c75309
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Tue Mar 25 12:19:35 2014 +0100
webdav: Implement refreshing of locks.
Change-Id: Ia4a1c7b929dac473dfb5a5fa233c7f0c662a95c6
diff --git a/ucb/source/ucp/webdav/SerfLockReqProcImpl.cxx b/ucb/source/ucp/webdav/SerfLockReqProcImpl.cxx
index 9e16212..ff766ef 100644
--- a/ucb/source/ucp/webdav/SerfLockReqProcImpl.cxx
+++ b/ucb/source/ucp/webdav/SerfLockReqProcImpl.cxx
@@ -32,10 +32,12 @@ namespace http_dav_ucp
SerfLockReqProcImpl::SerfLockReqProcImpl( const char* inPath,
const DAVRequestHeaders& inRequestHeaders,
SerfSession& rSession,
- const css::ucb::Lock & rLock )
+ const css::ucb::Lock& rLock,
+ sal_Int32* plastChanceToSendRefreshRequest )
: SerfRequestProcessorImpl( inPath, inRequestHeaders )
, m_rSession( rSession )
, m_aLock( rLock )
+ , m_plastChanceToSendRefreshRequest( plastChanceToSendRefreshRequest )
, m_xInputStream( new SerfInputStream() )
{
}
@@ -76,9 +78,12 @@ serf_bucket_t * SerfLockReqProcImpl::createSerfRequestBucket( serf_request_t * i
aBody.append("</lockinfo>\n");
const OString aBodyText(aBody.makeStringAndClear());
- serf_bucket_t* body_bkt = serf_bucket_simple_copy_create( aBodyText.getStr(),
- aBodyText.getLength(),
- pSerfBucketAlloc );
+ serf_bucket_t* body_bkt = 0;
+
+ if (!m_plastChanceToSendRefreshRequest)
+ body_bkt = serf_bucket_simple_copy_create( aBodyText.getStr(),
+ aBodyText.getLength(),
+ pSerfBucketAlloc );
// create serf request
serf_bucket_t *req_bkt = serf_request_bucket_request_create( inSerfRequest,
@@ -86,7 +91,8 @@ serf_bucket_t * SerfLockReqProcImpl::createSerfRequestBucket( serf_request_t * i
getPathStr(),
body_bkt,
pSerfBucketAlloc );
- handleChunkedEncoding(req_bkt, aBodyText.getLength());
+ if (!m_plastChanceToSendRefreshRequest)
+ handleChunkedEncoding(req_bkt, aBodyText.getLength());
// set request header fields
serf_bucket_t* hdrs_bkt = serf_bucket_request_get_headers( req_bkt );
@@ -110,8 +116,18 @@ serf_bucket_t * SerfLockReqProcImpl::createSerfRequestBucket( serf_request_t * i
default:
throw DAVException( DAVException::DAV_INVALID_ARG );
}
- serf_bucket_headers_set( hdrs_bkt, "Depth", depth );
- serf_bucket_headers_set( hdrs_bkt, "Content-Type", "application/xml" );
+ if (!m_plastChanceToSendRefreshRequest)
+ {
+ serf_bucket_headers_set( hdrs_bkt, "Depth", depth );
+ serf_bucket_headers_set( hdrs_bkt, "Content-Type", "application/xml" );
+ }
+ else
+ {
+ const OString sToken( "(<" + OUStringToOString( apr_environment::AprEnv::getAprEnv()->
+ getSerfLockStore()->getLockToken( OUString::createFromAscii(getPathStr())),
+ RTL_TEXTENCODING_UTF8 ) + ">)" );
+ serf_bucket_headers_set( hdrs_bkt, "If", sToken.getStr() );
+ }
// Set the lock timeout
if (m_aLock.Timeout == -1)
@@ -121,6 +137,8 @@ serf_bucket_t * SerfLockReqProcImpl::createSerfRequestBucket( serf_request_t * i
const OString aTimeValue("Second-" + OString::number(m_aLock.Timeout));
serf_bucket_headers_set( hdrs_bkt, "Timeout", aTimeValue.getStr() );
}
+ else
+ serf_bucket_headers_set( hdrs_bkt, "Timeout", "Second-180" );
osl_getSystemTime( &m_aStartCall );
@@ -158,6 +176,13 @@ void SerfLockReqProcImpl::handleEndOfResponseData( serf_bucket_t * )
else
SAL_WARN("ucb.ucp.webdav", "No chance to refresh lock before timeout!" );
}
+ if (m_plastChanceToSendRefreshRequest)
+ {
+ *m_plastChanceToSendRefreshRequest = lastChanceToSendRefreshRequest;
+ assert(aLocks.size() == 1);
+ // We are just refreshing lock, do not add it into SerfLockStore
+ break;
+ }
apr_environment::AprEnv::getAprEnv()->getSerfLockStore()->addLock(
OUString::createFromAscii(getPathStr()),
aLocks[i].LockTokens[0],
diff --git a/ucb/source/ucp/webdav/SerfLockReqProcImpl.hxx b/ucb/source/ucp/webdav/SerfLockReqProcImpl.hxx
index 766bc2b..9341a40 100644
--- a/ucb/source/ucp/webdav/SerfLockReqProcImpl.hxx
+++ b/ucb/source/ucp/webdav/SerfLockReqProcImpl.hxx
@@ -37,7 +37,8 @@ public:
SerfLockReqProcImpl( const char* inPath,
const DAVRequestHeaders& inRequestHeaders,
SerfSession& rSession,
- const css::ucb::Lock & rLock );
+ const css::ucb::Lock& rLock,
+ sal_Int32* plastChanceToSendRefreshRequest = 0 );
virtual ~SerfLockReqProcImpl() SAL_OVERRIDE;
@@ -53,6 +54,8 @@ private:
SerfSession& m_rSession;
css::ucb::Lock m_aLock;
+ // if m_plastChanceToSendRefreshRequest is not 0 we are sending just refresh request
+ sal_Int32* m_plastChanceToSendRefreshRequest;
TimeValue m_aStartCall;
css::uno::Reference< SerfInputStream > m_xInputStream;
};
diff --git a/ucb/source/ucp/webdav/SerfLockStore.cxx b/ucb/source/ucp/webdav/SerfLockStore.cxx
index 6c0a29e..a9696b3 100644
--- a/ucb/source/ucp/webdav/SerfLockStore.cxx
+++ b/ucb/source/ucp/webdav/SerfLockStore.cxx
@@ -197,8 +197,7 @@ void SerfLockStore::refreshLocks()
// refresh the lock.
sal_Int32 nlastChanceToSendRefreshRequest = -1;
if ( rInfo.m_xSession->LOCK(
- (*it).first,
- /* out param */ nlastChanceToSendRefreshRequest ) )
+ (*it).first, &nlastChanceToSendRefreshRequest ) )
{
rInfo.m_nLastChanceToSendRefreshRequest
= nlastChanceToSendRefreshRequest;
diff --git a/ucb/source/ucp/webdav/SerfRequestProcessor.cxx b/ucb/source/ucp/webdav/SerfRequestProcessor.cxx
index ced9d5b..ddeecca 100644
--- a/ucb/source/ucp/webdav/SerfRequestProcessor.cxx
+++ b/ucb/source/ucp/webdav/SerfRequestProcessor.cxx
@@ -313,12 +313,13 @@ bool SerfRequestProcessor::processMove( const OUString & inDestinationPath,
}
-bool SerfRequestProcessor::processLock( const css::ucb::Lock & rLock )
+bool SerfRequestProcessor::processLock( const css::ucb::Lock & rLock, sal_Int32 *plastChanceToSendRefreshRequest )
{
mpProcImpl = new SerfLockReqProcImpl( mPathStr,
mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
mrSerfSession,
- rLock );
+ rLock,
+ plastChanceToSendRefreshRequest );
return runProcessor() == APR_SUCCESS;
}
diff --git a/ucb/source/ucp/webdav/SerfRequestProcessor.hxx b/ucb/source/ucp/webdav/SerfRequestProcessor.hxx
index 7e4573f..ef0987f 100644
--- a/ucb/source/ucp/webdav/SerfRequestProcessor.hxx
+++ b/ucb/source/ucp/webdav/SerfRequestProcessor.hxx
@@ -126,7 +126,7 @@ public:
apr_status_t& outSerfStatus );
//LOCK
- bool processLock( const css::ucb::Lock & rLock );
+ bool processLock( const css::ucb::Lock & rLock, sal_Int32 *plastChanceToSendRefreshRequest = 0 );
//UNLOCK
bool processUnlock();
diff --git a/ucb/source/ucp/webdav/SerfSession.cxx b/ucb/source/ucp/webdav/SerfSession.cxx
index f8222b9..65fd5dc 100644
--- a/ucb/source/ucp/webdav/SerfSession.cxx
+++ b/ucb/source/ucp/webdav/SerfSession.cxx
@@ -1060,32 +1060,25 @@ sal_Int64 SerfSession::LOCK( const OUString & /*inPath*/,
// LOCK (refresh existing lock)
-bool SerfSession::LOCK( const OUString& /*rLock*/,
- sal_Int32 & /*rlastChanceToSendRefreshRequest*/ )
+bool SerfSession::LOCK( const OUString& rLock,
+ sal_Int32 *plastChanceToSendRefreshRequest )
{
osl::Guard< osl::Mutex > theGuard( m_aMutex );
- return true;
- /*
- // refresh existing lock.
-
- TimeValue startCall;
- osl_getSystemTime( &startCall );
+ boost::shared_ptr<SerfRequestProcessor> aReqProc( createReqProc( rLock ) );
+ aReqProc->processLock( ucb::Lock(), plastChanceToSendRefreshRequest );
- if ( ne_lock_refresh( m_pHttpSession, pLock ) == NE_OK )
+ try
{
- rlastChanceToSendRefreshRequest
- = lastChanceToSendRefreshRequest( startCall, pLock->timeout );
-
- SAL_INFO("ucb.ucp.webdav", "Lock successfully refreshed." );
+ HandleError( aReqProc );
+ SAL_INFO("ucb.ucp.webdav", "Refreshing LOCK of " << rLock << " succeeded." );
return true;
}
- else
+ catch(...)
{
- SAL_INFO("ucb.ucp.webdav", "Lock not refreshed!" );
+ SAL_INFO("ucb.ucp.webdav", "Refreshing LOCK of " << rLock << " failed!" );
return false;
}
- */
}
diff --git a/ucb/source/ucp/webdav/SerfSession.hxx b/ucb/source/ucp/webdav/SerfSession.hxx
index 0c2288b..f580a47 100644
--- a/ucb/source/ucp/webdav/SerfSession.hxx
+++ b/ucb/source/ucp/webdav/SerfSession.hxx
@@ -267,8 +267,7 @@ private:
const DAVRequestEnvironment & rEnv );
// refresh lock, called by SerfLockStore::refreshLocks
- bool LOCK( const OUString& rLock,
- sal_Int32 & rlastChanceToSendRefreshRequest );
+ bool LOCK( const OUString& rLock, sal_Int32 *plastChanceToSendRefreshRequest );
// unlock, called by SerfLockStore::~SerfLockStore
void UNLOCK( const OUString& rLock );
commit 53e9b3393aaeb00687eae096944531747976cef3
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Fri Mar 21 12:42:51 2014 +0100
webdav: Implement unlocking of documents.
Change-Id: I12c092fa7034702273182ef07431ed00f38df8ef
diff --git a/ucb/Library_ucpdav1.mk b/ucb/Library_ucpdav1.mk
index 9ada038..51225d2 100644
--- a/ucb/Library_ucpdav1.mk
+++ b/ucb/Library_ucpdav1.mk
@@ -95,6 +95,7 @@ $(eval $(call gb_Library_add_exception_objects,ucpdav1,\
ucb/source/ucp/webdav/SerfRequestProcessor \
ucb/source/ucp/webdav/SerfRequestProcessorImpl \
ucb/source/ucp/webdav/SerfSession \
+ ucb/source/ucp/webdav/SerfUnlockReqProcImpl \
ucb/source/ucp/webdav/SerfUri \
ucb/source/ucp/webdav/UCBDeadPropertyValue \
ucb/source/ucp/webdav/webdavcontent \
diff --git a/ucb/source/ucp/webdav/SerfLockStore.cxx b/ucb/source/ucp/webdav/SerfLockStore.cxx
index 15aae7e..6c0a29e 100644
--- a/ucb/source/ucp/webdav/SerfLockStore.cxx
+++ b/ucb/source/ucp/webdav/SerfLockStore.cxx
@@ -123,6 +123,17 @@ void SerfLockStore::stopTicker()
}
}
+OUString SerfLockStore::getLockToken( const OUString& rLock )
+{
+ osl::MutexGuard aGuard( m_aMutex );
+
+ LockInfoMap::const_iterator it( m_aLockInfoMap.find( rLock ) );
+ if ( it != m_aLockInfoMap.end() )
+ return (*it).second.m_sToken;
+
+ SAL_WARN("ucb.ucp.webdav", "SerfLockStore::getLockToken: lock not found!" );
+ return OUString();
+}
void SerfLockStore::addLock( const OUString& rLock,
const OUString& sToken,
diff --git a/ucb/source/ucp/webdav/SerfLockStore.hxx b/ucb/source/ucp/webdav/SerfLockStore.hxx
index 92ab190..eefd7b8 100644
--- a/ucb/source/ucp/webdav/SerfLockStore.hxx
+++ b/ucb/source/ucp/webdav/SerfLockStore.hxx
@@ -62,6 +62,8 @@ public:
SerfLockStore();
~SerfLockStore();
+ OUString getLockToken( const OUString& rLock );
+
void addLock( const OUString& rLock,
const OUString& sToken,
rtl::Reference< SerfSession > const & xSession,
diff --git a/ucb/source/ucp/webdav/SerfRequestProcessor.cxx b/ucb/source/ucp/webdav/SerfRequestProcessor.cxx
index a557781..ced9d5b 100644
--- a/ucb/source/ucp/webdav/SerfRequestProcessor.cxx
+++ b/ucb/source/ucp/webdav/SerfRequestProcessor.cxx
@@ -18,6 +18,8 @@
*/
#include "SerfRequestProcessor.hxx"
+
+#include "AprEnv.hxx"
#include "SerfCallbacks.hxx"
#include "SerfSession.hxx"
#include "SerfPropFindReqProcImpl.hxx"
@@ -31,6 +33,7 @@
#include "SerfCopyReqProcImpl.hxx"
#include "SerfMoveReqProcImpl.hxx"
#include "SerfLockReqProcImpl.hxx"
+#include "SerfUnlockReqProcImpl.hxx"
#include <apr_strings.h>
@@ -320,6 +323,22 @@ bool SerfRequestProcessor::processLock( const css::ucb::Lock & rLock )
return runProcessor() == APR_SUCCESS;
}
+bool SerfRequestProcessor::processUnlock()
+{
+ // get the lock from lock store
+ const OUString sToken(
+ apr_environment::AprEnv::getAprEnv()->getSerfLockStore()->getLockToken(
+ OUString::createFromAscii(mPathStr)) );
+ if ( sToken.isEmpty() )
+ throw DAVException( DAVException::DAV_NOT_LOCKED );
+
+ mpProcImpl = new SerfUnlockReqProcImpl( mPathStr,
+ mrSerfSession.getRequestEnvironment().m_aRequestHeaders,
+ sToken );
+
+ return runProcessor() == APR_SUCCESS;
+}
+
apr_status_t SerfRequestProcessor::runProcessor()
{
prepareProcessor();
diff --git a/ucb/source/ucp/webdav/SerfRequestProcessor.hxx b/ucb/source/ucp/webdav/SerfRequestProcessor.hxx
index f941a49..7e4573f 100644
--- a/ucb/source/ucp/webdav/SerfRequestProcessor.hxx
+++ b/ucb/source/ucp/webdav/SerfRequestProcessor.hxx
@@ -128,6 +128,9 @@ public:
//LOCK
bool processLock( const css::ucb::Lock & rLock );
+ //UNLOCK
+ bool processUnlock();
+
apr_status_t provideSerfCredentials( char ** outUsername,
char ** outPassword,
serf_request_t * inRequest,
diff --git a/ucb/source/ucp/webdav/SerfSession.cxx b/ucb/source/ucp/webdav/SerfSession.cxx
index 7b21f8f..f8222b9 100644
--- a/ucb/source/ucp/webdav/SerfSession.cxx
+++ b/ucb/source/ucp/webdav/SerfSession.cxx
@@ -1091,58 +1091,47 @@ bool SerfSession::LOCK( const OUString& /*rLock*/,
// UNLOCK
-void SerfSession::UNLOCK( const OUString & /*inPath*/,
- const DAVRequestEnvironment & /*rEnv*/ )
+void SerfSession::UNLOCK( const OUString & inPath,
+ const DAVRequestEnvironment & rEnv )
throw ( DAVException )
{
osl::Guard< osl::Mutex > theGuard( m_aMutex );
- /*
- // get the neon lock from lock store
- SerfLock * theLock
- = m_aSerfLockStore.findByUri( makeAbsoluteURL( inPath ) );
- if ( !theLock )
- throw DAVException( DAVException::DAV_NOT_LOCKED );
-
Init( rEnv );
- int theRetVal = ne_unlock( m_pHttpSession, theLock );
+ boost::shared_ptr<SerfRequestProcessor> aReqProc( createReqProc( inPath ) );
+ aReqProc->processUnlock();
- if ( theRetVal == NE_OK )
+ try
{
- m_aSerfLockStore.removeLock( theLock );
- ne_lock_destroy( theLock );
+ HandleError( aReqProc );
+ SAL_INFO("ucb.ucp.webdav", "UNLOCK of " << inPath << " succeeded." );
}
- else
+ catch(...)
{
- SAL_INFO("ucb.ucp.webdav", "SerfSession::UNLOCK: unlocking of "
- << makeAbsoluteURL( inPath ) << " failed.");
+ SAL_INFO("ucb.ucp.webdav", "UNLOCK of " << inPath << " failed!" );
}
-
- HandleError( theRetVal, inPath, rEnv );
- */
}
// UNLOCK
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list