diff options
33 files changed, 847 insertions, 273 deletions
diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx index b3c2af69f..5f8bd7519 100644 --- a/dbaccess/source/ui/dlg/queryfilter.cxx +++ b/dbaccess/source/ui/dlg/queryfilter.cxx @@ -372,23 +372,38 @@ sal_Bool DlgFilterCrit::getCondition(const ListBox& _rField,const ListBox& _rCom sal_Bool bHaving = sal_False; try { + ::rtl::OUString sTableName; sal_Bool bFunction = sal_False; _rFilter.Name = _rField.GetSelectEntry(); Reference< XPropertySet > xColumn = getQueryColumn(_rFilter.Name); - if ( xColumn.is() && xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_REALNAME) ) - { - xColumn->getPropertyValue(PROPERTY_REALNAME) >>= _rFilter.Name; - static ::rtl::OUString sAgg(RTL_CONSTASCII_USTRINGPARAM("AggregateFunction")); - if ( xColumn->getPropertySetInfo()->hasPropertyByName(sAgg) ) - xColumn->getPropertyValue(sAgg) >>= bHaving; - static ::rtl::OUString sFunction(RTL_CONSTASCII_USTRINGPARAM("Function")); - if ( xColumn->getPropertySetInfo()->hasPropertyByName(sFunction) ) - xColumn->getPropertyValue(sFunction) >>= bFunction; - } - if ( !bFunction ) + if ( xColumn.is() ) { - ::rtl::OUString aQuote = m_xMetaData.is() ? m_xMetaData->getIdentifierQuoteString() : ::rtl::OUString(); - _rFilter.Name = ::dbtools::quoteName(aQuote,_rFilter.Name); + Reference< XPropertySetInfo > xInfo = xColumn->getPropertySetInfo(); + if ( xInfo->hasPropertyByName(PROPERTY_REALNAME) ) + { + if ( xInfo->hasPropertyByName(PROPERTY_TABLENAME) ) + xColumn->getPropertyValue(PROPERTY_TABLENAME) >>= sTableName; + xColumn->getPropertyValue(PROPERTY_REALNAME) >>= _rFilter.Name; + static ::rtl::OUString sAgg(RTL_CONSTASCII_USTRINGPARAM("AggregateFunction")); + if ( xInfo->hasPropertyByName(sAgg) ) + xColumn->getPropertyValue(sAgg) >>= bHaving; + static ::rtl::OUString sFunction(RTL_CONSTASCII_USTRINGPARAM("Function")); + if ( xInfo->hasPropertyByName(sFunction) ) + xColumn->getPropertyValue(sFunction) >>= bFunction; + } + if ( !bFunction ) + { + const ::rtl::OUString aQuote = m_xMetaData.is() ? m_xMetaData->getIdentifierQuoteString() : ::rtl::OUString(); + _rFilter.Name = ::dbtools::quoteName(aQuote,_rFilter.Name); + if ( sTableName.getLength() ) + { + static ::rtl::OUString sSep(RTL_CONSTASCII_USTRINGPARAM(".")); + sTableName = ::dbtools::quoteName(aQuote,sTableName); + sTableName += sSep; + sTableName += _rFilter.Name; + _rFilter.Name = sTableName; + } + } // if ( !bFunction ) } } catch(Exception) diff --git a/dbaccess/source/ui/inc/QueryDesignView.hxx b/dbaccess/source/ui/inc/QueryDesignView.hxx index ca247aba6..7f85b879a 100644 --- a/dbaccess/source/ui/inc/QueryDesignView.hxx +++ b/dbaccess/source/ui/inc/QueryDesignView.hxx @@ -139,7 +139,8 @@ namespace dbaui ::com::sun::star::lang::Locale getLocale() const { return m_aLocale;} ::rtl::OUString getDecimalSeparator() const { return m_sDecimalSep;} - SqlParseError InsertField( const OTableFieldDescRef& rInfo, sal_Bool bVis=sal_True, sal_Bool bActivate = sal_True); + SqlParseError InsertField( const OTableFieldDescRef& rInfo, sal_Bool bVis=sal_True, sal_Bool bActivate = sal_True); + bool HasFieldByAliasName(const ::rtl::OUString& rFieldName, OTableFieldDescRef& rInfo) const; // save the position of the table window and the pos of the splitters // called when fields are deleted void DeleteFields( const ::rtl::OUString& rAliasName ); diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index a10b80871..badcf1c16 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -434,7 +434,11 @@ namespace bErg = (pSTW && pSTW->ExistsField( aColumnName, _rDragInfo ) ); } if ( !bErg ) + { bErg = static_cast<OQueryTableView*>(_pView->getTableView())->FindTableFromField(aColumnName, _rDragInfo, nCntAccount); + if ( !bErg ) + bErg = _pView->HasFieldByAliasName(aColumnName, _rDragInfo); + } if ( !bErg ) { eErrorCode = eColumnNotFound; @@ -2835,6 +2839,11 @@ void OQueryDesignView::DeleteFields( const ::rtl::OUString& rAliasName ) m_pSelectionBox->DeleteFields( rAliasName ); } // ----------------------------------------------------------------------------- +bool OQueryDesignView::HasFieldByAliasName(const ::rtl::OUString& rFieldName, OTableFieldDescRef& rInfo) const +{ + return m_pSelectionBox->HasFieldByAliasName( rFieldName, rInfo); +} +// ----------------------------------------------------------------------------- SqlParseError OQueryDesignView::InsertField( const OTableFieldDescRef& rInfo, sal_Bool bVis, sal_Bool bActivate) { return m_pSelectionBox->InsertField( rInfo, BROWSER_INVALIDID,bVis, bActivate ).isValid() ? eOk : eTooManyColumns; diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx index 2301a6247..8c665e221 100644 --- a/dbaccess/source/ui/querydesign/QueryTableView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx @@ -1054,8 +1054,6 @@ sal_Bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUn return bSuccess; } - - //------------------------------------------------------------------------ void OQueryTableView::InsertField(const OTableFieldDescRef& rInfo) { diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index a52819b33..6c28e552f 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -408,9 +408,15 @@ void OSelectionBrowseBox::Init() aFont.SetWeight( WEIGHT_NORMAL ); GetDataWindow().SetFont( aFont ); - //xxx richtige Zeilenhoehe fuer EditEng ??? - long nLSize = GetDataWindow().GetTextHeight() + 4; - SetDataRowHeight(nLSize); + Size aHeight; + const Control* pControls[] = { m_pTextCell,m_pVisibleCell,m_pTableCell,m_pFieldCell }; + for(sal_Size i= 0; i < sizeof(pControls)/sizeof(pControls[0]);++i) + { + const Size aTemp( pControls[i]->GetOptimalSize(WINDOWSIZE_PREFERRED) ); + if ( aTemp.Height() > aHeight.Height() ) + aHeight.Height() = aTemp.Height(); + } // for(int i= 0; i < sizeof(pControls)/sizeof(pControls[0]);++i + SetDataRowHeight(aHeight.Height()); SetTitleLines(1); // Anzahl der sichtbaren Zeilen ermitteln for(long i=0;i<BROW_ROW_CNT;i++) @@ -1329,7 +1335,7 @@ void OSelectionBrowseBox::PaintCell(OutputDevice& rDev, const Rectangle& rRect, if (nRow == BROW_VIS_ROW) PaintTristate(rDev, rRect, pEntry->IsVisible() ? STATE_CHECK : STATE_NOCHECK); else - rDev.DrawText(rRect.TopLeft(), GetCellText(nRow, nColumnId)); + rDev.DrawText(rRect, GetCellText(nRow, nColumnId),TEXT_DRAW_VCENTER); rDev.SetClipRegion( ); } @@ -1338,15 +1344,15 @@ void OSelectionBrowseBox::PaintCell(OutputDevice& rDev, const Rectangle& rRect, void OSelectionBrowseBox::PaintStatusCell(OutputDevice& rDev, const Rectangle& rRect) const { DBG_CHKTHIS(OSelectionBrowseBox,NULL); - Point aPos(rRect.TopLeft()); - aPos.Y() -= 2; + Rectangle aRect(rRect); + aRect.TopLeft().Y() -= 2; String aLabel(ModuleRes(STR_QUERY_HANDLETEXT)); // ab BROW_CRIT2_ROW werden alle Zeilen mit "oder" angegeben xub_StrLen nToken = (xub_StrLen) (m_nSeekRow >= GetBrowseRow(BROW_CRIT2_ROW)) ? xub_StrLen(BROW_CRIT2_ROW) : xub_StrLen(GetRealRow(m_nSeekRow)); - rDev.DrawText(aPos, aLabel.GetToken(nToken)); + rDev.DrawText(aRect, aLabel.GetToken(nToken),TEXT_DRAW_VCENTER); } //------------------------------------------------------------------------------ @@ -2833,5 +2839,21 @@ Reference< XAccessible > OSelectionBrowseBox::CreateAccessibleCell( sal_Int32 _n return EditBrowseBox::CreateAccessibleCell( _nRow, _nColumnPos ); } // ----------------------------------------------------------------------------- +bool OSelectionBrowseBox::HasFieldByAliasName(const ::rtl::OUString& rFieldName, OTableFieldDescRef& rInfo) const +{ + OTableFields& aFields = getFields(); + OTableFields::iterator aIter = aFields.begin(); + OTableFields::iterator aEnd = aFields.end(); + for(;aIter != aEnd;++aIter) + { + if ( (*aIter)->GetFieldAlias() == rFieldName ) + { + rInfo = *aIter; + break; + } + } + return aIter != aEnd; +} +// ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx index 56ce9999a..fcc9a5320 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx @@ -123,6 +123,8 @@ namespace dbaui void InsertColumn( OTableFieldDescRef pEntry, USHORT& _nColumnPostion ); void RemoveColumn( USHORT _nColumnId ); void DeleteFields( const String& rAliasName ); + + bool HasFieldByAliasName(const ::rtl::OUString& rFieldName, OTableFieldDescRef& rInfo) const; // AddGroupBy:: F"ugt ein Feld mit Funktion == Grupierung. Falls das Feld schon vorhanden ist und ein Aggregate Funktion // benutzt, wird das Flag nicht gesetzt void AddGroupBy( const OTableFieldDescRef& rInfo,sal_uInt32 _nCurrentPos); diff --git a/reportdesign/inc/RptResId.hrc b/reportdesign/inc/RptResId.hrc index 9872e1163..3fe537a1a 100644 --- a/reportdesign/inc/RptResId.hrc +++ b/reportdesign/inc/RptResId.hrc @@ -147,7 +147,7 @@ #define RID_STR_PROPPAGE_DATA ( RID_STRING_START + 75 ) #define RID_STR_FILTER ( RID_STRING_START + 76 ) -#define RID_STR_BOOL ( RID_STRING_START + 77 ) +// free #define RID_STR_FORCENEWPAGE (RID_STRING_START + 78) #define RID_STR_NEWROWORCOL (RID_STRING_START + 79) @@ -179,14 +179,14 @@ #define RID_STR_REPORTHEADERFOOTER_DELETE (RID_STRING_START + 104) #define RID_STR_VISIBLE (RID_STRING_START + 105) -#define RID_STR_FORCENEWPAGE_CONST (RID_STRING_START + 106) -#define RID_STR_KEEPTOGETHER_CONST (RID_STRING_START + 107) +#define RID_STR_DETAIL (RID_STRING_START + 106) +#define RID_STR_PAGE_HEADER (RID_STRING_START + 107) #define RID_STR_GROUPKEEPTOGETHER (RID_STRING_START + 108) -#define RID_STR_GROUPKEEPTOGETHER_CONST (RID_STRING_START + 109) +#define RID_STR_PAGE_FOOTER (RID_STRING_START + 109) #define RID_STR_PAGEHEADEROPTION (RID_STRING_START + 110) #define RID_STR_PAGEFOOTEROPTION (RID_STRING_START + 111) -#define RID_STR_REPORTPRINTOPTION_CONST (RID_STRING_START + 112) -#define RID_STR_SECTIONPAGEBREAK_CONST (RID_STRING_START + 113) +#define RID_STR_REPORT_HEADER (RID_STRING_START + 112) +#define RID_STR_REPORT_FOOTER (RID_STRING_START + 113) #define RID_STR_SCOPE_GROUP (RID_STRING_START + 114) #define RID_APP_TITLE (RID_STRING_START + 115) #define RID_APP_NEW_DOC (RID_STRING_START + 116) @@ -216,7 +216,7 @@ #define RID_STR_FORMULALIST (RID_STRING_START + 140) #define RID_STR_SCOPE (RID_STRING_START + 141) #define RID_STR_TYPE (RID_STRING_START + 142) -#define RID_STR_TYPE_CONST (RID_STRING_START + 143) +#define RID_STR_MIMETYPE (RID_STRING_START + 143) #define RID_STR_CHARTTYPE (RID_STRING_START + 144) #define RID_STR_MASTERFIELDS (RID_STRING_START + 145) #define RID_STR_DETAILFIELDS (RID_STRING_START + 146) @@ -229,6 +229,7 @@ #define RID_STR_AREA (RID_STRING_START + 153) #define RID_STR_NONE (RID_STRING_START + 154) + // #define RID_STR_ (RID_STRING_START + 130) // ----------------------------------------------------------------------- #define RID_PAGEDIALOG_PAGE ( RID_PAGE_START + 1 ) @@ -253,6 +254,7 @@ #define RID_MENU_REPORT ( RID_MENU_START + 0 ) #define RID_GROUPSROWPOPUPMENU ( RID_MENU_START + 1 ) #define RID_MENU_NAVIGATOR ( RID_MENU_START + 2 ) +#define RID_TB_SORTING ( RID_MENU_START + 3 ) // image lists ----------------------------------------------------------------------- #define IMG_CONDFORMAT_DLG_SC (RID_IMAGELIST_START + 0) @@ -261,5 +263,18 @@ #define IMG_CONDFORMAT_DLG_LCH (RID_IMAGELIST_START + 3) #define RID_SVXIMGLIST_RPTEXPL (RID_IMAGELIST_START + 4) #define RID_SVXIMGLIST_RPTEXPL_HC (RID_IMAGELIST_START + 5) +#define IMG_ADDFIELD_DLG_SC (RID_IMAGELIST_START + 6)
+#define IMG_ADDFIELD_DLG_SCH (RID_IMAGELIST_START + 7)
+#define IMG_ADDFIELD_DLG_LC (RID_IMAGELIST_START + 8)
+#define IMG_ADDFIELD_DLG_LCH (RID_IMAGELIST_START + 9)
+ +// untyped +#define RID_STR_BOOL (RID_UNTYPED_START + 0 ) +#define RID_STR_FORCENEWPAGE_CONST (RID_UNTYPED_START + 1 ) +#define RID_STR_KEEPTOGETHER_CONST (RID_UNTYPED_START + 2) +#define RID_STR_GROUPKEEPTOGETHER_CONST (RID_UNTYPED_START + 3) +#define RID_STR_REPORTPRINTOPTION_CONST (RID_UNTYPED_START + 4) +#define RID_STR_SECTIONPAGEBREAK_CONST (RID_UNTYPED_START + 5) +#define RID_STR_TYPE_CONST (RID_UNTYPED_START + 6) #endif // _RPTUI_DLGRESID_HRC diff --git a/reportdesign/inc/UndoActions.hxx b/reportdesign/inc/UndoActions.hxx index 8971ee858..b14aa4648 100644 --- a/reportdesign/inc/UndoActions.hxx +++ b/reportdesign/inc/UndoActions.hxx @@ -113,6 +113,11 @@ namespace rptui inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getPageFooter() { return m_xReport->getPageFooter(); } inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getDetail() { return m_xReport->getDetail(); } + inline ::sal_Bool getReportHeaderOn() { return m_xReport->getReportHeaderOn(); } + inline ::sal_Bool getReportFooterOn() { return m_xReport->getReportFooterOn(); } + inline ::sal_Bool getPageHeaderOn() { return m_xReport->getPageHeaderOn(); } + inline ::sal_Bool getPageFooterOn() { return m_xReport->getPageFooterOn(); } + static ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OReportHelper> getMemberFunction(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection); }; diff --git a/reportdesign/inc/helpids.hrc b/reportdesign/inc/helpids.hrc index 301c2cee2..eb604b03e 100644 --- a/reportdesign/inc/helpids.hrc +++ b/reportdesign/inc/helpids.hrc @@ -76,7 +76,7 @@ #define HID_RPT_PROP_DETAILFIELDS (HID_RPT_START + 38) #define HID_RPT_PROP_AREA (HID_RPT_START + 39) #define UID_RPT_RPT_PROP_DLG_AREA (HID_RPT_START + 40) -// free +#define HID_RPT_PROP_MIMETYPE (HID_RPT_START + 41) // free // free #define HID_RPT_PROP_PRINTREPEATEDVALUES (HID_RPT_START + 44) diff --git a/reportdesign/java/com/sun/star/report/pentaho/parser/selectors.properties b/reportdesign/java/com/sun/star/report/pentaho/parser/selectors.properties index 0a78b4917..eca5a9072 100644 --- a/reportdesign/java/com/sun/star/report/pentaho/parser/selectors.properties +++ b/reportdesign/java/com/sun/star/report/pentaho/parser/selectors.properties @@ -41,6 +41,7 @@ namespaces.draw=urn:oasis:names:tc:opendocument:xmlns:drawing:1.0 namespaces.fo=urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0 namespaces.style=urn:oasis:names:tc:opendocument:xmlns:style:1.0 namespaces.table=urn:oasis:names:tc:opendocument:xmlns:table:1.0 +namespaces.chart=urn:oasis:names:tc:opendocument:xmlns:chart:1.0 namespaces.rpt=http://openoffice.org/2005/report # diff --git a/reportdesign/java/com/sun/star/report/pentaho/styles/stylemapper.xml b/reportdesign/java/com/sun/star/report/pentaho/styles/stylemapper.xml index e07d5fd18..129e86462 100644 --- a/reportdesign/java/com/sun/star/report/pentaho/styles/stylemapper.xml +++ b/reportdesign/java/com/sun/star/report/pentaho/styles/stylemapper.xml @@ -122,6 +122,12 @@ style-family="chart" type="styleNameRef"/> <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" + element-name="title" + attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" + attribute-name="style-name" + style-family="chart" + type="styleNameRef"/> + <mapping element-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" element-name="axis" attribute-namespace="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" attribute-name="style-name" diff --git a/reportdesign/registry/data/org/openoffice/Office/UI/ReportCommands.xcu b/reportdesign/registry/data/org/openoffice/Office/UI/ReportCommands.xcu index 26db4bc02..93625cd0c 100644 --- a/reportdesign/registry/data/org/openoffice/Office/UI/ReportCommands.xcu +++ b/reportdesign/registry/data/org/openoffice/Office/UI/ReportCommands.xcu @@ -147,13 +147,13 @@ <node oor:name=".uno:TextDocument" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="de">Text Dokument</value> - <value xml:lang="en-US">Text Document</value> + <value xml:lang="en-US">ODF Text Document</value> </prop> </node> <node oor:name=".uno:Spreadsheet" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="de">Tabellen Dokument</value> - <value xml:lang="en-US">Spreadsheet Document</value> + <value xml:lang="en-US">ODF Spreadsheet</value> </prop> </node> <node oor:name=".uno:ReportNavigator" oor:op="replace"> diff --git a/reportdesign/source/core/api/ReportEngineJFree.cxx b/reportdesign/source/core/api/ReportEngineJFree.cxx index 54f5f9e35..2ca4f5928 100644 --- a/reportdesign/source/core/api/ReportEngineJFree.cxx +++ b/reportdesign/source/core/api/ReportEngineJFree.cxx @@ -58,6 +58,7 @@ #include <comphelper/property.hxx> #include <connectivity/CommonTools.hxx> #include <rtl/ustrbuf.hxx> +#include <sfx2/docfilt.hxx> // ============================================================================= namespace reportdesign { @@ -170,16 +171,29 @@ void SAL_CALL OReportEngineJFree::setStatusIndicator( const uno::Reference< task if ( !m_xReport.is() || !m_xActiveConnection.is() ) throw lang::IllegalArgumentException(); + static const ::rtl::OUString s_sMediaType(RTL_CONSTASCII_USTRINGPARAM("MediaType")); try { + const uno::Reference< lang::XMultiServiceFactory > xFactory(m_xContext->getServiceManager(),uno::UNO_QUERY_THROW); + MimeConfigurationHelper aConfighelper(xFactory); + const ::rtl::OUString sMimeType = m_xReport->getMimeType(); + const SfxFilter* pFilter = SfxFilter::GetDefaultFilter( aConfighelper.GetDocServiceNameFromMediaType(sMimeType) ); + String sExt; + if ( pFilter ) + { + sExt = pFilter->GetDefaultExtension(); + sExt.EraseLeadingChars( '*' ); + } + else + sExt = String::CreateFromAscii(".rpt"); + uno::Reference< embed::XStorage > xTemp = OStorageHelper::GetTemporaryStorage(/*sFileTemp,embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE,*/uno::Reference< lang::XMultiServiceFactory >(m_xContext->getServiceManager(),uno::UNO_QUERY)); utl::DisposableComponent aTemp(xTemp); uno::Sequence< beans::PropertyValue > aEmpty; uno::Reference< beans::XPropertySet> xStorageProp(xTemp,uno::UNO_QUERY); if ( xStorageProp.is() ) { - static const ::rtl::OUString sPropName(RTL_CONSTASCII_USTRINGPARAM("MediaType")); - xStorageProp->setPropertyValue( sPropName, uno::makeAny(m_xReport->getMimeType())); + xStorageProp->setPropertyValue( s_sMediaType, uno::makeAny(sMimeType)); } m_xReport->storeToStorage(xTemp,aEmpty); // store to temp file because it may contain information which aren't in the database yet. @@ -189,18 +203,17 @@ void SAL_CALL OReportEngineJFree::setStatusIndicator( const uno::Reference< task aConvertedProperties[nPos++].Value <<= xTemp; aConvertedProperties[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OutputStorage")); - const static String s_sExt = String::CreateFromAscii(".rpt"); + String sName = m_xReport->getCaption(); if ( !sName.Len() ) sName = m_xReport->getName(); - ::utl::TempFile aFile(sName,sal_False,&s_sExt); + ::utl::TempFile aFile(sName,sal_False,&sExt); uno::Reference< embed::XStorage > xOut = OStorageHelper::GetStorageFromURL(aFile.GetURL(),embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE,uno::Reference< lang::XMultiServiceFactory >(m_xContext->getServiceManager(),uno::UNO_QUERY)); utl::DisposableComponent aOut(xOut); xStorageProp.set(xOut,uno::UNO_QUERY); if ( xStorageProp.is() ) { - static const ::rtl::OUString sPropName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")); - xStorageProp->setPropertyValue( sPropName, uno::makeAny(m_xReport->getMimeType())); + xStorageProp->setPropertyValue( s_sMediaType, uno::makeAny(sMimeType)); } aConvertedProperties[nPos++].Value <<= xOut; @@ -225,7 +238,7 @@ void SAL_CALL OReportEngineJFree::setStatusIndicator( const uno::Reference< task aConvertedProperties[nPos++].Value <<= m_xReport->getCaption(); // create job factory and initialize - const ::rtl::OUString sReportEngineServiceName = ::dbtools::getDefaultReportEngineServiceName(uno::Reference< lang::XMultiServiceFactory >(m_xContext->getServiceManager(),uno::UNO_QUERY_THROW)); + const ::rtl::OUString sReportEngineServiceName = ::dbtools::getDefaultReportEngineServiceName(xFactory); uno::Reference<task::XJob> xJob(m_xContext->getServiceManager()->createInstanceWithContext(sReportEngineServiceName,m_xContext),uno::UNO_QUERY_THROW); if ( m_xReport->getCommand().getLength() ) { diff --git a/reportdesign/source/inc/stringconstants.hrc b/reportdesign/source/inc/stringconstants.hrc index c362a8f53..60cf60a8f 100644 --- a/reportdesign/source/inc/stringconstants.hrc +++ b/reportdesign/source/inc/stringconstants.hrc @@ -277,8 +277,8 @@ DECLARE_CONSTASCII_USTRING(PROPERTY_VISITEDCHARSTYLENAME); DECLARE_CONSTASCII_USTRING(PROPERTY_UNVISITEDCHARSTYLENAME); DECLARE_CONSTASCII_USTRING(PROPERTY_CHARKERNING ); -DECLARE_CONSTASCII_USTRING(PROPERTY_ORDER ); -DECLARE_CONSTASCII_USTRING(PROPERTY_APPLYFILTER ); +DECLARE_CONSTASCII_USTRING(PROPERTY_ORDER ); +DECLARE_CONSTASCII_USTRING(PROPERTY_APPLYFILTER ); //============================================================ //= service names diff --git a/reportdesign/source/ui/dlg/AddField.cxx b/reportdesign/source/ui/dlg/AddField.cxx index f8641f125..cf7099f3b 100644 --- a/reportdesign/source/ui/dlg/AddField.cxx +++ b/reportdesign/source/ui/dlg/AddField.cxx @@ -31,34 +31,31 @@ #include "AddField.hxx" #include "UITools.hxx" #include <svx/dbaexchange.hxx> +#include <svx/svdpagv.hxx> #include <com/sun/star/sdb/CommandType.hpp> #include <com/sun/star/sdb/XDocumentDataSource.hpp> -#include <comphelper/processfactory.hxx> +#include <com/sun/star/util/URL.hpp> +#include <com/sun/star/i18n/XCollator.hpp> + #include <vcl/waitobj.hxx> #include <vcl/svapp.hxx> #include <tools/diagnose_ex.h> #include <comphelper/stl_types.hxx> -#ifndef _RPTUI_SLOTID_HRC_ #include "rptui_slotid.hrc" -#endif -#include <svx/svdpagv.hxx> + #include <connectivity/dbtools.hxx> -#ifndef RTPUI_REPORTDESIGN_HELPID_HRC #include "helpids.hrc" -#endif -#ifndef _RPTUI_DLGRESID_HRC #include "RptResId.hrc" -#endif +#include "CondFormat.hrc" #include "ModuleHelper.hxx" -#ifndef REPORTDESIGN_SHARED_UISTRINGS_HRC #include "uistrings.hrc" -#endif #include <comphelper/property.hxx> +#include <svtools/imgdef.hxx> namespace rptui { -const long STD_WIN_SIZE_X = 120; -const long STD_WIN_SIZE_Y = 150; +const long STD_WIN_SIZE_X = 180; +const long STD_WIN_SIZE_Y = 220; const long LISTBOX_BORDER = 2; @@ -73,7 +70,7 @@ using namespace container; using namespace ::svx; class OAddFieldWindowListBox : public SvTreeListBox { - OAddFieldWindow* m_pTabWin; + OAddFieldWindow* m_pTabWin; OAddFieldWindowListBox(const OAddFieldWindowListBox&); void operator =(const OAddFieldWindowListBox&); @@ -81,25 +78,23 @@ protected: // virtual void Command( const CommandEvent& rEvt ); public: - OAddFieldWindowListBox( OAddFieldWindow* pParent ); + OAddFieldWindowListBox( OAddFieldWindow* _pParent ); virtual ~OAddFieldWindowListBox(); sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ); sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ); - uno::Sequence< beans::PropertyValue > getSelectedFieldDescriptor(); + uno::Sequence< beans::PropertyValue > getSelectedFieldDescriptors(); protected: // DragSourceHelper virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ); - // SvLBox - virtual BOOL DoubleClickHdl(); private: using SvTreeListBox::ExecuteDrop; }; // ----------------------------------------------------------------------------- -uno::Sequence< beans::PropertyValue > OAddFieldWindowListBox::getSelectedFieldDescriptor() +uno::Sequence< beans::PropertyValue > OAddFieldWindowListBox::getSelectedFieldDescriptors() { uno::Sequence< beans::PropertyValue > aArgs(GetSelectionCount()); sal_Int32 i = 0; @@ -119,13 +114,14 @@ uno::Sequence< beans::PropertyValue > OAddFieldWindowListBox::getSelectedFieldDe //================================================================== DBG_NAME( rpt_OAddFieldWindowListBox ); //------------------------------------------------------------------------------ -OAddFieldWindowListBox::OAddFieldWindowListBox( OAddFieldWindow* pParent ) - :SvTreeListBox( pParent, WB_HASBUTTONS|WB_BORDER ) - ,m_pTabWin( pParent ) +OAddFieldWindowListBox::OAddFieldWindowListBox( OAddFieldWindow* _pParent ) + :SvTreeListBox( _pParent, WB_BORDER|WB_SORT ) + ,m_pTabWin( _pParent ) { DBG_CTOR( rpt_OAddFieldWindowListBox,NULL); SetHelpId( HID_RPT_FIELD_SEL ); SetSelectionMode(MULTIPLE_SELECTION); + SetDragDropMode( 0xFFFF ); SetHighlightRange( ); } @@ -148,40 +144,32 @@ sal_Int8 OAddFieldWindowListBox::ExecuteDrop( const ExecuteDropEvent& /*rEvt*/ ) } //------------------------------------------------------------------------------ -BOOL OAddFieldWindowListBox::DoubleClickHdl() -{ - if ( m_pTabWin->createSelectionControls() ) - return sal_True; - - return SvTreeListBox::DoubleClickHdl(); -} - -//------------------------------------------------------------------------------ void OAddFieldWindowListBox::StartDrag( sal_Int8 /*_nAction*/, const Point& /*_rPosPixel*/ ) { - if ( GetSelectionCount() != 1 ) - // no drag without a field or with more than one + if ( GetSelectionCount() < 1 ) + // no drag without a field return; - ::svx::ODataAccessDescriptor aDescriptor; - m_pTabWin->fillDescriptor(FirstSelected(),aDescriptor); + OMultiColumnTransferable* pDataContainer = new OMultiColumnTransferable(getSelectedFieldDescriptors()); + Reference< XTransferable> xEnsureDelete = pDataContainer; - TransferableHelper* pTransferColumn = new ::svx::OColumnTransferable(aDescriptor, CTF_FIELD_DESCRIPTOR | CTF_CONTROL_EXCHANGE | CTF_COLUMN_DESCRIPTOR ); - Reference< XTransferable> xEnsureDelete = pTransferColumn; EndSelection(); - pTransferColumn->StartDrag( this, DND_ACTION_COPYMOVE | DND_ACTION_LINK ); + pDataContainer->StartDrag( this, DND_ACTION_COPYMOVE | DND_ACTION_LINK ); } //======================================================================== // class OAddFieldWindow //======================================================================== DBG_NAME( rpt_OAddFieldWindow ); //----------------------------------------------------------------------- -OAddFieldWindow::OAddFieldWindow(::rptui::OReportController& _rController,Window* pParent) +OAddFieldWindow::OAddFieldWindow(Window* pParent + ,const uno::Reference< beans::XPropertySet >& _xRowSet + ) :FloatingWindow(pParent, WinBits(WB_STDMODELESS|WB_SIZEABLE)) ,::comphelper::OPropertyChangeListener(m_aMutex) ,::comphelper::OContainerListener(m_aMutex) + ,m_xRowSet(_xRowSet) + ,m_aActions(this,ModuleRes(RID_TB_SORTING)) ,m_pListBox(new OAddFieldWindowListBox( this )) - ,m_rController( _rController ) ,m_nCommandType(0) ,m_bEscapeProcessing(sal_False) ,m_pChangeListener(NULL) @@ -189,25 +177,39 @@ OAddFieldWindow::OAddFieldWindow(::rptui::OReportController& _rController,Window DBG_CTOR( rpt_OAddFieldWindow,NULL); SetHelpId( HID_RPT_FIELD_SEL_WIN ); SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) ); + SetMinOutputSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y)); + + m_aActions.SetStyle(m_aActions.GetStyle()|WB_LINESPACING); + m_aActions.SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor()) ); + + m_aActions.SetSelectHdl(LINK(this, OAddFieldWindow, OnSortAction)); + setToolBox(&m_aActions); + m_aActions.CheckItem(SID_FM_SORTUP); + m_aActions.EnableItem(SID_ADD_CONTROL_PAIR, FALSE); + m_pListBox->SetDoubleClickHdl(LINK( this, OAddFieldWindow, OnDoubleClickHdl ) ); + m_pListBox->SetSelectHdl(LINK( this, OAddFieldWindow, OnSelectHdl ) ); + m_pListBox->SetDeselectHdl(LINK( this, OAddFieldWindow, OnSelectHdl ) ); m_pListBox->Show(); SetSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y)); - Show(); + //Show(); - try + if ( m_xRowSet.is() ) { - // be notified when the settings of report definition change - uno::Reference< beans::XPropertySet > xRowSetProps( m_rController.getRowSet(), uno::UNO_QUERY_THROW ); - m_pChangeListener = new ::comphelper::OPropertyChangeMultiplexer( this, xRowSetProps ); - m_pChangeListener->addProperty( PROPERTY_COMMAND ); - m_pChangeListener->addProperty( PROPERTY_COMMANDTYPE ); - m_pChangeListener->addProperty( PROPERTY_ESCAPEPROCESSING ); - m_pChangeListener->addProperty( PROPERTY_FILTER ); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); + try + { + // be notified when the settings of report definition change + m_pChangeListener = new ::comphelper::OPropertyChangeMultiplexer( this, m_xRowSet ); + m_pChangeListener->addProperty( PROPERTY_COMMAND ); + m_pChangeListener->addProperty( PROPERTY_COMMANDTYPE ); + m_pChangeListener->addProperty( PROPERTY_ESCAPEPROCESSING ); + m_pChangeListener->addProperty( PROPERTY_FILTER ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } } } @@ -230,15 +232,9 @@ void OAddFieldWindow::GetFocus() FloatingWindow::GetFocus(); } //----------------------------------------------------------------------- -sal_Bool OAddFieldWindow::createSelectionControls( ) +uno::Sequence< beans::PropertyValue > OAddFieldWindow::getSelectedFieldDescriptors() { - WaitObject aObj(this); - uno::Sequence< beans::PropertyValue > aArgs = m_pListBox->getSelectedFieldDescriptor(); - // we use this way to create undo actions - if ( aArgs.getLength() ) - m_rController.executeChecked(SID_ADD_CONTROL_PAIR,aArgs); - - return aArgs.getLength() != 0; + return m_pListBox->getSelectedFieldDescriptors(); } //----------------------------------------------------------------------- @@ -249,8 +245,11 @@ long OAddFieldWindow::PreNotify( NotifyEvent& _rNEvt ) const KeyCode& rKeyCode = _rNEvt.GetKeyEvent()->GetKeyCode(); if ( ( 0 == rKeyCode.GetModifier() ) && ( KEY_RETURN == rKeyCode.GetCode() ) ) { - if ( createSelectionControls() ) + if ( m_aCreateLink.IsSet() ) + { + m_aCreateLink.Call(this); return 1; + } } } @@ -259,7 +258,7 @@ long OAddFieldWindow::PreNotify( NotifyEvent& _rNEvt ) //----------------------------------------------------------------------- void OAddFieldWindow::_propertyChanged( const beans::PropertyChangeEvent& _evt ) throw( uno::RuntimeException ) { - OSL_ENSURE( _evt.Source == m_rController.getRowSet(), "OAddFieldWindow::_propertyChanged: where did this come from?" ); + OSL_ENSURE( _evt.Source == m_xRowSet, "OAddFieldWindow::_propertyChanged: where did this come from?" ); (void)_evt; Update(); } @@ -288,53 +287,61 @@ void OAddFieldWindow::Update() { // ListBox loeschen m_pListBox->Clear(); + const USHORT nItemCount = m_aActions.GetItemCount(); + for (USHORT j = 0; j< nItemCount; ++j) + { + m_aActions.EnableItem(m_aActions.GetItemId(j),FALSE); + } + String aTitle(ModuleRes(RID_STR_FIELDSELECTION)); SetText(aTitle); - - uno::Reference< beans::XPropertySet > xRowSetProps( m_rController.getRowSet(), uno::UNO_QUERY_THROW ); - - ::rtl::OUString sCommand( m_aCommandName ); - sal_Int32 nCommandType( m_nCommandType ); - sal_Bool bEscapeProcessing( m_bEscapeProcessing ); - ::rtl::OUString sFilter( m_sFilter ); - - OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_COMMAND ) >>= sCommand ); - OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_COMMANDTYPE ) >>= nCommandType ); - OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ESCAPEPROCESSING ) >>= bEscapeProcessing ); - OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_FILTER ) >>= sFilter ); - - if ( ( sCommand == m_aCommandName ) - && ( nCommandType == m_nCommandType ) - && ( bEscapeProcessing == m_bEscapeProcessing ) - && ( sFilter == m_sFilter ) - ) - return; - - m_aCommandName = sCommand; - m_nCommandType = nCommandType; - m_bEscapeProcessing = bEscapeProcessing; - m_sFilter = sFilter; - - // add the columns to the list - uno::Reference< sdbc::XConnection> xCon = getConnection(); - if ( xCon.is() && m_aCommandName.getLength() ) - m_xColumns = dbtools::getFieldsByCommandDescriptor( xCon, GetCommandType(), GetCommand(), m_xHoldAlive ); - if ( m_xColumns.is() ) + if ( m_xRowSet.is() ) { - lcl_addToList( *m_pListBox, m_xColumns->getElementNames() ); - uno::Reference< container::XContainer> xContainer(m_xColumns,uno::UNO_QUERY); - if ( xContainer.is() ) - m_pContainerListener = new ::comphelper::OContainerListenerAdapter(this,xContainer); + ::rtl::OUString sCommand( m_aCommandName ); + sal_Int32 nCommandType( m_nCommandType ); + sal_Bool bEscapeProcessing( m_bEscapeProcessing ); + ::rtl::OUString sFilter( m_sFilter ); + + OSL_VERIFY( m_xRowSet->getPropertyValue( PROPERTY_COMMAND ) >>= sCommand ); + OSL_VERIFY( m_xRowSet->getPropertyValue( PROPERTY_COMMANDTYPE ) >>= nCommandType ); + OSL_VERIFY( m_xRowSet->getPropertyValue( PROPERTY_ESCAPEPROCESSING ) >>= bEscapeProcessing ); + OSL_VERIFY( m_xRowSet->getPropertyValue( PROPERTY_FILTER ) >>= sFilter ); + + m_aCommandName = sCommand; + m_nCommandType = nCommandType; + m_bEscapeProcessing = bEscapeProcessing; + m_sFilter = sFilter; + + // add the columns to the list + uno::Reference< sdbc::XConnection> xCon = getConnection(); + if ( xCon.is() && m_aCommandName.getLength() ) + m_xColumns = dbtools::getFieldsByCommandDescriptor( xCon, GetCommandType(), GetCommand(), m_xHoldAlive ); + if ( m_xColumns.is() ) + { + lcl_addToList( *m_pListBox, m_xColumns->getElementNames() ); + uno::Reference< container::XContainer> xContainer(m_xColumns,uno::UNO_QUERY); + if ( xContainer.is() ) + m_pContainerListener = new ::comphelper::OContainerListenerAdapter(this,xContainer); + } + + // add the parameter columns to the list + uno::Reference< ::com::sun::star::sdbc::XRowSet > xRowSet(m_xRowSet,uno::UNO_QUERY); + Sequence< ::rtl::OUString > aParamNames( getParameterNames( xRowSet ) ); + lcl_addToList( *m_pListBox, aParamNames ); + + // set title + aTitle.AppendAscii(" "); + aTitle += m_aCommandName.getStr(); + SetText( aTitle ); + if ( m_aCommandName.getLength() ) + { + for (USHORT i = 0; i < nItemCount; ++i) + { + m_aActions.EnableItem(m_aActions.GetItemId(i)); + } + OnSelectHdl(NULL); + } } - - // add the parameter columns to the list - Sequence< ::rtl::OUString > aParamNames( getParameterNames( m_rController.getRowSet() ) ); - lcl_addToList( *m_pListBox, aParamNames ); - - // set title - aTitle.AppendAscii(" "); - aTitle += m_aCommandName.getStr(); - SetText( aTitle ); } catch( const Exception& ) { @@ -347,35 +354,41 @@ void OAddFieldWindow::Resize() { FloatingWindow::Resize(); - Point aPos(GetPosPixel()); - Size aSize( GetOutputSizePixel() ); + const Size aSize( GetOutputSizePixel() ); ////////////////////////////////////////////////////////////////////// + Size aToolbarSize( m_aActions.GetSizePixel() ); - // Groesse der form::ListBox anpassen - Point aLBPos( LISTBOX_BORDER, LISTBOX_BORDER ); + const Size aRelated(LogicToPixel( Size( RELATED_CONTROLS, RELATED_CONTROLS ), MAP_APPFONT )); + Point aPos( aRelated.Width(), aToolbarSize.Height() + 2*aRelated.Height()); + Point aToolbarPos( aPos.X(),aRelated.Height()); Size aLBSize( aSize ); - aLBSize.Width() -= (2*LISTBOX_BORDER); - aLBSize.Height() -= (2*LISTBOX_BORDER); + aLBSize.Width() -= (2*aRelated.Width()); + aLBSize.Height() -= (aRelated.Height() + aPos.Y() ); - m_pListBox->SetPosSizePixel( aLBPos, aLBSize ); + m_aActions.SetPosPixel(Point(aPos.X(),aToolbarPos.Y())); + m_pListBox->SetPosSizePixel( aPos, aLBSize ); } // ----------------------------------------------------------------------------- uno::Reference< sdbc::XConnection> OAddFieldWindow::getConnection() const { - return m_rController.getConnection(); + return uno::Reference< sdbc::XConnection>(m_xRowSet->getPropertyValue( PROPERTY_ACTIVECONNECTION ),uno::UNO_QUERY); } // ----------------------------------------------------------------------------- void OAddFieldWindow::fillDescriptor(SvLBoxEntry* _pSelected,::svx::ODataAccessDescriptor& _rDescriptor) { if ( _pSelected && m_xColumns.is() ) { - uno::Reference<sdb::XDocumentDataSource> xDocument( m_rController.getDataSource(), uno::UNO_QUERY ); - if ( xDocument.is() ) + uno::Reference<container::XChild> xChild(getConnection(),uno::UNO_QUERY); + if ( xChild.is( ) ) { - uno::Reference<frame::XModel> xModel(xDocument->getDatabaseDocument(),uno::UNO_QUERY); - if ( xModel.is() ) - _rDescriptor[ daDatabaseLocation ] <<= xModel->getURL(); + uno::Reference<sdb::XDocumentDataSource> xDocument( xChild->getParent(), uno::UNO_QUERY ); + if ( xDocument.is() ) + { + uno::Reference<frame::XModel> xModel(xDocument->getDatabaseDocument(),uno::UNO_QUERY); + if ( xModel.is() ) + _rDescriptor[ daDatabaseLocation ] <<= xModel->getURL(); + } // if ( xDocument.is() ) } _rDescriptor[ ::svx::daCommand ] <<= GetCommand(); @@ -413,6 +426,79 @@ void OAddFieldWindow::_elementRemoved( const container::ContainerEvent& /*_rEven void OAddFieldWindow::_elementReplaced( const container::ContainerEvent& /*_rEvent*/ ) throw(::com::sun::star::uno::RuntimeException) { } +// ----------------------------------------------------------------------------- +IMPL_LINK( OAddFieldWindow, OnSelectHdl, void* ,/*_pAddFieldDlg*/) +{ + m_aActions.EnableItem(SID_ADD_CONTROL_PAIR, ( m_pListBox.get() && m_pListBox->GetSelectionCount() > 0 )); + + return 0L; +} +// ----------------------------------------------------------------------------- +IMPL_LINK( OAddFieldWindow, OnDoubleClickHdl, void* ,/*_pAddFieldDlg*/) +{ + if ( m_aCreateLink.IsSet() ) + m_aCreateLink.Call(this); + + return 0L; +} +//------------------------------------------------------------------------------ +ImageList OAddFieldWindow::getImageList(sal_Int16 _eBitmapSet,sal_Bool _bHiContast) const +{ + sal_Int16 nN = IMG_ADDFIELD_DLG_SC; + sal_Int16 nH = IMG_ADDFIELD_DLG_SCH; + if ( _eBitmapSet == SFX_SYMBOLS_SIZE_LARGE ) + { + nN = IMG_ADDFIELD_DLG_LC; + nH = IMG_ADDFIELD_DLG_LCH; + } + return ImageList(ModuleRes( _bHiContast ? nH : nN )); +} +//------------------------------------------------------------------ +void OAddFieldWindow::resizeControls(const Size& _rDiff) +{ + // we use large images so we must change them + if ( _rDiff.Width() || _rDiff.Height() ) + { + Invalidate(); + } +} +//------------------------------------------------------------------ +IMPL_LINK( OAddFieldWindow, OnSortAction, ToolBox*, /*NOTINTERESTEDIN*/ ) +{ + const USHORT nCurItem = m_aActions.GetCurItemId(); + if ( SID_ADD_CONTROL_PAIR == nCurItem ) + OnDoubleClickHdl(NULL); + else + { + if ( SID_FM_REMOVE_FILTER_SORT == nCurItem || !m_aActions.IsItemChecked(nCurItem) ) + { + const USHORT nItemCount = m_aActions.GetItemCount(); + for (USHORT j = 0; j< nItemCount; ++j) + { + const USHORT nItemId = m_aActions.GetItemId(j); + if ( nCurItem != nItemId ) + m_aActions.CheckItem(nItemId,FALSE); + } + SvSortMode eSortMode = SortNone; + if ( SID_FM_REMOVE_FILTER_SORT != nCurItem ) + { + m_aActions.CheckItem(nCurItem,!m_aActions.IsItemChecked(nCurItem)); + if ( m_aActions.IsItemChecked(SID_FM_SORTUP) ) + eSortMode = SortAscending; + else if ( m_aActions.IsItemChecked(SID_FM_SORTDOWN) ) + eSortMode = SortDescending; + } // if ( SID_FM_REMOVE_FILTER_SORT != nCurItem ) + + m_pListBox->GetModel()->SetSortMode(eSortMode); + if ( SID_FM_REMOVE_FILTER_SORT == nCurItem ) + Update(); + + m_pListBox->GetModel()->Resort(); + } + } + return 0L; +} +// ----------------------------------------------------------------------------- // ============================================================================= } // namespace rptui // ============================================================================= diff --git a/reportdesign/source/ui/dlg/CondFormat.src b/reportdesign/source/ui/dlg/CondFormat.src index a81252ae3..2e8c28486 100644 --- a/reportdesign/source/ui/dlg/CondFormat.src +++ b/reportdesign/source/ui/dlg/CondFormat.src @@ -33,9 +33,7 @@ #ifndef _GLOBLMN_HRC #include <svx/globlmn.hrc> #endif -#ifndef _SBASLTID_HRC -#include <svx/svxids.hrc> -#endif +#include "rptui_slotid.hrc" Control WIN_CONDITION { @@ -347,3 +345,79 @@ ImageList 31000 IdCount = 1; }; +ToolBox RID_TB_SORTING +{ + Pos = MAP_APPFONT ( 0,0 ) ; + ButtonType = BUTTON_SYMBOL; + Align = BOXALIGN_TOP; + Customize = FALSE; + ItemList = + { + ToolBoxItem + { + Identifier = SID_FM_SORTUP; + Text [ en-US ] = "Sort Ascending" ; + Checkable = TRUE; + }; + ToolBoxItem + { + Identifier = SID_FM_SORTDOWN; + Text [ en-US ] = "Sort Descending" ; + Checkable = TRUE; + }; + ToolBoxItem + { + Identifier = SID_FM_REMOVE_FILTER_SORT; + Text [ en-US ] = "Remove sorting" ; + }; + ToolBoxItem + { + Type = TOOLBOXITEM_SEPARATOR; + }; + ToolBoxItem + { + Identifier = SID_ADD_CONTROL_PAIR; + Text [ en-US ] = "Insert" ; + }; + }; +}; +ImageList IMG_ADDFIELD_DLG_SC +{ + MASKCOLOR; + FileList = + { + < "res/commandimagelist/sc_sortup.png" ; SID_FM_SORTUP ; > ; + < "res/commandimagelist/sc_sortdown.png" ; SID_FM_SORTDOWN ; > ; + < "res/commandimagelist/sc_removefiltersort.png" ; SID_FM_REMOVE_FILTER_SORT ; > ; + }; +}; +ImageList IMG_ADDFIELD_DLG_SCH +{ + MASKCOLOR; + FileList = + { + < "res/commandimagelist/sch_sortup.png" ; SID_FM_SORTUP ; > ; + < "res/commandimagelist/sch_sortdown.png" ; SID_FM_SORTDOWN ; > ; + < "res/commandimagelist/sch_removefiltersort.png" ; SID_FM_REMOVE_FILTER_SORT ; > ; + }; +}; +ImageList IMG_ADDFIELD_DLG_LC +{ + MASKCOLOR; + FileList = + { + < "res/commandimagelist/lc_sortup.png" ; SID_FM_SORTUP ; > ; + < "res/commandimagelist/lc_sortdown.png" ; SID_FM_SORTDOWN ; > ; + < "res/commandimagelist/lc_removefiltersort.png" ; SID_FM_REMOVE_FILTER_SORT ; > ; + }; +}; +ImageList IMG_ADDFIELD_DLG_LCH +{ + MASKCOLOR; + FileList = + { + < "res/commandimagelist/lch_sortup.png" ; SID_FM_SORTUP ; > ; + < "res/commandimagelist/lch_sortdown.png" ; SID_FM_SORTDOWN ; > ; + < "res/commandimagelist/lch_removefiltersort.png" ; SID_FM_REMOVE_FILTER_SORT ; > ; + }; +}; diff --git a/reportdesign/source/ui/inc/AddField.hxx b/reportdesign/source/ui/inc/AddField.hxx index 8260dd80a..919e4d4f4 100644 --- a/reportdesign/source/ui/inc/AddField.hxx +++ b/reportdesign/source/ui/inc/AddField.hxx @@ -31,14 +31,19 @@ #ifndef RPTUI_ADDFIELDWINDOW_HXX #define RPTUI_ADDFIELDWINDOW_HXX +#include <com/sun/star/frame/XDispatch.hpp> +#include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/sdbc/XConnection.hpp> #include <svtools/svtreebx.hxx> +#include <svtools/transfer.hxx> #include <vcl/floatwin.hxx> #include <comphelper/propmultiplex.hxx> -#include <svtools/transfer.hxx> -#include "ReportController.hxx" +#include <comphelper/containermultiplexer.hxx> #include <svx/dataaccessdescriptor.hxx> #include "cppuhelper/basemutex.hxx" -#include <comphelper/containermultiplexer.hxx> +#include <dbaccess/ToolBoxHelper.hxx> +#include <vcl/toolbox.hxx> + #include <rtl/ref.hxx> namespace rptui @@ -51,11 +56,16 @@ class OAddFieldWindow :public FloatingWindow , public ::cppu::BaseMutex , public ::comphelper::OPropertyChangeListener , public ::comphelper::OContainerListener + , public dbaui::OToolBoxHelper { ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent> m_xHoldAlive; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> m_xColumns; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xRowSet; + + ToolBox m_aActions; ::std::auto_ptr<OAddFieldWindowListBox> m_pListBox; - ::rptui::OReportController& m_rController; + + Link m_aCreateLink; ::rtl::OUString m_aCommandName; ::rtl::OUString m_sFilter; sal_Int32 m_nCommandType; @@ -63,10 +73,15 @@ class OAddFieldWindow :public FloatingWindow ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> m_pChangeListener; ::rtl::Reference< comphelper::OContainerListenerAdapter> m_pContainerListener; + DECL_LINK( OnDoubleClickHdl, void* ); + DECL_LINK( OnSelectHdl, void* ); + DECL_LINK( OnSortAction, ToolBox* ); + OAddFieldWindow(const OAddFieldWindow&); void operator =(const OAddFieldWindow&); public: - OAddFieldWindow(::rptui::OReportController& _rController,Window* pParent); + OAddFieldWindow(Window* pParent + , const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xRowSet); virtual ~OAddFieldWindow(); virtual void Resize(); @@ -79,7 +94,19 @@ public: inline ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess> getColumns() const { return m_xColumns; } ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> getConnection() const; - sal_Bool createSelectionControls( ); + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > getSelectedFieldDescriptors(); + + /** will be called when the id of the image list is needed. + @param _eBitmapSet + <svtools/imgdef.hxx> + @param _bHiContast + <TRUE/> when in high contrast mode. + */ + virtual ImageList getImageList(sal_Int16 _eBitmapSet,sal_Bool _bHiContast) const; + + /** will be called when the controls need to be resized. + */ + virtual void resizeControls(const Size& _rDiff); /// Updates the current field list void Update(); @@ -91,6 +118,8 @@ public: */ void fillDescriptor(SvLBoxEntry* _pSelected,::svx::ODataAccessDescriptor& _rDescriptor); + inline void SetCreateHdl(const Link& _aCreateLink) { m_aCreateLink = _aCreateLink; } + private: // FmXChangeListener virtual void _propertyChanged(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw( ::com::sun::star::uno::RuntimeException ); diff --git a/reportdesign/source/ui/inc/GeometryHandler.hxx b/reportdesign/source/ui/inc/GeometryHandler.hxx index 0bc1aac27..a9c96fa25 100644 --- a/reportdesign/source/ui/inc/GeometryHandler.hxx +++ b/reportdesign/source/ui/inc/GeometryHandler.hxx @@ -162,12 +162,30 @@ namespace rptui */ void impl_fillFormulaList_nothrow(::std::vector< ::rtl::OUString >& _out_rList) const; - /**return all group names in a semicolon seperated list starting with the group where this control is contained in. + /** return all group names in a semicolon seperated list starting with the group where this control is contained in. * * \param _rList fills the list with all scope names. */ void impl_fillScopeList_nothrow(::std::vector< ::rtl::OUString >& _out_rList) const; + /** return all supported output formats of the report definition + * + * \param _rList fills the list with all mime types + */ + void impl_fillMimeTypes_nothrow(::std::vector< ::rtl::OUString >& _out_rList) const; + + /** return the one supported output formats of the report definition + * + * \param _sMimetype the mimetype + */ + ::rtl::OUString impl_ConvertMimeTypeToUI_nothrow(const ::rtl::OUString& _sMimetype) const; + + /** return the MimeType for the given UI Name + * + * \param _sUIName the doc ui name + */ + ::rtl::OUString impl_ConvertUIToMimeType_nothrow(const ::rtl::OUString& _sUIName) const; + /** get the functions supplier for the set scope, default is the surrounding group. * * \param _rsNamePostFix the name post fix which canbe used when the scope as name part is needed diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx index f63a22d0b..73945e7c5 100644 --- a/reportdesign/source/ui/inc/ReportController.hxx +++ b/reportdesign/source/ui/inc/ReportController.hxx @@ -77,6 +77,7 @@ namespace rptui class OPropertyMediator; class OReportModel; class OSectionView; + class OAddFieldWindow; typedef ::dbaui::OSingleDocumentController OReportController_BASE; typedef ::cppu::ImplHelper4 < ::com::sun::star::container::XContainerListener @@ -117,6 +118,7 @@ namespace rptui ::rtl::OUString m_sMode; /// the current mode of the controller sal_Int32 m_nSplitPos; /// the position of the splitter sal_Int32 m_nPageNum; /// the page number from the restoreView call + sal_Int32 m_nSelectionCount; sal_Int16 m_nZoomValue; SvxZoomType m_eZoomType; sal_Bool m_bShowRuler; @@ -128,7 +130,6 @@ namespace rptui bool m_bChartEnabled; bool m_bChartEnabledAsked; - /** creates a formatted field in the given section with the given formula as data field * * \param _aArgs @@ -317,6 +318,7 @@ namespace rptui DECL_LINK( NotifyUndoActionHdl, SfxUndoAction* ); DECL_LINK( EventLstHdl, VclWindowEvent* ); + DECL_LINK( OnCreateHdl, OAddFieldWindow*); DECLARE_XINTERFACE( ) DECLARE_XTYPEPROVIDER( ) diff --git a/reportdesign/source/ui/inc/SectionWindow.hxx b/reportdesign/source/ui/inc/SectionWindow.hxx index 07d534a4b..2369d851e 100644 --- a/reportdesign/source/ui/inc/SectionWindow.hxx +++ b/reportdesign/source/ui/inc/SectionWindow.hxx @@ -79,8 +79,19 @@ namespace rptui * \param _nResId * \param _pGetSection * \param _pIsSectionOn + * @return TRUE when title was set otherwise FALSE */ - void setGroupSectionTitle(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup,USHORT _nResId,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OGroupHelper> _pGetSection,::std::mem_fun_t<sal_Bool, OGroupHelper> _pIsSectionOn); + bool setGroupSectionTitle(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup,USHORT _nResId,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OGroupHelper> _pGetSection,::std::mem_fun_t<sal_Bool, OGroupHelper> _pIsSectionOn); + + /** set the title of the (report/page) header or footer + * + * \param _xGroup + * \param _nResId + * \param _pGetSection + * \param _pIsSectionOn + * @return TRUE when title was set otherwise FALSE + */ + bool setReportSectionTitle(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xReport,USHORT _nResId,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OReportHelper> _pGetSection,::std::mem_fun_t<sal_Bool, OReportHelper> _pIsSectionOn); void ImplInitSettings(); DECL_LINK(Collapsed,OStartMarker*); diff --git a/reportdesign/source/ui/inc/metadata.hxx b/reportdesign/source/ui/inc/metadata.hxx index db054c7da..54c24784b 100644 --- a/reportdesign/source/ui/inc/metadata.hxx +++ b/reportdesign/source/ui/inc/metadata.hxx @@ -150,6 +150,7 @@ namespace rptui #define PROPERTY_ID_DETAILFIELDS 36 #define PROPERTY_ID_PREVIEW_COUNT 37 #define PROPERTY_ID_AREA 38 + #define PROPERTY_ID_MIMETYPE 39 //............................................................................ } // namespace rptui diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index edf065903..5a270f1b2 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -33,15 +33,18 @@ #include <comphelper/sequence.hxx> #include <comphelper/types.hxx> #include <comphelper/property.hxx> +#include <comphelper/mimeconfighelper.hxx> #include "uistrings.hrc" #include "reportformula.hxx" #include <unotools/textsearch.hxx> +#include <unotools/configmgr.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <svtools/syslocale.hxx> #include <tools/diagnose_ex.h> +#include <tools/StringListResource.hxx> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/drawing/FillStyle.hpp> #include "com/sun/star/inspection/StringRepresentation.hpp" @@ -109,6 +112,8 @@ #include <svx/drawitem.hxx> #define ITEMID_BRUSH SID_ATTR_BRUSH #include <svx/brshitem.hxx> +#include <sfx2/docfilt.hxx> + #include "dlgpage.hxx" #include "helpids.hrc" #include <toolkit/helper/convert.hxx> @@ -479,6 +484,13 @@ uno::Any SAL_CALL GeometryHandler::getPropertyValue(const ::rtl::OUString & Prop } } break; + case PROPERTY_ID_MIMETYPE: + { + ::rtl::OUString sValue; + m_xReportComponent->getPropertyValue( PropertyName ) >>= sValue; + aPropertyValue <<= impl_ConvertMimeTypeToUI_nothrow(sValue); + } + break; default: aPropertyValue = m_xReportComponent->getPropertyValue( PropertyName ); break; @@ -685,6 +697,12 @@ void SAL_CALL GeometryHandler::setPropertyValue(const ::rtl::OUString & Property bHandled = true; } break; + case PROPERTY_ID_MIMETYPE: + { + ::rtl::OUString sValue; + Value >>= sValue; + aNewValue <<= impl_ConvertUIToMimeType_nothrow(sValue); + } default: break; } @@ -708,12 +726,9 @@ void GeometryHandler::implCreateListLikeControl( ,sal_Bool _bTrueIfListBoxFalseIfComboBox ) { - const String sEntries = String( ModuleRes( _nResId ) ); - const xub_StrLen nCount = sEntries.GetTokenCount(); ::std::vector< ::rtl::OUString > aList; - for ( xub_StrLen i=0; i < nCount; ++i ) - aList.push_back(sEntries.GetToken(i)); - + tools::StringListResource aRes(ModuleRes(_nResId),aList); + implCreateListLikeControl(_rxControlFactory,out_Descriptor,aList,_bReadOnlyControl,_bTrueIfListBoxFalseIfComboBox); } // ----------------------------------------------------------------------------- @@ -768,6 +783,13 @@ inspection::LineDescriptor SAL_CALL GeometryHandler::describePropertyLine(const implCreateListLikeControl(_xControlFactory,aOut,aList,sal_False,sal_True); } break; + case PROPERTY_ID_MIMETYPE: + { + ::std::vector< ::rtl::OUString > aList; + impl_fillMimeTypes_nothrow(aList); + implCreateListLikeControl(_xControlFactory,aOut,aList,sal_False,sal_True); + } + break; case PROPERTY_ID_TYPE: implCreateListLikeControl(_xControlFactory,aOut,RID_STR_TYPE_CONST,sal_False,sal_True); break; @@ -926,18 +948,14 @@ beans::Property GeometryHandler::getProperty(const ::rtl::OUString & PropertyNam return beans::Property(); return *pFind; } -uno::Any GeometryHandler::getConstantValue(sal_Bool _bToControlValue,sal_uInt16 nResId,const uno::Any& _aValue,const ::rtl::OUString& _sConstantName,const ::rtl::OUString & PropertyName ) +uno::Any GeometryHandler::getConstantValue(sal_Bool _bToControlValue,sal_uInt16 _nResId,const uno::Any& _aValue,const ::rtl::OUString& _sConstantName,const ::rtl::OUString & PropertyName ) { - const String sConstantValues = String(ModuleRes(nResId)); + ::std::vector< ::rtl::OUString > aList; + tools::StringListResource aRes(ModuleRes(_nResId),aList); + uno::Sequence< ::rtl::OUString > aSeq(aList.size()); + ::std::copy( aList.begin(), aList.end(), aSeq.getArray() ); - const xub_StrLen nCount = sConstantValues.GetTokenCount(); - uno::Sequence< ::rtl::OUString > aSeq(nCount); - for (xub_StrLen i = 0; i < nCount; ++i) - { - aSeq[i] = sConstantValues.GetToken(i); - } - uno::Reference< inspection::XStringRepresentation > xConversionHelper = inspection::StringRepresentation::createConstant( m_xContext,m_xTypeConverter - ,_sConstantName,aSeq); + uno::Reference< inspection::XStringRepresentation > xConversionHelper = inspection::StringRepresentation::createConstant( m_xContext,m_xTypeConverter,_sConstantName,aSeq); if ( _bToControlValue ) { return uno::makeAny( xConversionHelper->convertToControlValue( _aValue ) ); @@ -1071,18 +1089,16 @@ uno::Any SAL_CALL GeometryHandler::convertToPropertyValue(const ::rtl::OUString { ::rtl::OUString sValue; _rControlValue >>= sValue; - const String sConstantValues = String(ModuleRes(RID_STR_TYPE_CONST)); - const xub_StrLen nCount = sConstantValues.GetTokenCount(); - for (xub_StrLen i = 0; i < nCount; ++i) - { - if ( sConstantValues.GetToken(i) == String(sValue) ) - { - aPropertyValue <<= static_cast<sal_uInt32>(i); - break; - } - } + ::std::vector< ::rtl::OUString > aList; + tools::StringListResource aRes(ModuleRes(RID_STR_TYPE_CONST),aList); + ::std::vector< ::rtl::OUString >::iterator aFind = ::std::find(aList.begin(),aList.end(),sValue); + if ( aFind != aList.end() ) + aPropertyValue <<= static_cast<sal_uInt32>(aFind - aList.begin()); } break; + case PROPERTY_ID_MIMETYPE: + aPropertyValue = _rControlValue; + break; default: return m_xFormComponentHandler->convertToPropertyValue(PropertyName, _rControlValue); } @@ -1189,14 +1205,15 @@ uno::Any SAL_CALL GeometryHandler::convertToControlValue(const ::rtl::OUString & case PROPERTY_ID_SCOPE: aControlValue <<= m_sScope; break; + case PROPERTY_ID_MIMETYPE: + aControlValue = aPropertyValue; + break; case PROPERTY_ID_TYPE: { - const String sConstantValues = String(ModuleRes(RID_STR_TYPE_CONST)); - const xub_StrLen nCount = sConstantValues.GetTokenCount(); - if ( m_nDataFieldType < nCount ) - { - aControlValue <<= ::rtl::OUString(sConstantValues.GetToken(static_cast<xub_StrLen>(m_nDataFieldType))); - } + ::std::vector< ::rtl::OUString > aList; + tools::StringListResource aRes(ModuleRes(RID_STR_TYPE_CONST),aList); + if ( m_nDataFieldType < aList.size() ) + aControlValue <<= aList[m_nDataFieldType]; } break; case PROPERTY_ID_BACKCOLOR: @@ -1265,6 +1282,7 @@ uno::Sequence< beans::Property > SAL_CALL GeometryHandler::getSupportedPropertie ,PROPERTY_CONTROLBACKGROUND ,PROPERTY_CONTROLBACKGROUNDTRANSPARENT ,PROPERTY_LABEL + ,PROPERTY_MIMETYPE }; const uno::Reference < beans::XPropertySetInfo > xInfo = m_xReportComponent->getPropertySetInfo(); const uno::Sequence< beans::Property> aSeq = xInfo->getProperties(); @@ -1612,6 +1630,62 @@ void GeometryHandler::impl_fillFormulaList_nothrow(::std::vector< ::rtl::OUStrin ::std::transform(m_aFunctionNames.begin(),m_aFunctionNames.end(),::std::back_inserter(_out_rList),::std::select1st<TFunctions::value_type>()); } // ----------------------------------------------------------------------------- +::rtl::OUString GeometryHandler::impl_ConvertUIToMimeType_nothrow(const ::rtl::OUString& _sUIName) const +{ + ::std::vector< ::rtl::OUString > aList; + impl_fillMimeTypes_nothrow(aList); + ::rtl::OUString sRet; + ::std::vector< ::rtl::OUString >::const_iterator aFind = ::std::find(aList.begin(),aList.end(),_sUIName); + if ( aFind != aList.end() ) + { + const sal_Size nPos = aFind - aList.begin(); + const uno::Reference< report::XReportDefinition> xReportDefinition(m_xReportComponent,uno::UNO_QUERY); + if ( xReportDefinition.is() ) + { + const uno::Sequence< ::rtl::OUString > aMimeTypes( xReportDefinition->getAvailableMimeTypes() ); + sRet = aMimeTypes[nPos]; + } + } // if ( aFind != aList.end() ) + return sRet; +} +// ----------------------------------------------------------------------------- +::rtl::OUString GeometryHandler::impl_ConvertMimeTypeToUI_nothrow(const ::rtl::OUString& _sMimetype) const +{ + uno::Reference<lang::XMultiServiceFactory> xServiceFactory(m_xContext->getServiceManager(),uno::UNO_QUERY_THROW); + ::comphelper::MimeConfigurationHelper aMimeHelper(xServiceFactory); + ::rtl::OUString sRet; + const SfxFilter* pFilter = SfxFilter::GetDefaultFilter( aMimeHelper.GetDocServiceNameFromMediaType(_sMimetype) ); + if ( pFilter ) + sRet = pFilter->GetUIName(); + if ( !sRet.getLength() ) + sRet = _sMimetype; + return sRet; +} +// ----------------------------------------------------------------------------- +void GeometryHandler::impl_fillMimeTypes_nothrow(::std::vector< ::rtl::OUString >& _out_rList) const +{ + try + { + const uno::Reference< report::XReportDefinition> xReportDefinition(m_xReportComponent,uno::UNO_QUERY); + if ( xReportDefinition.is() ) + { + uno::Sequence< ::rtl::OUString > aMimeTypes( xReportDefinition->getAvailableMimeTypes() ); + const ::rtl::OUString* pIter = aMimeTypes.getConstArray(); + const ::rtl::OUString* pEnd = pIter + aMimeTypes.getLength(); + for(;pIter != pEnd; ++pIter) + { + const ::rtl::OUString sDocName( impl_ConvertMimeTypeToUI_nothrow(*pIter) ); + if ( sDocName.getLength() ) + _out_rList.push_back(sDocName); + } + } + } + catch(uno::Exception&) + { + OSL_ENSURE(0,"Exception caught!"); + } +} +// ----------------------------------------------------------------------------- void GeometryHandler::impl_fillScopeList_nothrow(::std::vector< ::rtl::OUString >& _out_rList) const { try diff --git a/reportdesign/source/ui/inspection/inspection.src b/reportdesign/source/ui/inspection/inspection.src index b853b162b..dc2b4a09b 100644 --- a/reportdesign/source/ui/inspection/inspection.src +++ b/reportdesign/source/ui/inspection/inspection.src @@ -46,18 +46,39 @@ String RID_STR_PROPPAGE_DATA Text [ en-US ] = "Data" ; Text [ x-comment ] = " "; }; -String RID_STR_BOOL +Resource RID_STR_BOOL { - Text [ en-US ] = "No;Yes" ; - Text [ x-comment ] = " "; + String 1 + { + Text [ en-US ] = "No" ; + }; + String 2 + { + Text [ en-US ] = "Yes" ; + }; }; String RID_STR_FORCENEWPAGE { Text [ en-US ] = "Force New Page" ; }; -String RID_STR_FORCENEWPAGE_CONST -{ - Text [ en-US ] = "None;Before Section;After Section;Before & After Section" ; +Resource RID_STR_FORCENEWPAGE_CONST +{ + String 1 + { + Text [ en-US ] = "None" ; + }; + String 2 + { + Text [ en-US ] = "Before Section" ; + }; + String 3 + { + Text [ en-US ] = "After Section" ; + }; + String 4 + { + Text [ en-US ] = "Before & After Section" ; + }; }; String RID_STR_NONE { @@ -72,9 +93,20 @@ String RID_STR_KEEPTOGETHER { Text [ en-US ] = "Keep Together" ; }; -String RID_STR_KEEPTOGETHER_CONST -{ - Text [ en-US ] = "No;Whole Group;With First Detail" ; +Resource RID_STR_KEEPTOGETHER_CONST +{ + String 1 + { + Text [ en-US ] = "No" ; + }; + String 2 + { + Text [ en-US ] = "Whole Group" ; + }; + String 3 + { + Text [ en-US ] = "With First Detail" ; + }; }; String RID_STR_CANGROW { @@ -124,13 +156,31 @@ String RID_STR_GROUPKEEPTOGETHER { Text [ en-US ] = "Group keep together" ; }; -String RID_STR_GROUPKEEPTOGETHER_CONST -{ - Text [ en-US ] = "Per Page;Per Column" ; -}; -String RID_STR_SECTIONPAGEBREAK_CONST -{ - Text [ en-US ] = "None;Section;Automatic" ; +Resource RID_STR_GROUPKEEPTOGETHER_CONST +{ + String 1 + { + Text [ en-US ] = "Per Page" ; + }; + String 2 + { + Text [ en-US ] = "Per Column" ; + }; +}; +Resource RID_STR_SECTIONPAGEBREAK_CONST +{ + String 1 + { + Text [ en-US ] = "None" ; + }; + String 2 + { + Text [ en-US ] = "Section" ; + }; + String 3 + { + Text [ en-US ] = "Automatic" ; + }; }; String RID_STR_PAGEHEADEROPTION { @@ -140,9 +190,24 @@ String RID_STR_PAGEFOOTEROPTION { Text [ en-US ] = "Page footer" ; }; -String RID_STR_REPORTPRINTOPTION_CONST -{ - Text [ en-US ] = "All Pages;Not With Report Header;Not With Report Footer;Not With Report Header/Footer" ; +Resource RID_STR_REPORTPRINTOPTION_CONST +{ + String 1 + { + Text [ en-US ] = "All Pages" ; + }; + String 2 + { + Text [ en-US ] = "Not With Report Header" ; + }; + String 3 + { + Text [ en-US ] = "Not With Report Footer" ; + }; + String 4 + { + Text [ en-US ] = "Not With Report Header/Footer" ; + }; }; String RID_STR_DEEPTRAVERSING { @@ -224,9 +289,24 @@ String RID_STR_TYPE { Text [ en-US ] = "Data Field Type"; }; -String RID_STR_TYPE_CONST -{ - Text [ en-US ] = "Field or Formula;Function;Counter;User defined Function"; +Resource RID_STR_TYPE_CONST +{ + String 1 + { + Text [ en-US ] = "Field or Formula"; + }; + String 2 + { + Text [ en-US ] = "Function"; + }; + String 3 + { + Text [ en-US ] = "Counter"; + }; + String 4 + { + Text [ en-US ] = "User defined Function"; + }; }; String RID_STR_MASTERFIELDS { @@ -257,3 +337,7 @@ String RID_STR_AREA { Text [ en-US ] = "Area" ; }; +String RID_STR_MIMETYPE +{ + Text [ en-US ] = "Report Output Format" ; +}; diff --git a/reportdesign/source/ui/inspection/metadata.cxx b/reportdesign/source/ui/inspection/metadata.cxx index acfc8a38e..632752084 100644 --- a/reportdesign/source/ui/inspection/metadata.cxx +++ b/reportdesign/source/ui/inspection/metadata.cxx @@ -176,6 +176,7 @@ namespace rptui ,DEF_INFO_2( MASTERFIELDS, MASTERFIELDS, MASTERFIELDS, COMPOSEABLE,DATA_PROPERTY ) ,DEF_INFO_2( DETAILFIELDS, DETAILFIELDS, DETAILFIELDS, COMPOSEABLE,DATA_PROPERTY) ,DEF_INFO_1( AREA, AREA, AREA, COMPOSEABLE ) + ,DEF_INFO_2( MIMETYPE, MIMETYPE, MIMETYPE, COMPOSEABLE,DATA_PROPERTY ) }; s_pPropertyInfos = aPropertyInfos; diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx index 6d83a2317..48f19a52b 100644 --- a/reportdesign/source/ui/report/DesignView.cxx +++ b/reportdesign/source/ui/report/DesignView.cxx @@ -600,13 +600,16 @@ void ODesignView::toggleAddField() uno::Reference< report::XSection > xSection = m_pCurrentView->getReportSection()->getSection(); xReport = xSection->getReportDefinition(); } - m_pAddField = new OAddFieldWindow(rReportController,this); + uno::Reference < beans::XPropertySet > xSet(rReportController.getRowSet(),uno::UNO_QUERY);
+ m_pAddField = new OAddFieldWindow(this,xSet);
+ m_pAddField->SetCreateHdl(LINK( &rReportController, OReportController, OnCreateHdl ) ); SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( UID_RPT_RPT_APP_VIEW ) );
if ( aDlgOpt.Exists() )
m_pAddField->SetWindowState( ByteString( aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US ) );
m_pAddField->Update(); m_pAddField->AddEventListener(LINK(&rReportController,OReportController,EventLstHdl)); notifySystemWindow(this,m_pAddField,::comphelper::mem_fun(&TaskPaneList::AddWindow)); + m_pAddField->Show(); } else m_pAddField->Show(!m_pAddField->IsVisible()); diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 591ebebe5..c79f05475 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -50,6 +50,7 @@ #include "ReportDefinition.hxx" #include "CondFormat.hxx" #include "UITools.hxx" +#include "AddField.hxx" #include <toolkit/helper/vclunohelper.hxx> #include "DateTime.hxx" #include <svtools/syslocale.hxx> @@ -84,6 +85,8 @@ #include <com/sun/star/awt/FontDescriptor.hpp> #include <com/sun/star/sdb/XDocumentDataSource.hpp> #include <com/sun/star/sdb/XParametersSupplier.hpp> +#include <com/sun/star/sdb/CommandType.hpp> +#include <com/sun/star/sdbcx/XTablesSupplier.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> #include <com/sun/star/embed/ElementModes.hpp> #include <comphelper/streamsection.hxx> @@ -290,6 +293,7 @@ OReportController::OReportController(Reference< XComponentContext > const & xCon ,m_xContext(xContext) ,m_nSplitPos(-1) ,m_nPageNum(-1) +,m_nSelectionCount(0) ,m_nZoomValue(100) ,m_eZoomType(SVX_ZOOM_PERCENT) ,m_bShowRuler(sal_True) @@ -427,7 +431,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const aReturn.bEnabled = isEditable(); break; case SID_ADD_CONTROL_PAIR: - aReturn.bEnabled = isEditable() && m_pMyOwnView->getMarkedSection().get() != NULL; + aReturn.bEnabled = isEditable(); break; case SID_REDO: case SID_UNDO: @@ -439,9 +443,9 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const case SID_OBJECT_SMALLESTHEIGHT: case SID_OBJECT_GREATESTWIDTH: case SID_OBJECT_GREATESTHEIGHT: - aReturn.bEnabled = isEditable() && m_pMyOwnView->HasSelection() && m_pMyOwnView->isAlignPossible(); + aReturn.bEnabled = isEditable() && m_pMyOwnView->HasSelection();// && m_pMyOwnView->isAlignPossible(); if ( aReturn.bEnabled ) - aReturn.bEnabled = m_pMyOwnView->getMarkedObjectCount() > 1; + aReturn.bEnabled = m_nSelectionCount > 1; break; case SID_DISTRIBUTION: @@ -501,7 +505,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const case SID_SECTION_ALIGN_UP: case SID_SECTION_ALIGN_MIDDLE: case SID_SECTION_ALIGN_DOWN: - aReturn.bEnabled = isEditable() && m_pMyOwnView->HasSelection() && m_pMyOwnView->isAlignPossible(); + aReturn.bEnabled = isEditable() && m_pMyOwnView->HasSelection();// && m_pMyOwnView->isAlignPossible(); break; case SID_CUT: aReturn.bEnabled = isEditable() && m_pMyOwnView->HasSelection() && !m_pMyOwnView->isHandleEvent(_nId); @@ -1657,6 +1661,18 @@ void OReportController::impl_initialize( ) m_xFormatter.set(getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatter"))), UNO_QUERY); m_xFormatter->attachNumberFormatsSupplier(Reference< XNumberFormatsSupplier>(m_xReportDefinition,uno::UNO_QUERY)); + if ( !m_xReportDefinition->getCommand().getLength() && getConnection().is()) + { + uno::Reference<sdbcx::XTablesSupplier> xTablesSup(getConnection(),uno::UNO_QUERY_THROW); + uno::Reference<container::XNameAccess> xTables = xTablesSup->getTables(); + const uno::Sequence< ::rtl::OUString > aNames( xTables->getElementNames() ); + + if ( aNames.hasElements() ) + { + m_xReportDefinition->setCommand(aNames[0]); + m_xReportDefinition->setCommandType(sdb::CommandType::TABLE); + } + } } // if ( m_xReportDefinition.is() ) @@ -1696,7 +1712,7 @@ void OReportController::impl_initialize( ) m_pMyOwnView->setCurrentPage(m_sLastActivePage); uno::Sequence< beans::PropertyValue> aArgs; executeUnChecked(SID_SELECT_REPORT,aArgs); - } + } // if ( m_bShowProperties && m_nPageNum == -1 ) setModified(sal_False); // and we are not modified yet @@ -1716,6 +1732,18 @@ IMPL_LINK( OReportController, OnOpenHelpAgent, void* ,/*_pMemfun*/) doOpenHelpAgent(); return 0L; } +// -----------------------------------------------------------------------------
+IMPL_LINK( OReportController, OnCreateHdl, OAddFieldWindow* ,_pAddFieldDlg)
+{
+ WaitObject aObj(m_pMyOwnView);
+ uno::Sequence< beans::PropertyValue > aArgs = _pAddFieldDlg->getSelectedFieldDescriptors();
+ // we use this way to create undo actions
+ if ( aArgs.getLength() )
+ {
+ executeChecked(SID_ADD_CONTROL_PAIR,aArgs);
+ }
+ return 0L;
+} // ----------------------------------------------------------------------------- void OReportController::doOpenHelpAgent() @@ -2469,7 +2497,12 @@ void OReportController::Notify(SfxBroadcaster & /*rBc*/, SfxHint const & rHint) && (static_cast< DlgEdHint const & >(rHint).GetKind() == RPTUI_HINT_SELECTIONCHANGED)) { - InvalidateAll(); + const sal_Int32 nSelectionCount = m_pMyOwnView->getMarkedObjectCount(); + if ( m_nSelectionCount != nSelectionCount ) + { + m_nSelectionCount = nSelectionCount; + InvalidateAll(); + } lang::EventObject aEvent(*this); m_aSelectionListeners.forEach<view::XSelectionChangeListener>( ::boost::bind(&view::XSelectionChangeListener::selectionChanged,_1,boost::cref(aEvent))); @@ -3086,7 +3119,12 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) pSectionWindow[0] = m_pMyOwnView->getMarkedSection(); if ( !pSectionWindow[0] ) - return; + {
+ select(uno::makeAny(m_xReportDefinition->getDetail()));
+ pSectionWindow[0] = m_pMyOwnView->getMarkedSection();
+ if ( !pSectionWindow[0] )
+ return;
+ } uno::Reference<report::XSection> xCurrentSection = m_pMyOwnView->getCurrentSection(); UndoManagerListAction aUndo( *getUndoMgr(), String( ModuleRes( RID_STR_UNDO_INSERT_CONTROL ) ) ); @@ -3928,8 +3966,7 @@ bool OReportController::impl_setPropertyAtControls_throw(const sal_uInt16 _nUndo void OReportController::impl_fillCustomShapeState_nothrow(const char* _pCustomShapeType,dbaui::FeatureState& _rState) const { _rState.bEnabled = isEditable(); - const rtl::OUString sShapeType = m_pMyOwnView->GetInsertObjString(); - _rState.bChecked = m_pMyOwnView->GetInsertObj() == OBJ_CUSTOMSHAPE && sShapeType.compareToAscii(_pCustomShapeType) == 0; + _rState.bChecked = m_pMyOwnView->GetInsertObj() == OBJ_CUSTOMSHAPE && m_pMyOwnView->GetInsertObjString().compareToAscii(_pCustomShapeType) == 0; } // ----------------------------------------------------------------------------- void OReportController::openZoomDialog() diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index c65c2fd24..4c218c9cf 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -600,10 +600,15 @@ void OReportSection::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) { xReportComponent->setPosition(aPos); correctOverlapping(pObject,*this,false); + Rectangle aRet(VCLPoint(xReportComponent->getPosition()),VCLSize(xReportComponent->getSize())); + aRet.setHeight(aRet.getHeight() + 1); + aRet.setWidth(aRet.getWidth() + 1); + if ( m_xSection.is() && (static_cast<sal_uInt32>(aRet.getHeight() + aRet.Top()) > m_xSection->getHeight()) ) + m_xSection->setHeight(aRet.getHeight() + aRet.Top()); } pBase->StartListening(); } - } + } // for (sal_Int32 i = 0; i < nCount; ++i) } catch(uno::Exception) { @@ -772,7 +777,8 @@ sal_Int8 OReportSection::AcceptDrop( const AcceptDropEvent& _rEvt ) else { const DataFlavorExVector& rFlavors = GetDataFlavorExVector(); - if ( ::svx::OColumnTransferable::canExtractColumnDescriptor(rFlavors, CTF_FIELD_DESCRIPTOR | CTF_CONTROL_EXCHANGE | CTF_COLUMN_DESCRIPTOR) ) + if ( ::svx::OMultiColumnTransferable::canExtractDescriptor(rFlavors) + || ::svx::OColumnTransferable::canExtractColumnDescriptor(rFlavors, CTF_FIELD_DESCRIPTOR | CTF_CONTROL_EXCHANGE | CTF_COLUMN_DESCRIPTOR) ) return _rEvt.mnAction; const sal_Int8 nDropOption = ( OReportExchange::canExtract(rFlavors) ) ? DND_ACTION_COPYMOVE : DND_ACTION_NONE; @@ -794,6 +800,7 @@ sal_Int8 OReportSection::ExecuteDrop( const ExecuteDropEvent& _rEvt ) sal_Int8 nDropOption = DND_ACTION_NONE; const TransferableDataHelper aDropped(_rEvt.maDropEvent.Transferable); DataFlavorExVector& rFlavors = aDropped.GetDataFlavorExVector(); + bool bMultipleFormat = ::svx::OMultiColumnTransferable::canExtractDescriptor(rFlavors); if ( OReportExchange::canExtract(rFlavors) ) { OReportExchange::TSectionElements aCopies = OReportExchange::extractCopies(aDropped); @@ -803,7 +810,8 @@ sal_Int8 OReportSection::ExecuteDrop( const ExecuteDropEvent& _rEvt ) m_pParent->getViewsWindow()->unmarkAllObjects(m_pView); //m_pParent->getViewsWindow()->getView()->setMarked(m_pView,sal_True); } // if ( OReportExchange::canExtract(rFlavors) ) - else if ( ::svx::OColumnTransferable::canExtractColumnDescriptor(rFlavors, CTF_FIELD_DESCRIPTOR | CTF_CONTROL_EXCHANGE | CTF_COLUMN_DESCRIPTOR) ) + else if ( bMultipleFormat + || ::svx::OColumnTransferable::canExtractColumnDescriptor(rFlavors, CTF_FIELD_DESCRIPTOR | CTF_CONTROL_EXCHANGE | CTF_COLUMN_DESCRIPTOR) ) { m_pParent->getViewsWindow()->getView()->setMarked(m_pView,sal_True); m_pView->UnmarkAll(); @@ -816,21 +824,41 @@ sal_Int8 OReportSection::ExecuteDrop( const ExecuteDropEvent& _rEvt ) if ( aDropPos.Y() > rRect.Bottom() ) aDropPos.Y() = rRect.Bottom(); - ::svx::ODataAccessDescriptor aDescriptor = ::svx::OColumnTransferable::extractColumnDescriptor(aDropped); + uno::Sequence<beans::PropertyValue> aValues; + if ( !bMultipleFormat ) + { + ::svx::ODataAccessDescriptor aDescriptor = ::svx::OColumnTransferable::extractColumnDescriptor(aDropped); + + aValues.realloc(1); + aValues[0].Value <<= aDescriptor.createPropertyValueSequence(); + } // if ( !bMultipleFormat ) + else + aValues = ::svx::OMultiColumnTransferable::extractDescriptor(aDropped); + + beans::PropertyValue* pIter = aValues.getArray(); + beans::PropertyValue* pEnd = pIter + aValues.getLength(); + for(;pIter != pEnd; ++pIter) + { + uno::Sequence<beans::PropertyValue> aCurrent; + pIter->Value >>= aCurrent; + sal_Int32 nLength = aCurrent.getLength(); + if ( nLength ) + { + aCurrent.realloc(nLength + 3); + aCurrent[nLength].Name = PROPERTY_POSITION; + aCurrent[nLength++].Value <<= AWTPoint(aDropPos); + // give also the DND Action (Shift|Ctrl) Key to really say what we want + aCurrent[nLength].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DNDAction")); + aCurrent[nLength++].Value <<= _rEvt.mnAction; + + aCurrent[nLength].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Section")); + aCurrent[nLength++].Value <<= getSection(); + pIter->Value <<= aCurrent; + } + } + // we use this way to create undo actions OReportController& rController = m_pParent->getViewsWindow()->getView()->getReportView()->getController(); - uno::Sequence<beans::PropertyValue> aValues( aDescriptor.createPropertyValueSequence() ); - sal_Int32 nLength = aValues.getLength(); - aValues.realloc(nLength + 3); - aValues[nLength].Name = PROPERTY_POSITION; - aValues[nLength++].Value <<= AWTPoint(aDropPos); - // give also the DND Action (Shift|Ctrl) Key to really say what we want - aValues[nLength].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DNDAction")); - aValues[nLength++].Value <<= _rEvt.mnAction; - - aValues[nLength].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Section")); - aValues[nLength++].Value <<= getSection(); - rController.executeChecked(SID_ADD_CONTROL_PAIR,aValues); nDropOption = DND_ACTION_COPY; } diff --git a/reportdesign/source/ui/report/SectionView.cxx b/reportdesign/source/ui/report/SectionView.cxx index 300cb9ef0..b3e8047fa 100644 --- a/reportdesign/source/ui/report/SectionView.cxx +++ b/reportdesign/source/ui/report/SectionView.cxx @@ -75,7 +75,7 @@ void OSectionView::MarkListHasChanged() DBG_CHKTHIS( rpt_OSectionView,NULL); SdrView::MarkListHasChanged(); - if ( m_pReportWindow ) + if ( m_pReportWindow && m_pSectionWindow && !m_pSectionWindow->getPage()->getSpecialMode() ) { //m_pReportWindow->unmarkAllObjects(this); // WHY DlgEdHint aHint( RPTUI_HINT_SELECTIONCHANGED ); diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx index d133b649b..14fb2731f 100644 --- a/reportdesign/source/ui/report/SectionWindow.cxx +++ b/reportdesign/source/ui/report/SectionWindow.cxx @@ -151,8 +151,18 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) } else if ( _rEvent.PropertyName.equals(PROPERTY_NAME) && !xSection->getGroup().is() ) { - m_aStartMarker.setTitle(xSection->getName()); - m_aStartMarker.Invalidate(INVALIDATE_NOERASE); + uno::Reference< report::XReportDefinition > xReport = xSection->getReportDefinition(); + if ( setReportSectionTitle(xReport,RID_STR_REPORT_HEADER,::std::mem_fun(&OReportHelper::getReportHeader),::std::mem_fun(&OReportHelper::getReportHeaderOn)) + || setReportSectionTitle(xReport,RID_STR_REPORT_FOOTER,::std::mem_fun(&OReportHelper::getReportFooter),::std::mem_fun(&OReportHelper::getReportFooterOn)) + || setReportSectionTitle(xReport,RID_STR_PAGE_HEADER,::std::mem_fun(&OReportHelper::getPageHeader),::std::mem_fun(&OReportHelper::getPageHeaderOn)) + || setReportSectionTitle(xReport,RID_STR_PAGE_FOOTER,::std::mem_fun(&OReportHelper::getPageFooter),::std::mem_fun(&OReportHelper::getPageFooterOn)) ) + m_aStartMarker.Invalidate(INVALIDATE_NOERASE); + else + { + String sTitle = String(ModuleRes(RID_STR_DETAIL)); + m_aStartMarker.setTitle(sTitle); + m_aStartMarker.Invalidate(INVALIDATE_CHILDREN); + } } } // if ( xSection.is() ) else if ( _rEvent.PropertyName.equals(PROPERTY_EXPRESSION) ) @@ -160,23 +170,37 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) uno::Reference< report::XGroup > xGroup(_rEvent.Source,uno::UNO_QUERY); if ( xGroup.is() ) { - setGroupSectionTitle(xGroup,RID_STR_HEADER,::std::mem_fun(&OGroupHelper::getHeader),::std::mem_fun(&OGroupHelper::getHeaderOn)); - setGroupSectionTitle(xGroup,RID_STR_FOOTER,::std::mem_fun(&OGroupHelper::getFooter),::std::mem_fun(&OGroupHelper::getFooterOn)); + if ( !setGroupSectionTitle(xGroup,RID_STR_HEADER,::std::mem_fun(&OGroupHelper::getHeader),::std::mem_fun(&OGroupHelper::getHeaderOn)) ) + setGroupSectionTitle(xGroup,RID_STR_FOOTER,::std::mem_fun(&OGroupHelper::getFooter),::std::mem_fun(&OGroupHelper::getFooterOn)); } } } // ----------------------------------------------------------------------------- -void OSectionWindow::setGroupSectionTitle(const uno::Reference< report::XGroup>& _xGroup,USHORT _nResId,::std::mem_fun_t<uno::Reference<report::XSection> , OGroupHelper> _pGetSection,::std::mem_fun_t<sal_Bool,OGroupHelper> _pIsSectionOn) +bool OSectionWindow::setReportSectionTitle(const uno::Reference< report::XReportDefinition>& _xReport,USHORT _nResId,::std::mem_fun_t<uno::Reference<report::XSection> , OReportHelper> _pGetSection,::std::mem_fun_t<sal_Bool,OReportHelper> _pIsSectionOn) +{ + OReportHelper aReportHelper(_xReport); + const bool bRet = _pIsSectionOn(&aReportHelper) && _pGetSection(&aReportHelper) == m_aReportSection.getSection(); + if ( bRet ) + { + String sTitle = String(ModuleRes(_nResId)); + m_aStartMarker.setTitle(sTitle); + m_aStartMarker.Invalidate(INVALIDATE_CHILDREN); + } // if ( bRet ) + return bRet; +} +// ----------------------------------------------------------------------------- +bool OSectionWindow::setGroupSectionTitle(const uno::Reference< report::XGroup>& _xGroup,USHORT _nResId,::std::mem_fun_t<uno::Reference<report::XSection> , OGroupHelper> _pGetSection,::std::mem_fun_t<sal_Bool,OGroupHelper> _pIsSectionOn) { OGroupHelper aGroupHelper(_xGroup); - if ( _pIsSectionOn(&aGroupHelper) ) + const bool bRet = _pIsSectionOn(&aGroupHelper) && _pGetSection(&aGroupHelper) == m_aReportSection.getSection() ; + if ( bRet ) { - uno::Reference< report::XSection > xSection = _pGetSection(&aGroupHelper); String sTitle = String(ModuleRes(_nResId)); sTitle.SearchAndReplace('#',_xGroup->getExpression()); m_aStartMarker.setTitle(sTitle); m_aStartMarker.Invalidate(INVALIDATE_CHILDREN); - } + } // if ( _pIsSectionOn(&aGroupHelper) ) + return bRet; } //------------------------------------------------------------------------------ void OSectionWindow::ImplInitSettings() @@ -316,7 +340,7 @@ IMPL_LINK( OSectionWindow, SplitHdl, Splitter*, _pSplitter ) sal_Int32 nSplitPos = _pSplitter->GetSplitPosPixel(); const Point aPos = _pSplitter->GetPosPixel(); - _pSplitter->SetPosPixel( Point( aPos.X(),nSplitPos )); + const uno::Reference< report::XSection> xSection = m_aReportSection.getSection(); nSplitPos = m_aSplitter.PixelToLogic(Size(0,nSplitPos)).Height(); @@ -326,18 +350,17 @@ IMPL_LINK( OSectionWindow, SplitHdl, Splitter*, _pSplitter ) for (sal_Int32 i = 0; i < nCount; ++i) { uno::Reference<report::XReportComponent> xReportComponent(xSection->getByIndex(i),uno::UNO_QUERY); - if ( xReportComponent.is() && nSplitPos < (xReportComponent->getPositionY() + xReportComponent->getHeight()) ) + if ( xReportComponent.is() /*&& nSplitPos < (xReportComponent->getPositionY() + xReportComponent->getHeight())*/ ) { - nSplitPos = xReportComponent->getPositionY() + xReportComponent->getHeight(); - break; + nSplitPos = ::std::max(nSplitPos,xReportComponent->getPositionY() + xReportComponent->getHeight()); } - } - - //nSplitPos += xSection->getHeight(); + } // for (sal_Int32 i = 0; i < nCount; ++i) + if ( nSplitPos < 0 ) nSplitPos = 0; xSection->setHeight(nSplitPos); + m_aSplitter.SetSplitPosPixel(m_aSplitter.LogicToPixel(Size(0,nSplitPos)).Height()); return 0L; } diff --git a/reportdesign/source/ui/report/propbrw.cxx b/reportdesign/source/ui/report/propbrw.cxx index 70da49614..08d5ea993 100644 --- a/reportdesign/source/ui/report/propbrw.cxx +++ b/reportdesign/source/ui/report/propbrw.cxx @@ -358,11 +358,6 @@ void PropBrw::implSetNewObject( const uno::Sequence< Reference<uno::XInterface> { m_xBrowserController->inspect(uno::Sequence< Reference<uno::XInterface> >()); m_xBrowserController->inspect(_aObjects); - - if ( m_sLastActivePage.getLength() ) - { - m_xBrowserController->restoreViewData( makeAny( m_sLastActivePage ) ); - } // if ( m_sLastActivePage.getLength() ) } catch( const Exception& ) { diff --git a/reportdesign/source/ui/report/report.src b/reportdesign/source/ui/report/report.src index 156f1a04a..d9cee000e 100644 --- a/reportdesign/source/ui/report/report.src +++ b/reportdesign/source/ui/report/report.src @@ -629,3 +629,23 @@ String RID_ERR_NO_OBJECTS { Text [ en-US ] = "The report can not be executed unless at least one object has been inserted."; }; +String RID_STR_DETAIL +{ + Text [ en-US ] = "Detail"; +}; +String RID_STR_PAGE_HEADER +{ + Text [ en-US ] = "Page Header"; +}; +String RID_STR_PAGE_FOOTER +{ + Text [ en-US ] = "Page Footer"; +}; +String RID_STR_REPORT_HEADER +{ + Text [ en-US ] = "Report Header"; +}; +String RID_STR_REPORT_FOOTER +{ + Text [ en-US ] = "Report Footer"; +}; diff --git a/reportdesign/util/description.xml b/reportdesign/util/description.xml index d8331bc69..2ed058bd8 100644 --- a/reportdesign/util/description.xml +++ b/reportdesign/util/description.xml @@ -7,7 +7,7 @@ <!-- <name lang="en-US">Sun(TM) Report Builder</name> --> </display-name> <registration> - <simple-license accept-by="admin" default-license-id="en-US" > + <simple-license accept-by="admin" default-license-id="lic-en-US" > <license-text xlink:href="licensefile" lang="isocode" license-id="lic-isocode"/> </simple-license> </registration> diff --git a/reportdesign/util/hidother.src b/reportdesign/util/hidother.src index 6f146ddeb..e81d20022 100644 --- a/reportdesign/util/hidother.src +++ b/reportdesign/util/hidother.src @@ -146,3 +146,4 @@ hidspecial HID_RPT_PROP_DETAILFIELDS { HelpId = HID_RPT_PROP_DETAILFIELDS; }; hidspecial HID_RPT_PROP_PREVIEW_COUNT { HelpId = HID_RPT_PROP_PREVIEW_COUNT; }; hidspecial HID_RPT_PROP_AREA { HelpId = HID_RPT_PROP_AREA; }; hidspecial UID_RPT_RPT_PROP_DLG_AREA { HelpId = UID_RPT_RPT_PROP_DLG_AREA; }; +hidspecial HID_RPT_PROP_MIMETYPE { HelpId = HID_RPT_PROP_MIMETYPE; };
\ No newline at end of file |