diff options
Diffstat (limited to 'sw')
23 files changed, 309 insertions, 1416 deletions
diff --git a/sw/prj/d.lst b/sw/prj/d.lst index d7e75a09564e..0cb261c5f0f1 100644 --- a/sw/prj/d.lst +++ b/sw/prj/d.lst @@ -36,6 +36,7 @@ mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\swreport\statusbar ..\%__SRC%\bin\vbaswobj*.dll %_DEST%\bin%_EXT%\vbaswobj*.dll ..\%__SRC%\bin\sw*.res %_DEST%\bin%_EXT%\sw*.res ..\%__SRC%\lib\lib*.* %_DEST%\lib%_EXT%\lib*.* +..\%__SRC%\misc\swd.component %_DEST%\xml%_EXT%\swd.component ..\uiconfig\swriter\menubar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\swriter\menubar\*.xml ..\uiconfig\swxform\menubar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\swxform\menubar\*.xml @@ -57,3 +58,5 @@ mkdir: %_DEST%\xml%_EXT%\uiconfig\modules\swreport\statusbar ..\uiconfig\swreport\statusbar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\swreport\statusbar\*.xml ..\%__SRC%\bin\*-layout.zip %_DEST%\pck%_EXT%\*.* +..\%__SRC%\misc\sw.component %_DEST%\xml%_EXT%\sw.component +..\%__SRC%\misc\vbaswobj.component %_DEST%\xml%_EXT%\vbaswobj.component diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 5ca8cb83d234..2df835f06c12 100755..100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1714,16 +1714,22 @@ sal_uInt16 SwDoc::GetPageCount() const const Size SwDoc::GetPageSize( sal_uInt16 nPageNum, bool bSkipEmptyPages ) const { Size aSize; - if( GetRootFrm() && nPageNum ) + if ( GetRootFrm() && nPageNum ) { const SwPageFrm* pPage = static_cast<const SwPageFrm*> (GetRootFrm()->Lower()); - while( --nPageNum && pPage->GetNext() ) + while ( --nPageNum && pPage->GetNext() ) + { pPage = static_cast<const SwPageFrm*>( pPage->GetNext() ); + } - if( !bSkipEmptyPages && pPage->IsEmptyPage() && pPage->GetNext() ) + // switch to next page for an empty page, if empty pages are not skipped + // in order to get a sensible page size for an empty page - e.g. for printing. + if ( !bSkipEmptyPages && pPage->IsEmptyPage() && pPage->GetNext() ) + { pPage = static_cast<const SwPageFrm*>( pPage->GetNext() ); + } aSize = pPage->Frm().SSize(); } diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 2e19d482fc70..766c3ca86377 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -1396,6 +1396,37 @@ void SwDrawContact::_Changed( const SdrObject& rObj, DisconnectFromLayout( false ); break; } + case SDRUSERCALL_CHILD_INSERTED : + case SDRUSERCALL_CHILD_REMOVED : + { + // --> AW, OD 2010-09-13 #i113730# + // force layer of controls for group objects containing control objects + if(dynamic_cast< SdrObjGroup* >(maAnchoredDrawObj.DrawObj())) + { + if(::CheckControlLayer(maAnchoredDrawObj.DrawObj())) + { + const IDocumentDrawModelAccess* pIDDMA = static_cast<SwFrmFmt*>(pRegisteredIn)->getIDocumentDrawModelAccess(); + const SdrLayerID aCurrentLayer(maAnchoredDrawObj.DrawObj()->GetLayer()); + const SdrLayerID aControlLayerID(pIDDMA->GetControlsId()); + const SdrLayerID aInvisibleControlLayerID(pIDDMA->GetInvisibleControlsId()); + + if(aCurrentLayer != aControlLayerID && aCurrentLayer != aInvisibleControlLayerID) + { + if ( aCurrentLayer == pIDDMA->GetInvisibleHellId() || + aCurrentLayer == pIDDMA->GetInvisibleHeavenId() ) + { + maAnchoredDrawObj.DrawObj()->SetLayer(aInvisibleControlLayerID); + } + else + { + maAnchoredDrawObj.DrawObj()->SetLayer(aControlLayerID); + } + } + } + } + // fallthrough intended here + // <-- + } case SDRUSERCALL_MOVEONLY: case SDRUSERCALL_RESIZE: case SDRUSERCALL_CHILD_MOVEONLY : @@ -1403,8 +1434,6 @@ void SwDrawContact::_Changed( const SdrObject& rObj, case SDRUSERCALL_CHILD_CHGATTR : case SDRUSERCALL_CHILD_DELETE : case SDRUSERCALL_CHILD_COPY : - case SDRUSERCALL_CHILD_INSERTED : - case SDRUSERCALL_CHILD_REMOVED : { // --> OD 2004-08-04 #i31698# - improvement: // get instance <SwAnchoredDrawObject> only once diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 17e4b1ed4873..f334ddcaee2f 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -599,7 +599,7 @@ bool SwFEShell::IsSelContainsControl() const // if we have one marked object, get the SdrObject and check // whether it contains a control const SdrObject* pSdrObject = pMarkList->GetMark( 0 )->GetMarkedSdrObj(); - bRet = CheckControlLayer( pSdrObject ); + bRet = ::CheckControlLayer( pSdrObject ); } return bRet; } @@ -994,8 +994,14 @@ void SwFEShell::ChangeOpaque( SdrLayerID nLayerId ) SdrObject* pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); // OD 21.08.2003 #i18447# - no change of layer for controls // or group objects containing controls. - const bool bControlObj = ::CheckControlLayer( pObj ); - //if ( pObj->GetLayer() != nLayerId && pObj->GetLayer() != nControls ) + // --> OD 2010-09-14 #i113730# + // consider that a member of a drawing group has been selected. + const SwContact* pContact = ::GetUserCall( pObj ); + ASSERT( pContact && pContact->GetMaster(), "<SwFEShell::ChangeOpaque(..)> - missing contact or missing master object at contact!" ); + const bool bControlObj = ( pContact && pContact->GetMaster() ) + ? ::CheckControlLayer( pContact->GetMaster() ) + : ::CheckControlLayer( pObj ); + // <-- if ( !bControlObj && pObj->GetLayer() != nLayerId ) { pObj->SetLayer( nLayerId ); diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index cd590d73ddcc..d69df532682f 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -51,6 +51,9 @@ #include <layhelp.hxx> #include <ndtxt.hxx> +// --> OD 2010-09-14 #i113730# +#include <svx/svdogrp.hxx> +// <-- // OD 16.04.2003 #i13147# - for <SwFlyFrm::GetContour(..)> #include <ndgrf.hxx> // OD 29.10.2003 #113049# @@ -2250,6 +2253,30 @@ void SwFrm::AppendDrawObj( SwAnchoredObject& _rNewObj ) _rNewObj.ChgAnchorFrm( this ); } + // --> OD 2010-09-14 #i113730# + // Assure the control objects and group objects containing controls are on the control layer + if ( ::CheckControlLayer( _rNewObj.DrawObj() ) ) + { + const IDocumentDrawModelAccess* pIDDMA = GetUpper()->GetFmt()->getIDocumentDrawModelAccess(); + const SdrLayerID aCurrentLayer(_rNewObj.DrawObj()->GetLayer()); + const SdrLayerID aControlLayerID(pIDDMA->GetControlsId()); + const SdrLayerID aInvisibleControlLayerID(pIDDMA->GetInvisibleControlsId()); + + if(aCurrentLayer != aControlLayerID && aCurrentLayer != aInvisibleControlLayerID) + { + if ( aCurrentLayer == pIDDMA->GetInvisibleHellId() || + aCurrentLayer == pIDDMA->GetInvisibleHeavenId() ) + { + _rNewObj.DrawObj()->SetLayer(aInvisibleControlLayerID); + } + else + { + _rNewObj.DrawObj()->SetLayer(aControlLayerID); + } + } + } + // <-- + // no direct positioning needed, but invalidate the drawing object position _rNewObj.InvalidateObjPos(); diff --git a/sw/source/filter/ww8/docxexportfilter.cxx b/sw/source/filter/ww8/docxexportfilter.cxx index 13715fcd2bbe..0da676da99a1 100644 --- a/sw/source/filter/ww8/docxexportfilter.cxx +++ b/sw/source/filter/ww8/docxexportfilter.cxx @@ -127,30 +127,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( void* /* pServiceManager */, void* pRegistryKey ) -{ - sal_Bool bRet = sal_False; - - if( pRegistryKey ) - { - try - { - uno::Reference< registry::XRegistryKey > xNewKey1( - static_cast< registry::XRegistryKey* >( pRegistryKey )->createKey( - OUString::createFromAscii( IMPL_NAME "/UNO/SERVICES/" ) ) ); - xNewKey1->createKey( DocxExport_getSupportedServiceNames().getConstArray()[0] ); - - bRet = sal_True; - } - catch( registry::InvalidRegistryException& ) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - - return bRet; -} - // ------------------------ // - component_getFactory - // ------------------------ diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index 5a8f201f7cb0..07a4c911fc7e 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -926,9 +926,15 @@ sal_Bool SvXMLExportItemMapper::QueryXMLValue( if( MID_PAGEDESC_PAGENUMOFFSET==nMemberId ) { - - rUnitConverter.convertNumber( - aOut, (sal_Int32)pPageDesc->GetNumOffset() ); + sal_Int32 const number(pPageDesc->GetNumOffset()); + if (0 >= number) + { + aOut.append(GetXMLToken(XML_AUTO)); + } + else // #i114163# positiveInteger only! + { + rUnitConverter.convertNumber(aOut, number); + } bOk = sal_True; } } diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx index 281e3ce3fabb..e9bb702b3d66 100644..100755 --- a/sw/source/ui/lingu/olmenu.cxx +++ b/sw/source/ui/lingu/olmenu.cxx @@ -823,7 +823,6 @@ void SwSpellPopup::Execute( USHORT nId ) else if (MN_DICTIONARIES_START <= nId && nId <= MN_DICTIONARIES_END) { OUString aWord( xSpellAlt->getWord() ); -// DBG_ASSERT( nDicIdx < aDics.getLength(), "dictionary index out of range" ); PopupMenu *pMenu = GetPopupMenu(MN_ADD_TO_DIC); String aDicName ( pMenu->GetItemText(nId) ); diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index 27fe1a65641f..8b6eeb9e7a5e 100644..100755 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -217,8 +217,7 @@ SwPreViewZoomDlg::SwPreViewZoomDlg( SwPagePreViewWin& rParent ) : Beschreibung: --------------------------------------------------------------------*/ - - SwPreViewZoomDlg::~SwPreViewZoomDlg() {} +SwPreViewZoomDlg::~SwPreViewZoomDlg() {} void SwPreViewZoomDlg::Apply() @@ -228,491 +227,6 @@ void SwPreViewZoomDlg::Apply() BYTE(aColEdit.GetValue()) ); } -/* */ -/* -----------------20.08.98 15:25------------------- - * Vorschau fuer den Seitendruck - * --------------------------------------------------*/ -struct PrintSettingsStruct; -class PrtPrvWindow : public Window -{ - const PrintSettingsStruct& rSettings; - - virtual void Paint(const Rectangle&); -public : - PrtPrvWindow(Window* pParent, const ResId& rResId, const PrintSettingsStruct& rSett) : - Window(pParent, rResId), rSettings(rSett){} -}; -/*-------------------------------------------------------------------- - Beschreibung: Optionen fuer das Drucken der Preview - --------------------------------------------------------------------*/ -struct PrintSettingsStruct -{ - Size aPageMaxSize; // groesste Seite - Size aPrtSize; // Papiergroesse - Size aPrvPrtSize; // Groesse innerhalb der LRTB-Raender - Size aGridSize; // Groesse fuer jede Seite, enthaelt je - // die Haelfte von H- und V-Distance - - long nLeft; - long nRight; - long nTop; - long nBottom; - long nHori; - long nVert; - - USHORT nRows; - USHORT nCols; - - BOOL bPrinterLandscape; // Ausrichtung -}; - -class SwPreviewPrintOptionsDialog : public SvxStandardDialog -{ - FixedLine aRowColFL; - FixedText aRowsFT; - NumericField aRowsNF; - FixedText aColsFT; - NumericField aColsNF; - - FixedLine aMarginFL; - FixedText aLSpaceFT; - MetricField aLSpaceMF; - FixedText aRSpaceFT; - MetricField aRSpaceMF; - FixedText aTSpaceFT; - MetricField aTSpaceMF; - FixedText aBSpaceFT; - MetricField aBSpaceMF; - FixedLine aDistanceFL; - FixedText aHSpaceFT; - MetricField aHSpaceMF; - FixedText aVSpaceFT; - MetricField aVSpaceMF; - - RadioButton aLandscapeRB; - RadioButton aPortraitRB; - FixedLine aOrientationFL; - - PrtPrvWindow aPreviewWin; - - OKButton aOkBtn; - CancelButton aCancelBtn; - HelpButton aHelpBtn; - - PushButton aStandardPB; - - SwPagePreView& rPreView; - SwPagePreViewWin& rParentWin; - PrintSettingsStruct aSettings; -/* Size aPageMaxSize; - Size aPrtSize; - - BOOL bOrientation; -*/ - BOOL bStandard; - - virtual void Apply(); - void FillControls(SwPagePreViewPrtData& rData); - - DECL_LINK( ModifyHdl, Edit* ); - DECL_LINK( StandardHdl, PushButton* ); - -public: - SwPreviewPrintOptionsDialog(SwPagePreViewWin& rParent, SwPagePreView& rView); - ~SwPreviewPrintOptionsDialog(); -}; - -/* -----------------19.08.98 13:35------------------- - * - * --------------------------------------------------*/ -SwPreviewPrintOptionsDialog::SwPreviewPrintOptionsDialog( SwPagePreViewWin& rParent, SwPagePreView& rView ) : - SvxStandardDialog( &rParent, SW_RES(DLG_PAGEPREVIEW_PRINTOPTIONS) ), - aRowColFL(this,SW_RES( FL_ROWCOL)), - aRowsFT(this,SW_RES( FT_ROWS)), - aRowsNF(this,SW_RES( NF_ROWS)), - aColsFT(this,SW_RES( FT_COLS)), - aColsNF(this,SW_RES( NF_COLS)), - aMarginFL(this,SW_RES( FL_MARGINS)), - aLSpaceFT(this,SW_RES( FT_LMARGIN)), - aLSpaceMF(this,SW_RES( MF_LMARGIN)), - aRSpaceFT(this,SW_RES( FT_RMARGIN)), - aRSpaceMF(this,SW_RES( MF_RMARGIN)), - aTSpaceFT(this,SW_RES( FT_TMARGIN)), - aTSpaceMF(this,SW_RES( MF_TMARGIN)), - aBSpaceFT(this,SW_RES( FT_BMARGIN)), - aBSpaceMF(this,SW_RES( MF_BMARGIN)), - aDistanceFL(this,SW_RES(FL_DISTANCE)), - aHSpaceFT(this,SW_RES( FT_HMARGIN)), - aHSpaceMF(this,SW_RES( MF_HMARGIN)), - aVSpaceFT(this,SW_RES( FT_VMARGIN)), - aVSpaceMF(this,SW_RES( MF_VMARGIN)), - aLandscapeRB(this,SW_RES( RB_LANDSCAPE)), - aPortraitRB(this,SW_RES( RB_PORTRAIT)), - aOrientationFL(this,SW_RES( FL_ORIENTATION)), - aPreviewWin(this,SW_RES( WIN_PREVIEW), aSettings), - aOkBtn(this,SW_RES(BT_OK)), - aCancelBtn(this,SW_RES(BT_CANCEL)), - aHelpBtn(this,SW_RES(BT_HELP)), - aStandardPB(this,SW_RES(PB_STANDARD)), - rPreView(rView), - rParentWin(rParent), - bStandard(TRUE) -{ - FreeResource(); - ViewShell& rViewSh = *rPreView.GetViewShell(); - // OD 18.12.2002 #103492# - aSettings.aPageMaxSize = rViewSh.PagePreviewLayout()->GetMaxPageSize(); - SfxPrinter* pPrinter = rViewSh.getIDocumentDeviceAccess()->getPrinter( true ); - aSettings.aPrtSize = pPrinter->GetPaperSize(); - //#97682# make sure that no division by zero occurs - if(!aSettings.aPrtSize.Width() || !aSettings.aPrtSize.Height()) - aSettings.aPrtSize = SvxPaperInfo::GetPaperSize(PAPER_A4); - aSettings.bPrinterLandscape = pPrinter->GetOrientation() == ORIENTATION_LANDSCAPE; - - - SwDocShell* pDocShell = rPreView.GetDocShell(); - const SwMasterUsrPref *pUsrPref = SW_MOD()->GetUsrPref(0 != PTR_CAST(SwWebDocShell, pDocShell)); - FieldUnit eFieldUnit = pUsrPref->GetMetric(); - ::SetFieldUnit( aLSpaceMF, eFieldUnit ); - ::SetFieldUnit( aRSpaceMF, eFieldUnit ); - ::SetFieldUnit( aTSpaceMF, eFieldUnit ); - ::SetFieldUnit( aBSpaceMF, eFieldUnit ); - ::SetFieldUnit( aHSpaceMF, eFieldUnit ); - ::SetFieldUnit( aVSpaceMF, eFieldUnit ); - - SwDoc* pDoc = pDocShell->GetDoc(); - SwPagePreViewPrtData aData; - if(pDoc->GetPreViewPrtData()) - { - aData = *pDoc->GetPreViewPrtData(); - bStandard = FALSE; - } - else - { - // Orientation der PreviewData an den Drucker anpassen - aData.SetLandscape(aSettings.bPrinterLandscape); - aData.SetRow(rParent.GetRow()); - aData.SetCol(rParent.GetCol()); - } - FillControls(aData); - - aLSpaceMF.SaveValue(); - aRSpaceMF.SaveValue(); - aTSpaceMF.SaveValue(); - aBSpaceMF.SaveValue(); - aHSpaceMF.SaveValue(); - aVSpaceMF.SaveValue(); - aRowsNF.SaveValue(); - aColsNF.SaveValue(); - aLandscapeRB.SaveValue(); - aPortraitRB.SaveValue(); - - aStandardPB.SetClickHdl(LINK(this, SwPreviewPrintOptionsDialog, StandardHdl)); - Link aLk = LINK(this, SwPreviewPrintOptionsDialog, ModifyHdl); - aLSpaceMF.SetUpHdl(aLk); - aRSpaceMF.SetUpHdl(aLk); - aTSpaceMF.SetUpHdl(aLk); - aBSpaceMF.SetUpHdl(aLk); - aHSpaceMF.SetUpHdl(aLk); - aVSpaceMF.SetUpHdl(aLk); - aRowsNF.SetUpHdl(aLk); - aColsNF.SetUpHdl(aLk); - aLSpaceMF.SetDownHdl(aLk); - aRSpaceMF.SetDownHdl(aLk); - aTSpaceMF.SetDownHdl(aLk); - aBSpaceMF.SetDownHdl(aLk); - aHSpaceMF.SetDownHdl(aLk); - aVSpaceMF.SetDownHdl(aLk); - aRowsNF.SetDownHdl(aLk); - aColsNF.SetDownHdl(aLk); - aLSpaceMF.SetLoseFocusHdl(aLk); - aRSpaceMF.SetLoseFocusHdl(aLk); - aTSpaceMF.SetLoseFocusHdl(aLk); - aBSpaceMF.SetLoseFocusHdl(aLk); - aHSpaceMF.SetLoseFocusHdl(aLk); - aVSpaceMF.SetLoseFocusHdl(aLk); - aRowsNF.SetLoseFocusHdl(aLk); - aColsNF.SetLoseFocusHdl(aLk); - aLandscapeRB.SetClickHdl(aLk); - aPortraitRB.SetClickHdl(aLk); - - ModifyHdl(0); - if(bStandard) - StandardHdl(&aStandardPB); -} - - -/* -----------------19.08.98 13:36------------------- - * - * --------------------------------------------------*/ -SwPreviewPrintOptionsDialog::~SwPreviewPrintOptionsDialog() -{ -} -/* -----------------12.11.98 11:32------------------- - * - * --------------------------------------------------*/ -void SwPreviewPrintOptionsDialog::FillControls(SwPagePreViewPrtData& rData) -{ - aLSpaceMF.SetValue(aLSpaceMF.Normalize(rData.GetLeftSpace() ), FUNIT_TWIP); - aRSpaceMF.SetValue(aRSpaceMF.Normalize(rData.GetRightSpace() ), FUNIT_TWIP); - aTSpaceMF.SetValue(aTSpaceMF.Normalize(rData.GetTopSpace() ), FUNIT_TWIP); - aBSpaceMF.SetValue(aBSpaceMF.Normalize(rData.GetBottomSpace()), FUNIT_TWIP); - aHSpaceMF.SetValue(aHSpaceMF.Normalize(rData.GetHorzSpace() ), FUNIT_TWIP); - aVSpaceMF.SetValue(aVSpaceMF.Normalize(rData.GetVertSpace() ), FUNIT_TWIP); - aRowsNF.SetValue(rData.GetRow()); - aColsNF.SetValue(rData.GetCol()); - aSettings.bPrinterLandscape ? aLandscapeRB.Check() : aPortraitRB.Check(); - // wenn Drucker und Einstellungen nicht uebereinstimmen, dann Seiten tauschen - if( rData.GetLandscape() != aSettings.bPrinterLandscape ) - { - Size aTmp(aSettings.aPrtSize.Height(), aSettings.aPrtSize.Width()); - aSettings.aPrtSize = aTmp; - aSettings.bPrinterLandscape = !aSettings.bPrinterLandscape; - // nochmal setzen, denn auch wenn nur die Default-Orientierung dem Drucker - // angepasst wurde, sollen die Einstellungen gespeichert werden - aSettings.bPrinterLandscape ? aLandscapeRB.Check() : aPortraitRB.Check(); - } - aLandscapeRB.SaveValue(); - aPortraitRB.SaveValue(); - - aSettings.nLeft = rData.GetLeftSpace() ; - aSettings.nRight = rData.GetRightSpace() ; - aSettings.nTop = rData.GetTopSpace() ; - aSettings.nBottom = rData.GetBottomSpace(); - aSettings.nHori = rData.GetHorzSpace() ; - aSettings.nVert = rData.GetVertSpace() ; - aSettings.nRows = rData.GetRow() ; - aSettings.nCols = rData.GetCol() ; - aSettings.aPrvPrtSize = aSettings.aPrtSize ; -} - -/* -----------------19.08.98 14:31------------------- - * - * --------------------------------------------------*/ -void SwPreviewPrintOptionsDialog::Apply() -{ - - SwDoc* pDoc = rPreView.GetDocShell()->GetDoc(); - if(bStandard) - pDoc->SetPreViewPrtData(0); - else if( aLSpaceMF.GetSavedValue() != aLSpaceMF.GetText() || - aRSpaceMF.GetSavedValue() != aRSpaceMF.GetText() || - aTSpaceMF.GetSavedValue() != aTSpaceMF.GetText() || - aBSpaceMF.GetSavedValue() != aBSpaceMF.GetText() || - aHSpaceMF.GetSavedValue() != aHSpaceMF.GetText() || - aVSpaceMF.GetSavedValue() != aVSpaceMF.GetText() || - aRowsNF.GetSavedValue() != aRowsNF.GetText() || - aColsNF.GetSavedValue() != aColsNF.GetText() || - aLandscapeRB.GetSavedValue() != aLandscapeRB.IsChecked() || - aPortraitRB.GetSavedValue() != aPortraitRB.IsChecked() ) - { - SwPagePreViewPrtData aData; - if(pDoc->GetPreViewPrtData()) - aData = *pDoc->GetPreViewPrtData(); - aData.SetLeftSpace( static_cast< ULONG >(aLSpaceMF.Denormalize(aLSpaceMF.GetValue(FUNIT_TWIP))) ); - aData.SetRightSpace( static_cast< ULONG >(aRSpaceMF.Denormalize(aRSpaceMF.GetValue(FUNIT_TWIP))) ); - aData.SetTopSpace( static_cast< ULONG >(aTSpaceMF.Denormalize(aTSpaceMF.GetValue(FUNIT_TWIP))) ); - aData.SetBottomSpace( static_cast< ULONG >(aBSpaceMF.Denormalize(aBSpaceMF.GetValue(FUNIT_TWIP))) ); - - aData.SetHorzSpace( static_cast< ULONG >(aHSpaceMF.Denormalize(aHSpaceMF.GetValue(FUNIT_TWIP))) ); - aData.SetVertSpace( static_cast< ULONG >(aVSpaceMF.Denormalize(aVSpaceMF.GetValue(FUNIT_TWIP))) ); - aData.SetRow((BYTE)aRowsNF.GetValue()); - aData.SetCol((BYTE)aColsNF.GetValue()); - aData.SetLandscape(aLandscapeRB.IsChecked()); - - ViewShell& rViewSh = *rPreView.GetViewShell(); - SfxPrinter* pPrinter = rViewSh.getIDocumentDeviceAccess()->getPrinter( true ); - if((pPrinter->GetOrientation() == ORIENTATION_LANDSCAPE) - != aData.GetLandscape()) - pPrinter->SetOrientation(aData.GetLandscape() ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT); - - - pDoc->SetPreViewPrtData(&aData); - - } -} -/* -----------------20.08.98 08:48------------------- - * - * --------------------------------------------------*/ -IMPL_LINK( SwPreviewPrintOptionsDialog, ModifyHdl, Edit*, pEdit ) -{ - if(bStandard && pEdit) - { - aLSpaceMF.SetUserValue(aLSpaceMF.GetValue()); - aRSpaceMF.SetUserValue(aRSpaceMF.GetValue()); - aTSpaceMF.SetUserValue(aTSpaceMF.GetValue()); - aBSpaceMF.SetUserValue(aBSpaceMF.GetValue()); - aHSpaceMF.SetUserValue(aHSpaceMF.GetValue()); - aVSpaceMF.SetUserValue(aVSpaceMF.GetValue()); - aRowsNF. SetUserValue(aRowsNF .GetValue()); - aColsNF. SetUserValue(aColsNF .GetValue()); - - bStandard = FALSE; - } - BOOL bOrientChanged = aSettings.bPrinterLandscape != aLandscapeRB.IsChecked();; - if(pEdit == &aLSpaceMF) - aSettings.nLeft = static_cast< long >(aLSpaceMF.Denormalize(aLSpaceMF.GetValue(FUNIT_TWIP))); - else if(pEdit == &aRSpaceMF) - aSettings.nRight = static_cast< long >(aRSpaceMF.Denormalize(aRSpaceMF.GetValue(FUNIT_TWIP))); - else if(pEdit == &aTSpaceMF) - aSettings.nTop = static_cast< long >(aTSpaceMF.Denormalize(aTSpaceMF.GetValue(FUNIT_TWIP))); - else if(pEdit == &aBSpaceMF) - aSettings.nBottom = static_cast< long >(aBSpaceMF.Denormalize(aBSpaceMF.GetValue(FUNIT_TWIP))); - else if(pEdit == &aHSpaceMF) - aSettings.nHori = static_cast< long >(aHSpaceMF.Denormalize(aHSpaceMF.GetValue(FUNIT_TWIP))); - else if(pEdit == &aVSpaceMF) - aSettings.nVert = static_cast< long >(aVSpaceMF.Denormalize(aVSpaceMF.GetValue(FUNIT_TWIP))); - else if(pEdit == &aRowsNF) - aSettings.nRows = (USHORT)aRowsNF.GetValue(); - else if(pEdit == &aColsNF) - aSettings.nCols = (USHORT)aColsNF.GetValue(); - else if(pEdit == (Edit*)&aLandscapeRB) - aSettings.bPrinterLandscape = aLandscapeRB.IsChecked(); - else if(pEdit == (Edit*)&aPortraitRB) - aSettings.bPrinterLandscape = aLandscapeRB.IsChecked(); - - if(bOrientChanged) - { - Size aTmp(aSettings.aPrtSize.Height(), aSettings.aPrtSize.Width()); - aSettings.aPrtSize = aTmp; - } - - - aSettings.aPrvPrtSize = Size(aSettings.aPrtSize.Width() - aSettings.nRight - aSettings.nLeft, - aSettings.aPrtSize.Height() - aSettings.nTop - aSettings.nBottom); - aSettings.aGridSize = Size(aSettings.aPrvPrtSize.Width() / aSettings.nCols, - aSettings.aPrvPrtSize.Height() / aSettings.nRows ); - // was fehlt noch: Orientation auswerten, minimalrand ausrechnen, Beispiel fuettern - - - //am Ende Maximalwerte setzen - long n20Percent = aSettings.aPrtSize.Width() / 5; - aLSpaceMF.SetMax(aLSpaceMF.Normalize(aSettings.aPrtSize.Width() - aSettings.nRight - n20Percent), FUNIT_TWIP); - aRSpaceMF.SetMax(aRSpaceMF.Normalize(aSettings.aPrtSize.Width() - aSettings.nLeft - n20Percent), FUNIT_TWIP); - n20Percent = aSettings.aPrtSize.Height() / 5; - aTSpaceMF.SetMax(aTSpaceMF.Normalize(aSettings.aPrtSize.Height() - aSettings.nBottom - n20Percent), FUNIT_TWIP); - aBSpaceMF.SetMax(aBSpaceMF.Normalize(aSettings.aPrtSize.Height() - aSettings.nTop - n20Percent), FUNIT_TWIP); - - long n80Percent = aSettings.aPrvPrtSize.Width() * 4 / 5; - aHSpaceMF.SetMax(aHSpaceMF.Normalize(n80Percent / aSettings.nRows), FUNIT_TWIP); - n80Percent = aSettings.aPrvPrtSize.Height()* 4 / 5; - aVSpaceMF.SetMax(aVSpaceMF.Normalize(n80Percent / aSettings.nCols), FUNIT_TWIP); - aHSpaceMF.Enable(aSettings.nCols > 1); - aVSpaceMF.Enable(aSettings.nRows > 1); - aRowsNF.SetMin(1);// nur damit auch nach Standard wieder der Inhalt angezeigt wird - aColsNF.SetMin(1); - - - aPreviewWin.Invalidate(); - return 0; -} -/* -----------------28.08.98 14:59------------------- - * - * --------------------------------------------------*/ -IMPL_LINK( SwPreviewPrintOptionsDialog, StandardHdl, PushButton*, EMPTYARG ) -{ - SetUpdateMode(TRUE); - SwPagePreViewPrtData aData; - aData.SetRow(rParentWin.GetRow()); - aData.SetCol(rParentWin.GetCol()); - FillControls(aData); - bStandard = TRUE; - aLSpaceMF.SetText(aEmptyStr); - aRSpaceMF.SetText(aEmptyStr); - aTSpaceMF.SetText(aEmptyStr); - aBSpaceMF.SetText(aEmptyStr); - aHSpaceMF.SetText(aEmptyStr); - aVSpaceMF.SetText(aEmptyStr); - aPreviewWin.Invalidate(); - SetUpdateMode(FALSE); - return 0; -} -/* -----------------20.08.98 15:28------------------- - * Preview anzeigen - * --------------------------------------------------*/ -void PrtPrvWindow::Paint(const Rectangle&) -{ - Size aWinSize(GetOutputSizePixel()); - long nWidth = rSettings.aPrtSize.Width(); - long nHeight = rSettings.aPrtSize.Height(); - BOOL bHoriValid = (aWinSize.Width() * 100 / aWinSize.Height()) < - (rSettings.aPrtSize.Width() * 100/ rSettings.aPrtSize.Height()); - Fraction aXScale( aWinSize.Width(), Max( nWidth , 1L ) ); - Fraction aYScale( aWinSize.Height(), Max( nHeight, 1L ) ); - MapMode aMapMode( GetMapMode() ); - aMapMode.SetScaleX( bHoriValid ? aXScale : aYScale); - aMapMode.SetScaleY( bHoriValid ? aXScale : aYScale); - SetMapMode( aMapMode ); - - aWinSize = GetOutputSize(); - - Point aOffset(0,0); - if(bHoriValid) - aOffset.Y() = (aWinSize.Height() - rSettings.aPrtSize.Height()) / 2; - else - aOffset.X() = (aWinSize.Width() - rSettings.aPrtSize.Width()) / 2;; - - - BOOL bUseSystemColors = SvtAccessibilityOptions().GetIsForPagePreviews() - && GetSettings().GetStyleSettings().GetHighContrastMode(); - - //der weisse Seitenhintergrund - Rectangle aRect(aOffset, rSettings.aPrtSize); - if(bUseSystemColors) - { - SetFillColor( GetSettings().GetStyleSettings().GetWindowColor() ); - SetLineColor( SwViewOption::GetFontColor() ); - } - else - { - SetFillColor( Color( COL_WHITE ) ); - SetLineColor(Color( COL_BLACK ) ); - } - - DrawRect(aRect); - - Point aTL(aOffset); - aTL.X() += rSettings.nLeft; - aTL.Y() += rSettings.nTop; - - Size aPrvPageSize((rSettings.aPrvPrtSize.Width() - (rSettings.nCols - 1) * rSettings.nHori) / rSettings.nCols, - (rSettings.aPrvPrtSize.Height() - (rSettings.nRows - 1) * rSettings.nVert) / rSettings.nRows); - // jetzt muss noch das unterschiedliche Groessenverhaeltnis berechnet werden, um es an - // der richtigen Seite abzuziehen. - //... - long nSourceScale = rSettings.aPageMaxSize.Width() * 100 / rSettings.aPageMaxSize.Height(); - long nDestScale = aPrvPageSize.Width() * 100 / aPrvPageSize.Height() ; - if(nSourceScale > nDestScale) // die Seite ist relativ breiter als das vorhandene Rechteck - { - aPrvPageSize.Height() = aPrvPageSize.Width() * 100 / nSourceScale; - } - else - { - aPrvPageSize.Width() = aPrvPageSize.Height() * nSourceScale / 100; - } - - if(bUseSystemColors) - SetFillColor( GetSettings().GetStyleSettings().GetWindowColor() ); - else - SetFillColor( Color( COL_GRAY ) ); - - - aRect = Rectangle(aTL, aPrvPageSize); - for(USHORT i = 0; i < rSettings.nRows; i++) - { - for(USHORT j = 0; j < rSettings.nCols; j++) - { - DrawRect(aRect); - aRect.Move(aPrvPageSize.Width() + rSettings.nHori, 0); - } - - aRect.Move( 0, aPrvPageSize.Height() + rSettings.nVert); - aRect.SetPos(Point(aTL.X(), aRect.TopLeft().Y())); - } - //rSettings; -} - -/* */ /*-------------------------------------------------------------------- Beschreibung: --------------------------------------------------------------------*/ diff --git a/sw/source/ui/uiview/pview.src b/sw/source/ui/uiview/pview.src index 53f672dbdb60..1a8833e76b34 100644..100755 --- a/sw/source/ui/uiview/pview.src +++ b/sw/source/ui/uiview/pview.src @@ -29,272 +29,7 @@ #include "pview.hrc" #include "helpid.h" #include "cmdid.h" -ModalDialog DLG_PAGEPREVIEW_PRINTOPTIONS -{ - HelpID = HID_DLG_PRV_PRT_OPTIONS ; - OutputSize = TRUE ; - SVLook = TRUE ; - Moveable = TRUE ; - Size = MAP_APPFONT ( 312 , 131 ) ; - FixedLine FL_ROWCOL - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 150 , 8 ) ; - - Text [ en-US ] = "Distribution"; - }; - FixedText FT_ROWS - { - Pos = MAP_APPFONT ( 12 , 15 ) ; - Size = MAP_APPFONT ( 30 , 10 ) ; - Left = TRUE ; - Text [ en-US ] = "Ro~ws"; - }; - NumericField NF_ROWS - { - Border = TRUE ; - Pos = MAP_APPFONT ( 45 , 14 ) ; - Size = MAP_APPFONT ( 36 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = PVIEW_MIN_ROW ; - Maximum = PVIEW_MAX_ROW ; - Value = 1 ; - First = PVIEW_MIN_COL ; - Last = PVIEW_MAX_COL ; - }; - FixedText FT_COLS - { - Pos = MAP_APPFONT ( 84 , 15 ) ; - Size = MAP_APPFONT ( 30 , 10 ) ; - Left = TRUE ; - Text [ en-US ] = "~Columns"; - }; - NumericField NF_COLS - { - Border = TRUE ; - Pos = MAP_APPFONT ( 117 , 14 ) ; - Size = MAP_APPFONT ( 36 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = PVIEW_MIN_COL ; - Maximum = PVIEW_MAX_COL ; - Value = 1 ; - First = PVIEW_MIN_COL ; - Last = PVIEW_MAX_COL ; - }; - FixedLine FL_MARGINS - { - Pos = MAP_APPFONT ( 6 , 32 ) ; - Size = MAP_APPFONT ( 150 , 8 ) ; - Text [ en-US ] = "Margins"; - }; - FixedText FT_LMARGIN - { - Pos = MAP_APPFONT ( 12 , 44 ) ; - Size = MAP_APPFONT ( 30 , 10 ) ; - Left = TRUE ; - Text [ en-US ] = "L~eft"; - }; - MetricField MF_LMARGIN - { - Border = TRUE ; - Pos = MAP_APPFONT ( 45 , 43 ) ; - Size = MAP_APPFONT ( 36 , 12 ) ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - DecimalDigits = 1 ; - Unit = FUNIT_CM ; - SpinSize = 10 ; - Minimum = 0 ; - Maximum = 9999 ; - First = 0 ; - Last = 2000 ; - }; - FixedText FT_RMARGIN - { - Pos = MAP_APPFONT ( 84 , 44 ) ; - Size = MAP_APPFONT ( 30 , 10 ) ; - Left = TRUE ; - Text [ en-US ] = "~Right"; - }; - MetricField MF_RMARGIN - { - Border = TRUE ; - Pos = MAP_APPFONT ( 117 , 43 ) ; - Size = MAP_APPFONT ( 36 , 12 ) ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - DecimalDigits = 1 ; - Unit = FUNIT_CM ; - SpinSize = 10 ; - Minimum = 0 ; - Maximum = 9999 ; - First = 0 ; - Last = 2000 ; - }; - FixedText FT_TMARGIN - { - Pos = MAP_APPFONT ( 12 , 59 ) ; - Size = MAP_APPFONT ( 30 , 10 ) ; - Left = TRUE ; - Text [ en-US ] = "~Top"; - }; - MetricField MF_TMARGIN - { - Border = TRUE ; - Pos = MAP_APPFONT ( 45 , 58 ) ; - Size = MAP_APPFONT ( 36 , 12 ) ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - DecimalDigits = 1 ; - Unit = FUNIT_CM ; - SpinSize = 10 ; - Minimum = 0 ; - Maximum = 9999 ; - First = 0 ; - Last = 2000 ; - }; - FixedText FT_BMARGIN - { - Pos = MAP_APPFONT ( 84 , 59 ) ; - Size = MAP_APPFONT ( 30 , 10 ) ; - Left = TRUE ; - Text [ en-US ] = "~Bottom"; - }; - MetricField MF_BMARGIN - { - Border = TRUE ; - Pos = MAP_APPFONT ( 117 , 58 ) ; - Size = MAP_APPFONT ( 36 , 12 ) ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - DecimalDigits = 1 ; - Unit = FUNIT_CM ; - SpinSize = 10 ; - Minimum = 0 ; - Maximum = 9999 ; - First = 0 ; - Last = 2000 ; - }; - FixedLine FL_DISTANCE - { - Pos = MAP_APPFONT ( 6 , 76 ) ; - Size = MAP_APPFONT ( 150 , 8 ) ; - - Text [ en-US ] = "Spacing"; - }; - FixedText FT_HMARGIN - { - Pos = MAP_APPFONT ( 12 , 88 ) ; - Size = MAP_APPFONT ( 30 , 10 ) ; - Left = TRUE ; - Text [ en-US ] = "Hori~zontal"; - }; - - MetricField MF_HMARGIN - { - Border = TRUE ; - Pos = MAP_APPFONT ( 45 , 87 ) ; - Size = MAP_APPFONT ( 36 , 12 ) ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - DecimalDigits = 1 ; - Unit = FUNIT_CM ; - SpinSize = 10 ; - Minimum = 0 ; - Maximum = 9999 ; - First = 0 ; - Last = 2000 ; - }; - FixedText FT_VMARGIN - { - Pos = MAP_APPFONT ( 84 , 88 ) ; - Size = MAP_APPFONT ( 32 , 10 ) ; - Left = TRUE ; - Text [ en-US ] = "~Vertically"; - }; - - MetricField MF_VMARGIN - { - Border = TRUE ; - Pos = MAP_APPFONT ( 117 , 87 ) ; - Size = MAP_APPFONT ( 36 , 12 ) ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - DecimalDigits = 1 ; - Unit = FUNIT_CM ; - SpinSize = 10 ; - Minimum = 0 ; - Maximum = 9999 ; - First = 0 ; - Last = 2000 ; - }; - FixedLine FL_ORIENTATION - { - Pos = MAP_APPFONT ( 6 , 102 ) ; - Size = MAP_APPFONT ( 150 , 8 ) ; - Text [ en-US ] = "Format"; - }; - RadioButton RB_LANDSCAPE - { - Pos = MAP_APPFONT ( 12 , 113 ) ; - Size = MAP_APPFONT ( 60 , 12 ) ; - TabStop = TRUE ; - Group = TRUE ; - Text [ en-US ] = "~Landscape"; - }; - RadioButton RB_PORTRAIT - { - Pos = MAP_APPFONT ( 84 , 113 ) ; - Size = MAP_APPFONT ( 60 , 12 ) ; - Text [ en-US ] = "P~ortrait"; - }; - Window WIN_PREVIEW - { - Pos = MAP_APPFONT ( 162 , 7 ) ; - Size = MAP_APPFONT ( 90 , 113 ) ; - }; - - OKButton BT_OK - { - Pos = MAP_APPFONT ( 258 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BT_CANCEL - { - Pos = MAP_APPFONT ( 258 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BT_HELP - { - Pos = MAP_APPFONT ( 258 , 49 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - PushButton PB_STANDARD - { - Pos = MAP_APPFONT ( 258 , 66 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Default"; - }; - Text [ en-US ] = "Print Options"; -}; ModalDialog DLG_PAGEPREVIEW_ZOOM { HelpID = HID_PPREV_ZOOM ; @@ -460,31 +195,3 @@ ToolBox RID_PVIEW_TOOLBOX Scroll = TRUE ; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/sw/source/ui/uiview/view.hrc b/sw/source/ui/uiview/view.hrc index 8697a7e4ed63..d2aa60494801 100644..100755 --- a/sw/source/ui/uiview/view.hrc +++ b/sw/source/ui/uiview/view.hrc @@ -77,7 +77,6 @@ #define DLG_SPECIAL_FORCED (RC_VIEW_BEGIN) #define DLG_PAGEPREVIEW_ZOOM (RC_VIEW_BEGIN + 1) -#define DLG_PAGEPREVIEW_PRINTOPTIONS (RC_VIEW_BEGIN + 2) // Ueberlaufpruefung ----------------------------------------------------- diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx index b0ad816df4a1..a3ef96d1a613 100644..100755 --- a/sw/source/ui/uno/SwXDocumentSettings.cxx +++ b/sw/source/ui/uno/SwXDocumentSettings.cxx @@ -31,7 +31,6 @@ #include <vos/mutex.hxx> #include <sfx2/sfxbasecontroller.hxx> #include <SwXDocumentSettings.hxx> -#include <SwXPrintPreviewSettings.hxx> #include <comphelper/MasterPropertySetInfo.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/i18n/XForbiddenCharacters.hpp> @@ -221,7 +220,6 @@ SwXDocumentSettings::SwXDocumentSettings ( SwXTextDocument * pModel ) , mpPrinter( NULL ) { registerSlave ( new SwXPrintSettings ( PRINT_SETTINGS_DOCUMENT, mpModel->GetDocShell()->GetDoc() ) ); - registerSlave ( new SwXPrintPreviewSettings ( mpModel->GetDocShell()->GetDoc() ) ); } SwXDocumentSettings::~SwXDocumentSettings() diff --git a/sw/source/ui/uno/SwXPrintPreviewSettings.cxx b/sw/source/ui/uno/SwXPrintPreviewSettings.cxx deleted file mode 100644 index a812c39754c9..000000000000 --- a/sw/source/ui/uno/SwXPrintPreviewSettings.cxx +++ /dev/null @@ -1,375 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sw.hxx" -#include <SwXPrintPreviewSettings.hxx> -#include <comphelper/ChainablePropertySetInfo.hxx> -#include <pvprtdat.hxx> -#include <swtypes.hxx> -#ifndef _COM_SUN_STAR_BEANS_PropertyAttribute_HPP_ -#include <com/sun/star/beans/PropertyAttribute.hpp> -#endif -#ifndef _COM_SUN_STAR_BEANS_PropertyAttribute_HPP_ -#include <com/sun/star/beans/PropertyAttribute.hpp> -#endif -#include <doc.hxx> -#include <vcl/svapp.hxx> -using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::beans; -using namespace ::com::sun::star::lang; -using namespace ::comphelper; -using ::rtl::OUString; - -enum SwPrintSettingsPropertyHandles -{ - HANDLE_PRINTSET_PREVIEW_LEFT_MARGIN, - HANDLE_PRINTSET_PREVIEW_RIGHT_MARGIN, - HANDLE_PRINTSET_PREVIEW_TOP_MARGIN, - HANDLE_PRINTSET_PREVIEW_BOTTOM_MARGIN, - HANDLE_PRINTSET_PREVIEW_HORIZONTAL_SPACING, - HANDLE_PRINTSET_PREVIEW_VERTICAL_SPACING, - HANDLE_PRINTSET_PREVIEW_NUM_ROWS, - HANDLE_PRINTSET_PREVIEW_NUM_COLUMNS, - HANDLE_PRINTSET_PREVIEW_LANDSCAPE -}; - -static ChainablePropertySetInfo * lcl_createPrintPreviewSettingsInfo() -{ - static PropertyInfo aPrintPreviewSettingsMap_Impl[] = - { - { RTL_CONSTASCII_STRINGPARAM ( "PreviewPrintLeftMargin" ), HANDLE_PRINTSET_PREVIEW_LEFT_MARGIN, CPPUTYPE_INT32, PropertyAttribute::MAYBEVOID, 0 }, - { RTL_CONSTASCII_STRINGPARAM ( "PreviewPrintRightMargin" ), HANDLE_PRINTSET_PREVIEW_RIGHT_MARGIN, CPPUTYPE_INT32, PropertyAttribute::MAYBEVOID, 0 }, - { RTL_CONSTASCII_STRINGPARAM ( "PreviewPrintTopMargin" ), HANDLE_PRINTSET_PREVIEW_TOP_MARGIN, CPPUTYPE_INT32, PropertyAttribute::MAYBEVOID, 0 }, - { RTL_CONSTASCII_STRINGPARAM ( "PreviewPrintBottomMargin" ),HANDLE_PRINTSET_PREVIEW_BOTTOM_MARGIN, CPPUTYPE_INT32, PropertyAttribute::MAYBEVOID, 0 }, - { RTL_CONSTASCII_STRINGPARAM ( "PreviewPrintHorizontalSpacing" ),HANDLE_PRINTSET_PREVIEW_HORIZONTAL_SPACING, CPPUTYPE_INT32, PropertyAttribute::MAYBEVOID, 0 }, - { RTL_CONSTASCII_STRINGPARAM ( "PreviewPrintVerticalSpacing" ), HANDLE_PRINTSET_PREVIEW_VERTICAL_SPACING, CPPUTYPE_INT32, PropertyAttribute::MAYBEVOID, 0 }, - { RTL_CONSTASCII_STRINGPARAM ( "PreviewPrintNumRows" ), HANDLE_PRINTSET_PREVIEW_NUM_ROWS, CPPUTYPE_INT8, PropertyAttribute::MAYBEVOID, 0 }, - { RTL_CONSTASCII_STRINGPARAM ( "PreviewPrintNumColumns" ), HANDLE_PRINTSET_PREVIEW_NUM_COLUMNS, CPPUTYPE_INT8, PropertyAttribute::MAYBEVOID, 0 }, - { RTL_CONSTASCII_STRINGPARAM ( "PreviewPrintLandscape" ), HANDLE_PRINTSET_PREVIEW_LANDSCAPE, CPPUTYPE_BOOLEAN, PropertyAttribute::MAYBEVOID, 0 }, - { 0, 0, 0, CPPUTYPE_UNKNOWN, 0, 0 } - }; - return new ChainablePropertySetInfo ( aPrintPreviewSettingsMap_Impl ); -} -SwXPrintPreviewSettings::SwXPrintPreviewSettings( SwDoc *pDoc) -: ChainablePropertySet ( lcl_createPrintPreviewSettingsInfo (), &Application::GetSolarMutex() ) -, mbPreviewDataChanged( sal_False ) -, mpDoc( pDoc) -{ -} -/*-- 17.12.98 12:54:05--------------------------------------------------- - - -----------------------------------------------------------------------*/ -SwXPrintPreviewSettings::~SwXPrintPreviewSettings() - throw() -{ -} - -Any SAL_CALL SwXPrintPreviewSettings::queryInterface( const Type& rType ) - throw(RuntimeException) -{ - return ::cppu::queryInterface ( rType , - // OWeakObject interfaces - dynamic_cast< XInterface* >( dynamic_cast< OWeakObject* >(this) ) , - dynamic_cast< XWeak* >( this ) , - // my own interfaces - dynamic_cast< XServiceInfo* >( this ) , - dynamic_cast< XPropertySet* >( this ) , - dynamic_cast< XMultiPropertySet* >( this ) ); -} -void SwXPrintPreviewSettings::acquire () - throw () -{ - OWeakObject::acquire(); -} -void SwXPrintPreviewSettings::release () - throw () -{ - OWeakObject::release(); -} - -void SwXPrintPreviewSettings::_preSetValues () - throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) -{ - if ( mpDoc ) - { - const SwPagePreViewPrtData *pConstPrtData = mpDoc->GetPreViewPrtData(); - mpPreViewData = new SwPagePreViewPrtData; - if ( pConstPrtData ) - { - mpPreViewData->SetLeftSpace ( pConstPrtData->GetLeftSpace() ); - mpPreViewData->SetRightSpace ( pConstPrtData->GetRightSpace() ); - mpPreViewData->SetTopSpace ( pConstPrtData->GetTopSpace() ); - mpPreViewData->SetBottomSpace ( pConstPrtData->GetBottomSpace() ); - mpPreViewData->SetHorzSpace ( pConstPrtData->GetHorzSpace() ); - mpPreViewData->SetVertSpace ( pConstPrtData->GetVertSpace() ); - mpPreViewData->SetRow ( pConstPrtData->GetRow() ); - mpPreViewData->SetCol ( pConstPrtData->GetCol() ); - mpPreViewData->SetLandscape ( pConstPrtData->GetLandscape() ); - } - } -} - -void SwXPrintPreviewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, const uno::Any &rValue ) - throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) -{ - switch( rInfo.mnHandle ) - { - case HANDLE_PRINTSET_PREVIEW_LEFT_MARGIN: - { - sal_Int32 nVal = 0; - rValue >>= nVal; - nVal = MM100_TO_TWIP( nVal ); - if ( nVal != static_cast < sal_Int32 > (mpPreViewData->GetLeftSpace() ) ) - { - mbPreviewDataChanged = sal_True; - mpPreViewData->SetLeftSpace( nVal ); - } - } - break; - case HANDLE_PRINTSET_PREVIEW_RIGHT_MARGIN: - { - sal_Int32 nVal = 0; - rValue >>= nVal; - nVal = MM100_TO_TWIP( nVal ); - if ( nVal != static_cast < sal_Int32 > (mpPreViewData->GetRightSpace() ) ) - { - mbPreviewDataChanged = sal_True; - mpPreViewData->SetRightSpace( nVal ); - } - } - break; - case HANDLE_PRINTSET_PREVIEW_TOP_MARGIN: - { - sal_Int32 nVal = 0; - rValue >>= nVal; - nVal = MM100_TO_TWIP( nVal ); - if ( nVal != static_cast < sal_Int32 > ( mpPreViewData->GetTopSpace() ) ) - { - mbPreviewDataChanged = sal_True; - mpPreViewData->SetTopSpace( nVal ); - } - } - break; - case HANDLE_PRINTSET_PREVIEW_BOTTOM_MARGIN: - { - sal_Int32 nVal = 0; - rValue >>= nVal; - nVal = MM100_TO_TWIP( nVal ); - if ( nVal != static_cast < sal_Int32 > ( mpPreViewData->GetBottomSpace() ) ) - { - mbPreviewDataChanged = sal_True; - mpPreViewData->SetBottomSpace( nVal ); - } - } - break; - case HANDLE_PRINTSET_PREVIEW_HORIZONTAL_SPACING: - { - sal_Int32 nVal = 0; - rValue >>= nVal; - nVal = MM100_TO_TWIP( nVal ); - if ( nVal != static_cast < sal_Int32 > ( mpPreViewData->GetHorzSpace() ) ) - { - mbPreviewDataChanged = sal_True; - mpPreViewData->SetHorzSpace( nVal ); - } - } - break; - case HANDLE_PRINTSET_PREVIEW_VERTICAL_SPACING: - { - sal_Int32 nVal = 0; - rValue >>= nVal; - nVal = MM100_TO_TWIP( nVal ); - if ( nVal != static_cast < sal_Int32 > ( mpPreViewData->GetVertSpace() ) ) - { - mbPreviewDataChanged = sal_True; - mpPreViewData->SetVertSpace( nVal ); - } - } - break; - case HANDLE_PRINTSET_PREVIEW_NUM_ROWS: - { - sal_Int8 nVal = 0; - rValue >>= nVal; - if ( nVal != mpPreViewData->GetRow() ) - { - mbPreviewDataChanged = sal_True; - mpPreViewData->SetRow( nVal ); - } - } - break; - case HANDLE_PRINTSET_PREVIEW_NUM_COLUMNS: - { - sal_Int8 nVal = 0; - rValue >>= nVal; - if ( nVal != mpPreViewData->GetCol() ) - { - mbPreviewDataChanged = sal_True; - mpPreViewData->SetCol( nVal ); - } - } - break; - case HANDLE_PRINTSET_PREVIEW_LANDSCAPE: - { - sal_Bool bVal = *(sal_Bool*)rValue.getValue(); - if ( bVal != mpPreViewData->GetLandscape() ) - { - mbPreviewDataChanged = sal_True; - mpPreViewData->SetLandscape ( bVal ); - } - } - break; - default: - throw UnknownPropertyException(); - } -} -void SwXPrintPreviewSettings::_postSetValues () - throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) -{ - if ( mbPreviewDataChanged ) - { - mpDoc->SetPreViewPrtData ( mpPreViewData ); - mbPreviewDataChanged = sal_False; - } - delete mpPreViewData; - mpPreViewData = NULL; -} - -void SwXPrintPreviewSettings::_preGetValues () - throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) -{ - if (mpDoc) - mpConstPreViewData = mpDoc->GetPreViewPrtData(); -} -void SwXPrintPreviewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, uno::Any & rValue ) - throw(UnknownPropertyException, WrappedTargetException ) -{ - sal_Bool bBool = TRUE; - sal_Bool bBoolVal; - switch( rInfo.mnHandle ) - { - case HANDLE_PRINTSET_PREVIEW_LEFT_MARGIN: - { - bBool = FALSE; - if ( mpConstPreViewData ) - rValue <<= static_cast < sal_Int32 > ( TWIP_TO_MM100_UNSIGNED( mpConstPreViewData->GetLeftSpace() ) ); - } - break; - case HANDLE_PRINTSET_PREVIEW_RIGHT_MARGIN: - { - bBool = FALSE; - if ( mpConstPreViewData ) - rValue <<= static_cast < sal_Int32 > ( TWIP_TO_MM100_UNSIGNED( mpConstPreViewData->GetRightSpace() ) ); - } - break; - case HANDLE_PRINTSET_PREVIEW_TOP_MARGIN: - { - bBool = FALSE; - if ( mpConstPreViewData ) - rValue <<= static_cast < sal_Int32 > ( TWIP_TO_MM100_UNSIGNED( mpConstPreViewData->GetTopSpace() ) ); - } - break; - case HANDLE_PRINTSET_PREVIEW_BOTTOM_MARGIN: - { - bBool = FALSE; - if ( mpConstPreViewData ) - rValue <<= static_cast < sal_Int32 > ( TWIP_TO_MM100_UNSIGNED( mpConstPreViewData->GetBottomSpace() ) ); - } - break; - case HANDLE_PRINTSET_PREVIEW_HORIZONTAL_SPACING: - { - bBool = FALSE; - if ( mpConstPreViewData ) - rValue <<= static_cast < sal_Int32 > ( TWIP_TO_MM100_UNSIGNED( mpConstPreViewData->GetHorzSpace() ) ); - } - break; - case HANDLE_PRINTSET_PREVIEW_VERTICAL_SPACING: - { - bBool = FALSE; - if ( mpConstPreViewData ) - rValue <<= static_cast < sal_Int32 > ( TWIP_TO_MM100_UNSIGNED( mpConstPreViewData->GetVertSpace() ) ); - } - break; - case HANDLE_PRINTSET_PREVIEW_NUM_ROWS: - { - bBool = FALSE; - if ( mpConstPreViewData ) - rValue <<= static_cast < sal_Int8 > ( mpConstPreViewData->GetRow() ); - } - break; - case HANDLE_PRINTSET_PREVIEW_NUM_COLUMNS: - { - bBool = FALSE; - if ( mpConstPreViewData ) - rValue <<= static_cast < sal_Int8 > ( mpConstPreViewData->GetCol() ); - } - break; - case HANDLE_PRINTSET_PREVIEW_LANDSCAPE: - { - if (mpConstPreViewData) - bBoolVal = mpConstPreViewData->GetLandscape(); - else - bBool = FALSE; - } - break; - default: - throw UnknownPropertyException(); - } - if(bBool) - rValue.setValue(&bBoolVal, ::getBooleanCppuType()); -} -void SwXPrintPreviewSettings::_postGetValues () - throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) -{ - mpConstPreViewData = NULL; -} -/* -----------------------------06.04.00 11:02-------------------------------- - - ---------------------------------------------------------------------------*/ -OUString SwXPrintPreviewSettings::getImplementationName(void) throw( RuntimeException ) -{ - return OUString( RTL_CONSTASCII_USTRINGPARAM ( "SwXPrintPreviewSettings" ) ); -} -/* -----------------------------06.04.00 11:02-------------------------------- - - ---------------------------------------------------------------------------*/ -sal_Bool SwXPrintPreviewSettings::supportsService(const OUString& rServiceName) throw( RuntimeException ) -{ - return rServiceName.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "com.sun.star.text.PrintPreviewSettings") ); -} -/* -----------------------------06.04.00 11:02-------------------------------- - - ---------------------------------------------------------------------------*/ -Sequence< OUString > SwXPrintPreviewSettings::getSupportedServiceNames(void) throw( RuntimeException ) -{ - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.text.PrintPreviewSettings" ) ); - return aRet; -} - diff --git a/sw/source/ui/uno/SwXPrintPreviewSettings.hxx b/sw/source/ui/uno/SwXPrintPreviewSettings.hxx deleted file mode 100644 index 2b908c453043..000000000000 --- a/sw/source/ui/uno/SwXPrintPreviewSettings.hxx +++ /dev/null @@ -1,89 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SW_XPRINTPREVIEWSETTINGS_HXX_ -#define _SW_XPRINTPREVIEWSETTINGS_HXX_ - -#ifdef PRECOMPILED -#include "ui_pch.hxx" -#endif -#include <comphelper/ChainablePropertySet.hxx> -#ifndef _COM_SUN_STAR_TEXT_XTEXTDOCUMENT_HPP -#include <com/sun/star/text/XTextDocument.hpp> -#endif -#include <cppuhelper/weak.hxx> -#include <com/sun/star/lang/XServiceInfo.hpp> - -class SwDoc; -class SwPagePreViewPrtData; - -class SwXPrintPreviewSettings :public comphelper::ChainablePropertySet, - public cppu::OWeakObject, - public com::sun::star::lang::XServiceInfo -{ - friend class SwXDocumentSettings; -protected: - sal_Bool mbPreviewDataChanged; - SwDoc* mpDoc; - SwPagePreViewPrtData *mpPreViewData; - const SwPagePreViewPrtData *mpConstPreViewData; - - virtual void _preSetValues () - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ); - virtual void _setSingleValue( const comphelper::PropertyInfo & rInfo, const ::com::sun::star::uno::Any &rValue ) - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ); - virtual void _postSetValues () - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ); - - virtual void _preGetValues () - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ); - virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, ::com::sun::star::uno::Any & rValue ) - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException ); - virtual void _postGetValues () - throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException ); - virtual ~SwXPrintPreviewSettings() - throw(); -public: - SwXPrintPreviewSettings(SwDoc *pDoc); - - - // XInterface - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) - throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL acquire( ) - throw (); - virtual void SAL_CALL release( ) - throw (); - - //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) - throw( ::com::sun::star::uno::RuntimeException ); - virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) - throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) - throw( ::com::sun::star::uno::RuntimeException ); -}; -#endif diff --git a/sw/source/ui/uno/detreg.cxx b/sw/source/ui/uno/detreg.cxx index 8c5e5f0634f8..65f4e6379a17 100644 --- a/sw/source/ui/uno/detreg.cxx +++ b/sw/source/ui/uno/detreg.cxx @@ -43,30 +43,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( *ppEnvironmentTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ; } -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void* /*pServiceManager*/, - void* pRegistryKey ) -{ - Reference< ::registry::XRegistryKey > - xKey( reinterpret_cast< ::registry::XRegistryKey* >( pRegistryKey ) ) ; - - OUString aDelimiter( RTL_CONSTASCII_USTRINGPARAM("/") ); - OUString aUnoServices( RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ); - - // Eigentliche Implementierung und ihre Services registrieren - sal_Int32 i; - Reference< ::registry::XRegistryKey > xNewKey; - - xNewKey = xKey->createKey( aDelimiter + SwFilterDetect::impl_getStaticImplementationName() + - aUnoServices ); - - Sequence< OUString > aServices = SwFilterDetect::impl_getStaticSupportedServiceNames(); - for(i = 0; i < aServices.getLength(); i++ ) - xNewKey->createKey( aServices.getConstArray()[i] ); - - return sal_True; -} - SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, diff --git a/sw/source/ui/uno/makefile.mk b/sw/source/ui/uno/makefile.mk index 0023fd52f55c..ac4b6dde697b 100644..100755 --- a/sw/source/ui/uno/makefile.mk +++ b/sw/source/ui/uno/makefile.mk @@ -55,7 +55,6 @@ SLO1FILES = \ $(SLO)$/dlelstnr.obj \ $(SLO)$/unofreg.obj \ $(SLO)$/SwXDocumentSettings.obj \ - $(SLO)$/SwXPrintPreviewSettings.obj \ $(SLO)$/SwXFilterOptions.obj\ $(SLO)$/RefreshListenerContainer.obj \ $(SLO)$/unomodule.obj \ diff --git a/sw/source/ui/uno/unofreg.cxx b/sw/source/ui/uno/unofreg.cxx index a322b0e677f9..a76aaa3cd0e5 100644 --- a/sw/source/ui/uno/unofreg.cxx +++ b/sw/source/ui/uno/unofreg.cxx @@ -154,99 +154,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -static void lcl_uno_writeInfo( - registry::XRegistryKey * pRegistryKey, - const OUString& rImplementationName, - const uno::Sequence< OUString >& rServices ) -{ - uno::Reference< registry::XRegistryKey > xNewKey( - pRegistryKey->createKey( - OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + rImplementationName + OUString(RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES") ) ) ); - - for( sal_Int32 i = 0; i < rServices.getLength(); i++ ) - xNewKey->createKey( rServices.getConstArray()[i]); -} - -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void * /*pServiceManager*/, - void * pRegistryKey ) -{ - if( pRegistryKey ) - { - try - { - registry::XRegistryKey *pKey = - reinterpret_cast< registry::XRegistryKey * >( pRegistryKey ); - - - // xml filter - lcl_uno_writeInfo( pKey, SwXMLImport_getImplementationName(), - SwXMLImport_getSupportedServiceNames() ); - lcl_uno_writeInfo( pKey, SwXMLImportStyles_getImplementationName(), - SwXMLImportStyles_getSupportedServiceNames() ); - lcl_uno_writeInfo( pKey,SwXMLImportContent_getImplementationName(), - SwXMLImportContent_getSupportedServiceNames() ); - lcl_uno_writeInfo( pKey, SwXMLImportMeta_getImplementationName(), - SwXMLImportMeta_getSupportedServiceNames() ); - lcl_uno_writeInfo( pKey, SwXMLImportSettings_getImplementationName(), - SwXMLImportSettings_getSupportedServiceNames() ); - lcl_uno_writeInfo( pKey, SwXMLExportOOO_getImplementationName(), - SwXMLExportOOO_getSupportedServiceNames() ); - lcl_uno_writeInfo( pKey, SwXMLExportStylesOOO_getImplementationName(), - SwXMLExportStylesOOO_getSupportedServiceNames() ); - lcl_uno_writeInfo( pKey,SwXMLExportContentOOO_getImplementationName(), - SwXMLExportContentOOO_getSupportedServiceNames() ); - lcl_uno_writeInfo( pKey, SwXMLExportMetaOOO_getImplementationName(), - SwXMLExportMetaOOO_getSupportedServiceNames() ); - lcl_uno_writeInfo( pKey, SwXMLExportSettingsOOO_getImplementationName(), - SwXMLExportSettingsOOO_getSupportedServiceNames() ); - lcl_uno_writeInfo( pKey, SwXMLExport_getImplementationName(), - SwXMLExport_getSupportedServiceNames() ); - lcl_uno_writeInfo( pKey, SwXMLExportStyles_getImplementationName(), - SwXMLExportStyles_getSupportedServiceNames() ); - lcl_uno_writeInfo( pKey,SwXMLExportContent_getImplementationName(), - SwXMLExportContent_getSupportedServiceNames() ); - lcl_uno_writeInfo( pKey, SwXMLExportMeta_getImplementationName(), - SwXMLExportMeta_getSupportedServiceNames() ); - lcl_uno_writeInfo( pKey, SwXMLExportSettings_getImplementationName(), - SwXMLExportSettings_getSupportedServiceNames() ); - //API objects - lcl_uno_writeInfo( pKey, SwXAutoTextContainer_getImplementationName(), - SwXAutoTextContainer_getSupportedServiceNames() ); - lcl_uno_writeInfo( pKey, SwXModule_getImplementationName(), - SwXModule_getSupportedServiceNames() ); - lcl_uno_writeInfo( pKey, SwXMailMerge_getImplementationName(), - SwXMailMerge_getSupportedServiceNames() ); - //Filter options - lcl_uno_writeInfo( pKey, SwXFilterOptions::getImplementationName_Static(), - SwXFilterOptions::getSupportedServiceNames_Static() ); - - // documents - lcl_uno_writeInfo( pKey, SwTextDocument_getImplementationName(), - SwTextDocument_getSupportedServiceNames() ); - lcl_uno_writeInfo( pKey, SwWebDocument_getImplementationName(), - SwWebDocument_getSupportedServiceNames() ); - lcl_uno_writeInfo( pKey,SwGlobalDocument_getImplementationName(), - SwGlobalDocument_getSupportedServiceNames() ); - - // module - lcl_uno_writeInfo( pKey, SwUnoModule_getImplementationName(), - SwUnoModule_getSupportedServiceNames() ); - // --> OD 2007-05-24 #i73788# - lcl_uno_writeInfo( pKey, - comp_FinalThreadManager::_getImplementationName(), - comp_FinalThreadManager::_getSupportedServiceNames() ); - // <-- - - } - catch (registry::InvalidRegistryException &) - { - OSL_ENSURE( sal_False, "### InvalidRegistryException!" ); - } - } - return sal_True; -} - static ::cppu::ImplementationEntry const entries[] = { { &comp_FinalThreadManager::_create, &comp_FinalThreadManager::_getImplementationName, diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 0579d180a04c..eb2f5d7d67d2 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -82,6 +82,7 @@ #include <svx/xmleohlp.hxx> #include <globals.hrc> #include <unomid.h> +#include <unotools/printwarningoptions.hxx> #include <com/sun/star/util/SearchOptions.hpp> #include <com/sun/star/lang/ServiceNotRegisteredException.hpp> @@ -107,7 +108,6 @@ #include <swcont.hxx> #include <unodefaults.hxx> #include <SwXDocumentSettings.hxx> -#include <SwXPrintPreviewSettings.hxx> #include <doc.hxx> #include <editeng/forbiddencharacterstable.hxx> #include <svl/zforlist.hxx> @@ -1809,9 +1809,7 @@ Reference< XInterface > SwXTextDocument::createInstance(const OUString& rServic } else if (sCategory == C2U ("text") ) { - if( 0 == rServiceName.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.PrintPreviewSettings") ) ) - xRet = Reference < XInterface > ( *new SwXPrintPreviewSettings ( pDocShell->GetDoc() ) ); - else if( 0 == rServiceName.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.DocumentSettings") ) ) + if( 0 == rServiceName.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.DocumentSettings") ) ) xRet = Reference < XInterface > ( *new SwXDocumentSettings ( this ) ); } else if (sCategory == C2U ("chart2") ) @@ -2732,10 +2730,21 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount( // since printing now also use the API for PDF export this option // should be set for printing as well ... pWrtShell->SetPDFExportOption( sal_True ); + bool bOrigStatus = pRenderDocShell->IsEnableSetModified(); + // check configuration: shall update of printing information in DocInfo set the document to "modified"? + bool bStateChanged = false; + if ( bOrigStatus && !SvtPrintWarningOptions().IsModifyDocumentOnPrintingAllowed() ) + { + pRenderDocShell->EnableSetModified( sal_False ); + bStateChanged = true; + } + // --> FME 2005-05-23 #122919# Force field update before PDF export: pWrtShell->ViewShell::UpdateFlds(TRUE); // <-- + if( bStateChanged ) + pRenderDocShell->EnableSetModified( sal_True ); // there is some redundancy between those two function calls, but right now // there is no time to sort this out. @@ -2844,7 +2853,10 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer( uno::Sequence< beans::PropertyValue > aRenderer; if (m_pRenderData) { - const USHORT nPage = nRenderer + 1; + // --> TL, OD 2010-09-07 #i114210# + // determine the correct page number from the renderer index + const USHORT nPage = m_pRenderData->GetPagesToPrint()[ nRenderer ]; + // <-- // get paper tray to use ... sal_Int32 nPrinterPaperTray = -1; diff --git a/sw/source/ui/vba/service.cxx b/sw/source/ui/vba/service.cxx index 9f9cbff204dd..d7779fc653be 100644 --- a/sw/source/ui/vba/service.cxx +++ b/sw/source/ui/vba/service.cxx @@ -66,16 +66,6 @@ extern "C" *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } - sal_Bool SAL_CALL component_writeInfo( - lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey ) - { - OSL_TRACE("In component_writeInfo"); - - // Component registration - return component_writeInfoHelper( pServiceManager, pRegistryKey, - globals::serviceDecl, document::serviceDecl, wrapformat::serviceDecl, vbaeventshelper::serviceDecl ); - } - void * SAL_CALL component_getFactory( const sal_Char * pImplName, lang::XMultiServiceFactory * pServiceManager, registry::XRegistryKey * pRegistryKey ) diff --git a/sw/util/makefile.mk b/sw/util/makefile.mk index ce1419b34065..6fa4bd5432e2 100644 --- a/sw/util/makefile.mk +++ b/sw/util/makefile.mk @@ -374,3 +374,23 @@ SHL5LIBS=$(SLB)$/$(TARGET_VBA).lib .ENDIF # .IF "$(ENABLE_VBA)" == "YES" .INCLUDE : target.mk + +ALLTAR : $(MISC)/sw.component $(MISC)/swd.component $(MISC)/vbaswobj.component + +$(MISC)/sw.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + sw.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt sw.component + +$(MISC)/swd.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + swd.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt swd.component + +$(MISC)/vbaswobj.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + vbaswobj.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL5TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt vbaswobj.component diff --git a/sw/util/sw.component b/sw/util/sw.component new file mode 100644 index 000000000000..e76cec637d33 --- /dev/null +++ b/sw/util/sw.component @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="SwXAutoTextContainer"> + <service name="com.sun.star.text.AutoTextContainer"/> + </implementation> + <implementation name="SwXMailMerge"> + <service name="com.sun.star.sdb.DataAccessDescriptor"/> + <service name="com.sun.star.text.MailMerge"/> + </implementation> + <implementation name="SwXModule"> + <service name="com.sun.star.text.GlobalSettings"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.FilterOptionsDialog"> + <service name="com.sun.star.ui.dialogs.FilterOptionsDialog"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.GlobalDocument"> + <service name="com.sun.star.text.GlobalDocument"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.TextDocument"> + <service name="com.sun.star.text.TextDocument"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.WebDocument"> + <service name="com.sun.star.text.WebDocument"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.WriterModule"> + <service name="com.sun.star.text.ModuleDispatcher"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.XMLContentExporter"> + <service name="com.sun.star.comp.Writer.XMLContentExporter"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.XMLExporter"> + <service name="com.sun.star.comp.Writer.XMLExporter"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.XMLMetaExporter"> + <service name="com.sun.star.comp.Writer.XMLMetaExporter"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.XMLOasisContentExporter"> + <service name="com.sun.star.comp.Writer.XMLOasisContentExporter"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.XMLOasisContentImporter"> + <service name="com.sun.star.comp.Writer.XMLOasisContentImporter"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.XMLOasisExporter"> + <service name="com.sun.star.comp.Writer.XMLOasisExporter"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.XMLOasisImporter"> + <service name="com.sun.star.comp.Writer.XMLOasisImporter"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.XMLOasisMetaExporter"> + <service name="com.sun.star.comp.Writer.XMLOasisMetaExporter"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.XMLOasisMetaImporter"> + <service name="com.sun.star.comp.Writer.XMLOasisMetaImporter"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.XMLOasisSettingsExporter"> + <service name="com.sun.star.comp.Writer.XMLOasisSettingsExporter"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.XMLOasisSettingsImporter"> + <service name="com.sun.star.comp.Writer.XMLOasisSettingsImporter"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.XMLOasisStylesExporter"> + <service name="com.sun.star.comp.Writer.XMLOasisStylesExporter"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.XMLOasisStylesImporter"> + <service name="com.sun.star.comp.Writer.XMLOasisStylesImporter"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.XMLSettingsExporter"> + <service name="com.sun.star.comp.Writer.XMLSettingsExporter"/> + </implementation> + <implementation name="com.sun.star.comp.Writer.XMLStylesExporter"> + <service name="com.sun.star.comp.Writer.XMLStylesExporter"/> + </implementation> + <implementation name="com.sun.star.util.comp.FinalThreadManager"> + <service name="com.sun.star.util.JobManager"/> + </implementation> +</component> diff --git a/sw/util/swd.component b/sw/util/swd.component new file mode 100644 index 000000000000..c89c007ec30a --- /dev/null +++ b/sw/util/swd.component @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.writer.FormatDetector"> + <service name="com.sun.star.frame.ExtendedTypeDetection"/> + <service name="com.sun.star.text.FormatDetector"/> + <service name="com.sun.star.text.W4WFormatDetector"/> + </implementation> +</component> diff --git a/sw/util/vbaswobj.component b/sw/util/vbaswobj.component new file mode 100644 index 000000000000..e6c6fe4a4149 --- /dev/null +++ b/sw/util/vbaswobj.component @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!--********************************************************************** +* +* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +* +* Copyright 2000, 2010 Oracle and/or its affiliates. +* +* OpenOffice.org - a multi-platform office productivity suite +* +* This file is part of OpenOffice.org. +* +* OpenOffice.org is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License version 3 +* only, as published by the Free Software Foundation. +* +* OpenOffice.org is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License version 3 for more details +* (a copy is included in the LICENSE file that accompanied this code). +* +* You should have received a copy of the GNU Lesser General Public License +* version 3 along with OpenOffice.org. If not, see +* <http://www.openoffice.org/license.html> +* for a copy of the LGPLv3 License. +* +**********************************************************************--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="SwVbaDocument"> + <service name="ooo.vba.word.Document"/> + </implementation> + <implementation name="SwVbaEventsHelper"> + <service name="com.sun.star.document.vba.VBATextEventProcessor"/> + </implementation> + <implementation name="SwVbaGlobals"> + <service name="ooo.vba.word.Globals"/> + </implementation> + <implementation name="SwVbaWrapFormat"> + <service name="ooo.vba.word.WrapFormat"/> + </implementation> +</component> |