diff options
author | Ocke Janssen [oj] <Ocke.Janssen@sun.com> | 2010-01-22 12:14:40 +0100 |
---|---|---|
committer | Ocke Janssen [oj] <Ocke.Janssen@sun.com> | 2010-01-22 12:14:40 +0100 |
commit | efba41fb0a9427318b77e8111f0e282d18fd0a48 (patch) | |
tree | 4663bc2b7a724b47eb6aa403c3e0aacd0785d56a /reportdesign | |
parent | cea09e968c10682ade933a40038cb0b3eb658187 (diff) |
dba33f: #i108548# handle Label property from parse column and rowsetcolumn
Diffstat (limited to 'reportdesign')
3 files changed, 15 insertions, 30 deletions
diff --git a/reportdesign/source/ui/inc/FormattedFieldBeautifier.hxx b/reportdesign/source/ui/inc/FormattedFieldBeautifier.hxx index 5c835d983ff3..46599b76ace6 100644 --- a/reportdesign/source/ui/inc/FormattedFieldBeautifier.hxx +++ b/reportdesign/source/ui/inc/FormattedFieldBeautifier.hxx @@ -36,7 +36,6 @@ #include <com/sun/star/container/XChild.hpp> #include <com/sun/star/awt/XVclWindowPeer.hpp> #include <com/sun/star/report/XReportComponent.hpp> -#include <com/sun/star/report/XFormattedField.hpp> /** === end UNO includes === **/ //#include <boost/noncopyable.hpp> diff --git a/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx b/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx index b0c5922556ab..3ee02b45ebf4 100644 --- a/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx +++ b/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx @@ -91,39 +91,25 @@ namespace rptui void FormattedFieldBeautifier::setPlaceholderText( const uno::Reference< uno::XInterface >& _rxComponent ) { ::rtl::OUString sDataField; - uno::Reference< report::XReportComponent > xComponent; + uno::Reference< report::XReportComponent > xComponent( _rxComponent, uno::UNO_QUERY ); try { - // is it a formatted field? - uno::Reference< report::XFormattedField > xFormattedField( _rxComponent, uno::UNO_QUERY ); - if ( xFormattedField.is() ) + uno::Reference< report::XReportControlModel > xControlModel( xComponent, uno::UNO_QUERY ); + if ( xControlModel.is() ) { - sDataField = xFormattedField->getDataField(); - xComponent.set( xFormattedField.get() ); - } - else - { - // perhaps an image control? - uno::Reference< report::XImageControl > xImageControl( _rxComponent, uno::UNO_QUERY ); - if ( xImageControl.is() ) + sDataField = xControlModel->getDataField(); + + if ( sDataField.getLength() ) { - sDataField = xImageControl->getDataField(); - xComponent.set( xImageControl.get() ); + ReportFormula aFormula( sDataField ); + sDataField = aFormula.getEqualUndecoratedContent(); } } - if ( !xComponent.is() ) - return; - - if ( sDataField.getLength() ) - { - ReportFormula aFormula( sDataField ); - sDataField = aFormula.getEqualUndecoratedContent(); - } setPlaceholderText( getVclWindowPeer( xComponent ), sDataField ); } - catch (uno::Exception e) + catch (uno::Exception) { DBG_UNHANDLED_EXCEPTION(); } diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index fdfd91b63a67..5cb2f60d32fd 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -3567,6 +3567,10 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) aPos.Y += xShapeProp->getHeight(); aPos.X += nShapeWidth; } + ::rtl::OUString sLabel; + if ( xField->getPropertySetInfo()->hasPropertyByName(PROPERTY_LABEL) ) + xField->getPropertyValue(PROPERTY_LABEL) >>= sLabel; + if (pSectionViews[0] != pSectionViews[1] && nOBJID == OBJ_DLG_FORMATTEDFIELD) // we want this nice feature only at FORMATTEDFIELD { @@ -3574,6 +3578,8 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) // pSectionViews[1].position.x = pSectionViews[0].position.x uno::Reference< report::XReportComponent> xShapePropLabel(pObjs[0]->getUnoShape(),uno::UNO_QUERY_THROW); uno::Reference< report::XReportComponent> xShapePropTextField(pObjs[1]->getUnoShape(),uno::UNO_QUERY_THROW); + if ( sLabel.getLength() ) + xShapePropTextField->setName(sLabel); awt::Point aPosLabel = xShapePropLabel->getPosition(); awt::Point aPosTextField = xShapePropTextField->getPosition(); aPosTextField.X = aPosLabel.X; @@ -3595,12 +3601,6 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) uno::Reference< report::XFixedText> xShapeProp(pObj->getUnoShape(),uno::UNO_QUERY_THROW); xShapeProp->setName(xShapeProp->getName() + sDefaultName ); - ::rtl::OUString sLabel; - if ( xField->getPropertySetInfo()->hasPropertyByName(PROPERTY_LABEL) ) - xField->getPropertyValue(PROPERTY_LABEL) >>= sLabel; - if ( sLabel.getLength() ) - xShapeProp->setLabel(sLabel); - for(i = 0; i < sizeof(pControl)/sizeof(pControl[0]);++i) // insert controls { correctOverlapping(pControl[i],pSectionWindow[1-i]->getReportSection()); |