summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basic/source/app/app.cxx9
-rw-r--r--basic/source/app/makefile.mk1
-rw-r--r--basic/source/app/printer.cxx98
-rw-r--r--basic/source/app/printer.hxx22
-rw-r--r--basic/source/runtime/basrdll.cxx2
-rw-r--r--linguistic/source/gciterator.cxx3
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu10
-rw-r--r--officecfg/registry/data/org/openoffice/VCL.xcu8
-rw-r--r--sfx2/inc/sfx2/event.hxx19
-rw-r--r--sfx2/inc/sfx2/objsh.hxx2
-rw-r--r--sfx2/inc/sfx2/prnmon.hxx12
-rw-r--r--sfx2/inc/sfx2/sfxbasecontroller.hxx4
-rw-r--r--sfx2/inc/sfx2/sfxsids.hrc2
-rw-r--r--sfx2/inc/sfx2/viewfrm.hxx2
-rw-r--r--sfx2/inc/sfx2/viewsh.hxx9
-rw-r--r--sfx2/source/appl/appopen.cxx2
-rw-r--r--sfx2/source/control/shell.cxx2
-rw-r--r--sfx2/source/doc/objcont.cxx79
-rwxr-xr-xsfx2/source/doc/printhelper.cxx92
-rw-r--r--sfx2/source/view/makefile.mk3
-rw-r--r--sfx2/source/view/printer.cxx14
-rw-r--r--sfx2/source/view/prnmon.cxx6
-rw-r--r--sfx2/source/view/topfrm.cxx2
-rw-r--r--sfx2/source/view/viewfrm.cxx14
-rw-r--r--sfx2/source/view/viewimp.hxx4
-rw-r--r--sfx2/source/view/viewprn.cxx816
-rw-r--r--sfx2/source/view/viewsh.cxx23
-rw-r--r--svx/inc/fmhelp.hrc4
-rwxr-xr-x[-rw-r--r--]svx/inc/svx/svdpntv.hxx9
-rw-r--r--svx/source/dialog/fntctrl.cxx2
-rwxr-xr-x[-rw-r--r--]svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx12
-rw-r--r--svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx49
-rwxr-xr-x[-rw-r--r--]svx/source/svdraw/svdpntv.cxx3
33 files changed, 672 insertions, 667 deletions
diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx
index 31385f2f6e9e..4cc2765604fd 100644
--- a/basic/source/app/app.cxx
+++ b/basic/source/app/app.cxx
@@ -1401,19 +1401,10 @@ long BasicFrame::Command( short nID, BOOL bChecked )
// InitMenu(GetMenuBar()->GetPopupMenu( RID_APPRUN ));
break;
case RID_FILEPRINT:
-#ifndef UNX
if( pWork )
pPrn->Print( pWork->GetText(), pWork->pDataEdit->GetText(), this );
-#else
- InfoBox( this, SttResId( IDS_NOPRINTERERROR ) ).Execute();
-#endif
break;
case RID_FILESETUP:
-#ifndef UNX
- pPrn->Setup();
-#else
- InfoBox( this, SttResId( IDS_NOPRINTERERROR ) ).Execute();
-#endif
break;
case RID_QUIT:
if( Close() ) aBasicApp.Quit();
diff --git a/basic/source/app/makefile.mk b/basic/source/app/makefile.mk
index 13c3b4a8b507..3a52f402b329 100644
--- a/basic/source/app/makefile.mk
+++ b/basic/source/app/makefile.mk
@@ -61,6 +61,7 @@ OBJFILES = \
EXCEPTIONSFILES = \
$(OBJ)$/app.obj \
+ $(OBJ)$/printer.obj \
$(OBJ)$/process.obj
.IF "$(GUI)" == "WNT"
diff --git a/basic/source/app/printer.cxx b/basic/source/app/printer.cxx
index 6f173fd53ffa..61879d628d39 100644
--- a/basic/source/app/printer.cxx
+++ b/basic/source/app/printer.cxx
@@ -64,35 +64,32 @@ public:
void ChangeMessage( short );
};
-BasicPrinter::BasicPrinter() : Printer()
+BasicPrinter::BasicPrinter() : mpPrinter( new Printer() )
{
nPage = 0; nLine = 9999;
- SetMapMode( MapMode( MAP_POINT ) );
- Size s( GetOutputSize() );
+ mpPrinter->SetMapMode( MapMode( MAP_POINT ) );
+ Size s( mpPrinter->GetOutputSize() );
// Use 10 point font
Font aFont( FAMILY_MODERN, Size( 0, 10 ) );
aFont.SetPitch( PITCH_FIXED );
- SetFont( aFont );
+ mpPrinter->SetFont( aFont );
// Output: 6 Lines/Inch = 12 Point
nLines = (short) s.Height() / 12;
nYoff = 12;
- SetStartPrintHdl( LINK( this, BasicPrinter, StartPrintHdl ) );
- SetEndPrintHdl( LINK( this, BasicPrinter, EndPrintHdl ) );
- SetPrintPageHdl( LINK( this, BasicPrinter, PrintPageHdl ) );
}
void BasicPrinter::Header()
{
- if( nPage ) EndPage();
+ if( nPage ) mpListener->EndPage();
nPage++;
- StartPage();
+ mpListener->StartPage();
String aHdr;
String aPage( SttResId( IDS_PAGE ) );
aPage.Append( String::CreateFromInt32(nPage) );
aHdr = aFile.Copy( 0, 80 - aPage.Len() );
aHdr.Expand( 80 - aPage.Len(), ' ' );
aHdr += aPage;
- DrawText( Point( 0, 0 ), aHdr );
+ mpPrinter->DrawText( Point( 0, 0 ), aHdr );
nLine = 2;
}
@@ -100,98 +97,29 @@ void BasicPrinter::Print( const String& rFile, const String& rText, BasicFrame *
{
nPage = 0; nLine = 9999;
aFile = rFile;
- // Setup dialog
- SttResId aResId( IDD_PRINT_DIALOG );
- pDlg = new PrintingDialog
- ( aBasicApp.pFrame, this, aResId, aFile );
- // Set position of dialog
- Size s1 = aBasicApp.pFrame->GetSizePixel();
- Size s2 = pDlg->GetSizePixel();
- pDlg->SetPosPixel( Point( (s1.Width() - s2.Width() ) / 2,
- (s1.Height()- s2.Height() ) / 2 ) );
// Disable PRINT-Menu
MenuBar* pBar = pFrame->GetMenuBar();
Menu* pFileMenu = pBar->GetPopupMenu( RID_APPFILE );
pFileMenu->EnableItem( RID_FILEPRINT, FALSE );
- pDlg->ChangeMessage( 1 );
- pDlg->Show();
- StartJob( rFile );
- StartPage();
+ mpListener.reset( new vcl::OldStylePrintAdaptor( mpPrinter ) );
+ mpListener->StartPage();
xub_StrLen nDone=0;
while( nDone < rText.Len() )
{
if( nLine >= nLines ) Header();
xub_StrLen nLineEnd = std::min( rText.Search( '\n', nDone ), rText.Search( '\r', nDone ) );
- DrawText( Point( 0, nLine * nYoff ), rText, nDone, nLineEnd-nDone-1 );
+ mpPrinter->DrawText( Point( 0, nLine * nYoff ), rText, nDone, nLineEnd-nDone-1 );
nDone = nLineEnd;
if( nDone <= rText.Len() && rText.GetChar(nDone) == '\r' ) nDone++;
if( nDone <= rText.Len() && rText.GetChar(nDone) == '\n' ) nDone++;
nLine++;
- Application::Reschedule();
}
- EndPage();
- EndJob();
+ mpListener->EndPage();
+
+ Printer::PrintJob( mpListener, mpPrinter->GetJobSetup() );
nPage = 1;
- while( IsPrinting() ) Application::Reschedule();
- delete pDlg; pDlg = NULL;
pFileMenu->EnableItem( RID_FILEPRINT, TRUE );
}
-IMPL_LINK_INLINE_START( BasicPrinter, StartPrintHdl, Printer *, pPrinter )
-{
- (void) pPrinter; /* avoid warning about unused parameter */
- if( pDlg != NULL )
- pDlg->Show();
- return 0;
-}
-IMPL_LINK_INLINE_END( BasicPrinter, StartPrintHdl, Printer *, pPrinter )
-
-IMPL_LINK_INLINE_START( BasicPrinter, EndPrintHdl, Printer *, pPrinter )
-{
- (void) pPrinter; /* avoid warning about unused parameter */
- if( pDlg != NULL)
- pDlg->Hide();
- return 0;
-}
-IMPL_LINK_INLINE_END( BasicPrinter, EndPrintHdl, Printer *, pPrinter )
-
-IMPL_LINK_INLINE_START( BasicPrinter, PrintPageHdl, Printer *, pPrinter )
-{
- (void) pPrinter; /* avoid warning about unused parameter */
- if( pDlg != NULL)
- pDlg->ChangeMessage( nPage );
- return 0;
-}
-IMPL_LINK_INLINE_END( BasicPrinter, PrintPageHdl, Printer *, pPrinter )
-
-IMPL_LINK_INLINE( BasicPrinter, Abort , void *, EMPTYARG,
-{
- AbortJob();
- return 0L;
-}
-)
-
-/////////////////////////////////////////////////////////////////////////
-
-PrintingDialog::PrintingDialog
- ( Window* pParent, BasicPrinter* pPrn, ResId& rId, String& rName )
-: ModelessDialog( pParent, rId )
-, aName ( rName )
-, aText ( this, ResId( RID_TEXT, *rId.GetResMgr() ) )
-, aCancel( this, ResId( RID_CANCEL, *rId.GetResMgr() ) )
-{
- FreeResource();
- aCancel.SetClickHdl( LINK( pPrn, BasicPrinter, Abort ) );
-}
-
-void PrintingDialog::ChangeMessage( short nPage )
-{
- String aMsg( SttResId( IDS_PRINTMSG ) );
- aMsg += aName;
- aMsg += CUniString("\n");
- aMsg += String( SttResId( IDS_PAGE ) );
- aMsg += String::CreateFromInt32( nPage );
- aText.SetText( aMsg );
-}
diff --git a/basic/source/app/printer.hxx b/basic/source/app/printer.hxx
index d6db8154c57f..26b89b5278fe 100644
--- a/basic/source/app/printer.hxx
+++ b/basic/source/app/printer.hxx
@@ -31,31 +31,25 @@
#ifndef _BASICPRN_HXX
#define _BASICPRN_HXX
-#ifndef _PRINT_HXX //autogen
-#include <vcl/print.hxx>
-#endif
+#include "vcl/print.hxx"
+#include "vcl/oldprintadaptor.hxx"
-class PrintingDialog;
+class BasicPrinter
+{
+ boost::shared_ptr<Printer> mpPrinter;
+ boost::shared_ptr<vcl::OldStylePrintAdaptor> mpListener;
-class BasicPrinter : public Printer {
short nLine; // aktuelle Zeile
short nPage; // aktuelle Seite
short nLines; // Zeilen pro Seite
short nYoff; // Zeilenabstand in Points
String aFile; // Dateiname
- PrintingDialog* pDlg; // Druck-Dialog
+
void Header(); // Seitenkopf drucken
+ void StartPage();
public:
BasicPrinter();
void Print( const String& rFile, const String& rText, BasicFrame *pFrame );
- DECL_LINK( Abort, void * );
- DECL_LINK( StartPrintHdl, Printer * );
- DECL_LINK( EndPrintHdl, Printer * );
- DECL_LINK( PrintPageHdl, Printer * );
-#if defined( PM20 )
- // StarView-Bug, bald wieder zu entfernen:
- virtual void SetPageQueueSize( USHORT ) {}
-#endif
};
#endif
diff --git a/basic/source/runtime/basrdll.cxx b/basic/source/runtime/basrdll.cxx
index aa3fda6a7116..a13569ee0a9f 100644
--- a/basic/source/runtime/basrdll.cxx
+++ b/basic/source/runtime/basrdll.cxx
@@ -32,9 +32,7 @@
#include "precompiled_basic.hxx"
#include <tools/shl.hxx>
#include <vcl/svapp.hxx>
-#ifndef _SOLAR_HRC
#include <svl/solar.hrc>
-#endif
#include <tools/debug.hxx>
#include <vcl/msgbox.hxx>
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index 2697d5880b80..49975ad6e626 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -578,7 +578,8 @@ void GrammarCheckingIterator::DequeueAndCheck()
sal_Int32 nStartPos = aFPEntryItem.m_nStartIndex;
sal_Int32 nSuggestedEnd = GetSuggestedEndOfSentence( aCurTxt, nStartPos, aCurLocale );
- DBG_ASSERT( nSuggestedEnd > nStartPos, "nSuggestedEndOfSentencePos calculation failed?" );
+ DBG_ASSERT( (nSuggestedEnd == 0 && aCurTxt.getLength() == 0) || nSuggestedEnd > nStartPos,
+ "nSuggestedEndOfSentencePos calculation failed?" );
linguistic2::ProofreadingResult aRes;
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 0ba86ef6b1aa..fa0611e07041 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -77,14 +77,6 @@
<value xml:lang="en-US">Foote~r</value>
</prop>
</node>
- <node oor:name=".uno:PreviewPrintOptions" oor:op="replace">
- <prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Print options page view</value>
- </prop>
- <prop oor:name="Properties" oor:type="xs:int">
- <value>1</value>
- </prop>
- </node>
<node oor:name=".uno:PreviewZoom" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Preview Zoom</value>
@@ -911,7 +903,7 @@
</node>
<node oor:name=".uno:PrintPagePreView" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">Print page view</value>
+ <value xml:lang="en-US">Print document</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
diff --git a/officecfg/registry/data/org/openoffice/VCL.xcu b/officecfg/registry/data/org/openoffice/VCL.xcu
index 2a17b4ecdd55..10dced44e44e 100644
--- a/officecfg/registry/data/org/openoffice/VCL.xcu
+++ b/officecfg/registry/data/org/openoffice/VCL.xcu
@@ -48,6 +48,14 @@
<value>false</value>
</prop>
</node>
+ <node oor:name="PrintDialog" oor:op="replace">
+ <prop oor:name="Collate" oor:op="replace" oor:type="xs:string">
+ <value>true</value>
+ </prop>
+ <prop oor:name="CollateBox" oor:op="replace" oor:type="xs:string">
+ <value>Default</value>
+ </prop>
+ </node>
</node>
<node oor:name="DefaultFonts">
<node oor:name="en" oor:op="replace">
diff --git a/sfx2/inc/sfx2/event.hxx b/sfx2/inc/sfx2/event.hxx
index 10e586030f52..79f1d34ee82c 100644
--- a/sfx2/inc/sfx2/event.hxx
+++ b/sfx2/inc/sfx2/event.hxx
@@ -102,30 +102,21 @@ class PrintDialog;
class Printer;
class SfxPrintingHint : public SfxHint
{
- PrintDialog* pDialog;
- Printer* pPrinter;
sal_Int32 nWhich;
com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aOpts;
public:
TYPEINFO();
- SfxPrintingHint( sal_Int32 nEvent, PrintDialog* pDlg, Printer* pPrt, const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& rOpts )
- : pDialog( pDlg )
- , pPrinter( pPrt )
- , nWhich( nEvent )
+ SfxPrintingHint( sal_Int32 nEvent, const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& rOpts )
+ : nWhich( nEvent )
, aOpts( rOpts )
{}
- SfxPrintingHint( sal_Int32 nEvent, PrintDialog* pDlg, Printer* pPrt )
- : pDialog( pDlg )
- , pPrinter( pPrt )
- , nWhich( nEvent )
+ SfxPrintingHint( sal_Int32 nEvent )
+ : nWhich( nEvent )
{}
-
- Printer* GetPrinter() const { return pPrinter; }
- PrintDialog* GetPrintDialog() const { return pDialog; }
sal_Int32 GetWhich() const { return nWhich; }
- const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& GetAdditionalOptions() { return aOpts; }
+ const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& GetOptions() { return aOpts; }
};
#endif
diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx
index cc525f4acd7d..f81be0aa7bba 100644
--- a/sfx2/inc/sfx2/objsh.hxx
+++ b/sfx2/inc/sfx2/objsh.hxx
@@ -593,7 +593,7 @@ public:
sal_uInt16 nIdx2 = INDEX_IGNORE,
sal_uInt16 nIdx3 = INDEX_IGNORE);
- virtual sal_Bool Print( Printer &rPrt,
+ sal_Bool Print( Printer &rPrt,
sal_uInt16 nIdx1,
sal_uInt16 nIdx2 = INDEX_IGNORE,
sal_uInt16 nIdx3 = INDEX_IGNORE,
diff --git a/sfx2/inc/sfx2/prnmon.hxx b/sfx2/inc/sfx2/prnmon.hxx
index ad47f6ce2633..376a599edef4 100644
--- a/sfx2/inc/sfx2/prnmon.hxx
+++ b/sfx2/inc/sfx2/prnmon.hxx
@@ -33,17 +33,13 @@
#include "sal/config.h"
#include "sfx2/dllapi.h"
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _DIALOG_HXX //autogen
#include <vcl/dialog.hxx>
-#endif
#include <sfx2/printer.hxx>
-#include <sfx2/progress.hxx>
+//#include <sfx2/progress.hxx>
class SfxViewShell;
-class SfxProgress;
+//class SfxProgress;
struct SfxPrintProgress_Impl;
// ------------------------------------------------------------------------
@@ -51,7 +47,7 @@ struct SfxPrintProgress_Impl;
#define PAGE_MAX 9999 //max. Anzahl der Seiten die gedruckt werden
//--------------------------------------------------------------------
-
+/*
class SFX2_DLLPUBLIC SfxPrintProgress: public SfxProgress
{
SfxPrintProgress_Impl* pImp;
@@ -78,7 +74,7 @@ public:
void SetCancelHdl( const Link& aCancelHdl );
BOOL IsAborted() const;
};
-
+*/
// ------------------------------------------------------------------------
struct SfxPrintOptDlg_Impl;
diff --git a/sfx2/inc/sfx2/sfxbasecontroller.hxx b/sfx2/inc/sfx2/sfxbasecontroller.hxx
index c952e550996e..3debe10f001d 100644
--- a/sfx2/inc/sfx2/sfxbasecontroller.hxx
+++ b/sfx2/inc/sfx2/sfxbasecontroller.hxx
@@ -493,7 +493,9 @@ public:
virtual void SAL_CALL removeTitleChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XTitleChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
//#if 0 // _SOLAR__PRIVATE
- SAL_DLLPRIVATE SfxViewShell* GetViewShell_Impl() const;
+ // FIXME: TL needs this in sw/source/ui/uno/unotxdoc.cxx now;
+ // either the _Impl name should vanish or there should be an "official" API
+ SfxViewShell* GetViewShell_Impl() const;
SAL_DLLPRIVATE BOOL HandleEvent_Impl( NotifyEvent& rEvent );
SAL_DLLPRIVATE BOOL HasKeyListeners_Impl();
SAL_DLLPRIVATE BOOL HasMouseClickListeners_Impl();
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc
index 32e31e782675..bcbb39c96638 100644
--- a/sfx2/inc/sfx2/sfxsids.hrc
+++ b/sfx2/inc/sfx2/sfxsids.hrc
@@ -873,7 +873,7 @@
#define SID_HELP_PI (SID_SFX_START + 962)
#define SID_BASIC_ENABLED (SID_SFX_START + 964)
#define SID_EXPORT_DIALOG (SID_SFX_START + 965)
-#define SID_IMPORT_DIALOG (SID_SFX_START + 966)
+#define SID_IMPORT_DIALOG (SID_SFX_START + 966)
#define SID_BASICBREAK (SID_SFX_START +1521)
diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx
index 0fa9b92de7fc..396a948a03cc 100644
--- a/sfx2/inc/sfx2/viewfrm.hxx
+++ b/sfx2/inc/sfx2/viewfrm.hxx
@@ -212,7 +212,7 @@ public:
const Point &rPos, const Size &rSize );
void Hide();
void Show();
- BOOL IsVisible_Impl() const;
+ BOOL IsVisible() const;
void ToTop();
void Enable( BOOL bEnable );
virtual BOOL Close();
diff --git a/sfx2/inc/sfx2/viewsh.hxx b/sfx2/inc/sfx2/viewsh.hxx
index 83ac73dbdd80..e3a5ae5adb8e 100644
--- a/sfx2/inc/sfx2/viewsh.hxx
+++ b/sfx2/inc/sfx2/viewsh.hxx
@@ -35,6 +35,7 @@
#include "sal/types.h"
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/view/XRenderable.hpp>
#include <com/sun/star/uno/Reference.h>
#include <svl/lstner.hxx>
#include <com/sun/star/ui/XContextMenuInterceptor.hpp>
@@ -43,6 +44,7 @@
#include "shell.hxx"
#include <tools/gen.hxx>
#include <tools/errcode.hxx>
+#include <vcl/jobset.hxx>
class SfxBaseController;
class Size;
class Fraction;
@@ -269,6 +271,7 @@ public:
virtual PrintDialog* CreatePrintDialog( Window *pParent );
void LockPrinter( BOOL bLock = TRUE );
BOOL IsPrinterLocked() const;
+ virtual JobSetup GetJobSetup() const;
// Workingset
virtual void WriteUserData( String&, BOOL bBrowse = FALSE );
@@ -289,6 +292,11 @@ public:
*/
void SetCurrentDocument() const;
+ /** get an XRenderable instance that can render this docuement
+ */
+ virtual com::sun::star::uno::Reference< com::sun::star::view::XRenderable > GetRenderable();
+
+
virtual void MarginChanged();
const Size& GetMargin() const;
void SetMargin( const Size& );
@@ -305,6 +313,7 @@ public:
BOOL TryContextMenuInterception( Menu& rIn, const ::rtl::OUString& rMenuIdentifier, Menu*& rpOut, ::com::sun::star::ui::ContextMenuExecuteEvent aEvent );
void SetAdditionalPrintOptions( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& );
+ void ExecPrint( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >&, sal_Bool, sal_Bool );
void AddRemoveClipboardListener( const com::sun::star::uno::Reference < com::sun::star::datatransfer::clipboard::XClipboardListener>&, BOOL );
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index bf3cb633cf6a..469a198db64e 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -216,7 +216,7 @@ SfxObjectShellRef SfxApplication::DocAlreadyLoaded
SfxTopViewFrame *pFrame;
for( pFrame = (SfxTopViewFrame*)
SfxViewFrame::GetFirst( xDoc, TYPE(SfxTopViewFrame) );
- pFrame && !pFrame->IsVisible_Impl();
+ pFrame && !pFrame->IsVisible();
pFrame = (SfxTopViewFrame*)
SfxViewFrame::GetNext( *pFrame, xDoc, TYPE(SfxTopViewFrame) ) ) ;
if ( pFrame )
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index 7c88c4bef24a..aee76353f1f3 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -1260,7 +1260,7 @@ long DispatcherUpdate_Impl( void*, void* pArg )
void SfxShell::UIFeatureChanged()
{
SfxViewFrame *pFrame = GetFrame();
- if ( pFrame && pFrame->IsVisible_Impl() )
+ if ( pFrame && pFrame->IsVisible() )
{
// Auch dann Update erzwingen, wenn Dispatcher schon geupdated ist,
// sonst bleibt evtl. irgendwas in den gebunkerten Tools stecken.
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 6883f0976566..8514ca9a917a 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -62,6 +62,7 @@
#include <unotools/useroptions.hxx>
#include <unotools/localfilehelper.hxx>
#include <vcl/virdev.hxx>
+#include <vcl/oldprintadaptor.hxx>
#include <sfx2/app.hxx>
#include "sfxresid.hxx"
@@ -1031,26 +1032,18 @@ BOOL SfxObjectShell::Print
if ( !pStyle )
return TRUE;
- if ( !rPrt.StartJob(String(SfxResId(STR_STYLES))) )
- {
- delete pIter;
- return FALSE;
- }
- if ( !rPrt.StartPage() )
- {
- delete pIter;
- return FALSE;
- }
- Reference< task::XStatusIndicator > xStatusIndicator;
- xStatusIndicator = SFX_APP()->GetStatusIndicator();
- if ( xStatusIndicator.is() )
- xStatusIndicator->start( String(SfxResId(STR_PRINT_STYLES)), nStyles );
+ // pepare adaptor for old style StartPage/EndPage printing
+ boost::shared_ptr< Printer > pPrinter( new Printer( rPrt.GetJobSetup() ) );
+ vcl::OldStylePrintAdaptor* pAdaptor = new vcl::OldStylePrintAdaptor( pPrinter );
+ boost::shared_ptr< vcl::PrinterController > pController( pAdaptor );
- rPrt.SetMapMode(MapMode(MAP_10TH_MM));
+ pAdaptor->StartPage();
+
+ pPrinter->SetMapMode(MapMode(MAP_10TH_MM));
Font aFont( DEFINE_CONST_UNICODE( "Arial" ), Size(0, 64)); // 18pt
aFont.SetWeight(WEIGHT_BOLD);
- rPrt.SetFont(aFont);
- const Size aPageSize(rPrt.GetOutputSize());
+ pPrinter->SetFont(aFont);
+ const Size aPageSize(pPrinter->GetOutputSize());
const USHORT nXIndent = 200;
USHORT nYIndent = 200;
Point aOutPos(nXIndent, nYIndent);
@@ -1059,68 +1052,66 @@ BOOL SfxObjectShell::Print
aHeader += *pObjectName;
else
aHeader += GetTitle();
- long nTextHeight( rPrt.GetTextHeight() );
- rPrt.DrawText(aOutPos, aHeader);
+ long nTextHeight( pPrinter->GetTextHeight() );
+ pPrinter->DrawText(aOutPos, aHeader);
aOutPos.Y() += nTextHeight;
aOutPos.Y() += nTextHeight/2;
aFont.SetSize(Size(0, 35)); // 10pt
nStyles = 1;
while(pStyle)
{
- if ( xStatusIndicator.is() )
- xStatusIndicator->setValue( nStyles++ );
- // Ausgabe des Vorlagennamens
+ // print template name
String aStr(pStyle->GetName());
aFont.SetWeight(WEIGHT_BOLD);
- rPrt.SetFont(aFont);
- nTextHeight = rPrt.GetTextHeight();
- // Seitenwechsel
+ pPrinter->SetFont(aFont);
+ nTextHeight = pPrinter->GetTextHeight();
+ // check for new page
if ( aOutPos.Y() + nTextHeight*2 >
aPageSize.Height() - (long) nYIndent )
{
- rPrt.EndPage();
- rPrt.StartPage();
+ pAdaptor->EndPage();
+ pAdaptor->StartPage();
aOutPos.Y() = nYIndent;
}
- rPrt.DrawText(aOutPos, aStr);
+ pPrinter->DrawText(aOutPos, aStr);
aOutPos.Y() += nTextHeight;
- // Ausgabe der Vorlagenbeschreibung
+ // print template description
aFont.SetWeight(WEIGHT_NORMAL);
- rPrt.SetFont(aFont);
+ pPrinter->SetFont(aFont);
aStr = pStyle->GetDescription();
const char cDelim = ' ';
USHORT nStart = 0, nIdx = 0;
- nTextHeight = rPrt.GetTextHeight();
- // wie viele Worte passen auf eine Zeile
+ nTextHeight = pPrinter->GetTextHeight();
+ // break text into lines
while(nIdx < aStr.Len())
{
USHORT nOld = nIdx;
long nTextWidth;
nIdx = aStr.Search(cDelim, nStart);
- nTextWidth = rPrt.GetTextWidth(aStr, nStart, nIdx-nStart);
+ nTextWidth = pPrinter->GetTextWidth(aStr, nStart, nIdx-nStart);
while(nIdx != STRING_NOTFOUND &&
aOutPos.X() + nTextWidth <
aPageSize.Width() - (long) nXIndent)
{
nOld = nIdx;
nIdx = aStr.Search(cDelim, nIdx+1);
- nTextWidth = rPrt.GetTextWidth(aStr, nStart, nIdx-nStart);
+ nTextWidth = pPrinter->GetTextWidth(aStr, nStart, nIdx-nStart);
}
String aTmp(aStr, nStart, nIdx == STRING_NOTFOUND?
STRING_LEN :
nOld-nStart);
if ( aTmp.Len() )
{
- nStart = nOld+1; // wegen trailing space
+ nStart = nOld+1; // trailing space
}
else
{
USHORT nChar = 1;
while(
nStart + nChar < aStr.Len() &&
- aOutPos.X() + rPrt.GetTextWidth(
+ aOutPos.X() + pPrinter->GetTextWidth(
aStr, nStart, nChar) <
aPageSize.Width() - nXIndent)
++nChar;
@@ -1131,19 +1122,19 @@ BOOL SfxObjectShell::Print
if ( aOutPos.Y() + nTextHeight*2 >
aPageSize.Height() - nYIndent )
{
- rPrt.EndPage();
- rPrt.StartPage();
+ pAdaptor->EndPage();
+ pAdaptor->StartPage();
aOutPos.Y() = nYIndent;
}
- rPrt.DrawText(aOutPos, aTmp);
- aOutPos.Y() += rPrt.GetTextHeight();
+ pPrinter->DrawText(aOutPos, aTmp);
+ aOutPos.Y() += pPrinter->GetTextHeight();
}
pStyle = pIter->Next();
}
- rPrt.EndPage();
- rPrt.EndJob();
- if ( xStatusIndicator.is() )
- xStatusIndicator->end();
+ pAdaptor->EndPage();
+
+ Printer::PrintJob( pController, rPrt.GetJobSetup() );
+
delete pIter;
break;
}
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index d61bd4701e1b..103dcf505846 100755
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -42,6 +42,7 @@
#include <com/sun/star/lang/XUnoTunnel.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/lang/EventObject.hpp>
+#include <com/sun/star/view/DuplexMode.hpp>
#include <svl/lstner.hxx>
#include <svl/stritem.hxx>
@@ -148,8 +149,9 @@ Reference< ::com::sun::star::view::XPrintable > SAL_CALL SfxPrintJob_Impl::getPr
void SAL_CALL SfxPrintJob_Impl::cancelJob() throw (RuntimeException)
{
+ // FIXME: how to cancel PrintJob via API?!
if( m_pData->m_pObjectShell.Is() )
- m_pData->m_pObjectShell->Broadcast( SfxPrintingHint( -2, NULL, NULL ) );
+ m_pData->m_pObjectShell->Broadcast( SfxPrintingHint( -2 ) );
}
SfxPrintHelper::SfxPrintHelper()
@@ -590,7 +592,7 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
if ( !pView )
return;
- SfxAllItemSet aArgs( pView->GetPool() );
+// SfxAllItemSet aArgs( pView->GetPool() );
sal_Bool bMonitor = sal_False;
// We need this information at the end of this method, if we start the vcl printer
// by executing the slot. Because if it is a ucb relevant URL we must wait for
@@ -601,7 +603,10 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
String sUcbUrl;
::utl::TempFile* pUCBPrintTempFile = NULL;
- sal_Bool bWaitUntilEnd = sal_False;
+ uno::Sequence < beans::PropertyValue > aCheckedArgs( rOptions.getLength() );
+ sal_Int32 nProps = 0;
+ sal_Bool bWaitUntilEnd = sal_False;
+ sal_Int16 nDuplexMode = ::com::sun::star::view::DuplexMode::UNKNOWN;
for ( int n = 0; n < rOptions.getLength(); ++n )
{
// get Property-Value from options
@@ -634,10 +639,15 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
// converted its not an URL nor a system path. Then we can't accept
// this parameter and have to throw an exception.
::rtl::OUString sSystemPath(sTemp);
- ::rtl::OUString sFileURL ;
+ ::rtl::OUString sFileURL;
if (::osl::FileBase::getFileURLFromSystemPath(sSystemPath,sFileURL)!=::osl::FileBase::E_None)
throw ::com::sun::star::lang::IllegalArgumentException();
- aArgs.Put( SfxStringItem(SID_FILE_NAME,sTemp) );
+ aCheckedArgs[nProps].Name = rProp.Name;
+ aCheckedArgs[nProps++].Value <<= sFileURL;
+ // and append the local filename
+ aCheckedArgs.realloc( aCheckedArgs.getLength()+1 );
+ aCheckedArgs[nProps].Name = rtl::OUString::createFromAscii("LocalFileName");
+ aCheckedArgs[nProps++].Value <<= ::rtl::OUString( sTemp );
}
else
// It's a valid URL. but now we must know, if it is a local one or not.
@@ -648,7 +658,12 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
// And we have to use the system notation of the incoming URL.
// But it into the descriptor and let the slot be executed at
// the end of this method.
- aArgs.Put( SfxStringItem(SID_FILE_NAME,sPath) );
+ aCheckedArgs[nProps].Name = rProp.Name;
+ aCheckedArgs[nProps++].Value <<= sTemp;
+ // and append the local filename
+ aCheckedArgs.realloc( aCheckedArgs.getLength()+1 );
+ aCheckedArgs[nProps].Name = rtl::OUString::createFromAscii("LocalFileName");
+ aCheckedArgs[nProps++].Value <<= ::rtl::OUString( sPath );
}
else
{
@@ -663,7 +678,10 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
// a slot ...
pUCBPrintTempFile = new ::utl::TempFile();
pUCBPrintTempFile->EnableKillingFile();
- aArgs.Put( SfxStringItem(SID_FILE_NAME,pUCBPrintTempFile->GetFileName()) );
+
+ //FIXME: does it work?
+ aCheckedArgs[nProps].Name = rtl::OUString::createFromAscii("LocalFileName");
+ aCheckedArgs[nProps++].Value <<= ::rtl::OUString( pUCBPrintTempFile->GetFileName() );
sUcbUrl = sURL;
}
}
@@ -674,25 +692,22 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
sal_Int32 nCopies = 0;
if ( ( rProp.Value >>= nCopies ) == sal_False )
throw ::com::sun::star::lang::IllegalArgumentException();
- aArgs.Put( SfxInt16Item( SID_PRINT_COPIES, (USHORT) nCopies ) );
+
+ aCheckedArgs[nProps].Name = rProp.Name;
+ aCheckedArgs[nProps++].Value <<= nCopies;
}
// Collate-Property
- else if ( rProp.Name.compareToAscii( "Collate" ) == 0 )
+ // Sort-Property (deprecated)
+ else if ( rProp.Name.compareToAscii( "Collate" ) == 0 ||
+ ( rProp.Name.compareToAscii( "Sort" ) == 0 ) )
{
sal_Bool bTemp = sal_Bool();
if ( rProp.Value >>= bTemp )
- aArgs.Put( SfxBoolItem( SID_PRINT_COLLATE, bTemp ) );
- else
- throw ::com::sun::star::lang::IllegalArgumentException();
- }
-
- // Sort-Property
- else if ( rProp.Name.compareToAscii( "Sort" ) == 0 )
- {
- sal_Bool bTemp = sal_Bool();
- if( rProp.Value >>= bTemp )
- aArgs.Put( SfxBoolItem( SID_PRINT_SORT, bTemp ) );
+ {
+ aCheckedArgs[nProps].Name = rtl::OUString::createFromAscii("Collate");
+ aCheckedArgs[nProps++].Value <<= bTemp;
+ }
else
throw ::com::sun::star::lang::IllegalArgumentException();
}
@@ -702,7 +717,10 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
{
OUSTRING sTemp;
if( rProp.Value >>= sTemp )
- aArgs.Put( SfxStringItem( SID_PRINT_PAGES, String( sTemp ) ) );
+ {
+ aCheckedArgs[nProps].Name = rProp.Name;
+ aCheckedArgs[nProps++].Value <<= sTemp;
+ }
else
throw ::com::sun::star::lang::IllegalArgumentException();
}
@@ -712,26 +730,36 @@ void SAL_CALL SfxPrintHelper::print(const uno::Sequence< beans::PropertyValue >&
{
if( !(rProp.Value >>= bMonitor) )
throw ::com::sun::star::lang::IllegalArgumentException();
+ aCheckedArgs[nProps].Name = rProp.Name;
+ aCheckedArgs[nProps++].Value <<= bMonitor;
}
- // MonitorVisible
+ // Wait
else if ( rProp.Name.compareToAscii( "Wait" ) == 0 )
{
if ( !(rProp.Value >>= bWaitUntilEnd) )
throw ::com::sun::star::lang::IllegalArgumentException();
+ aCheckedArgs[nProps].Name = rProp.Name;
+ aCheckedArgs[nProps++].Value <<= bWaitUntilEnd;
+ }
+
+ else if ( rProp.Name.compareToAscii( "DuplexMode" ) == 0 )
+ {
+ if ( !(rProp.Value >>= nDuplexMode ) )
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ aCheckedArgs[nProps].Name = rProp.Name;
+ aCheckedArgs[nProps++].Value <<= nDuplexMode;
}
}
+ if ( nProps != aCheckedArgs.getLength() )
+ aCheckedArgs.realloc(nProps);
+
// Execute the print request every time.
// It doesn'tmatter if it is a real printer used or we print to a local file
// nor if we print to a temp file and move it afterwards by using the ucb.
// That will be handled later. see pUCBPrintFile below!
- aArgs.Put( SfxBoolItem( SID_SILENT, !bMonitor ) );
- if ( bWaitUntilEnd )
- aArgs.Put( SfxBoolItem( SID_ASYNCHRON, sal_False ) );
- SfxRequest aReq( SID_PRINTDOC, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_API, pView->GetPool() );
- aReq.SetArgs( aArgs );
- pView->ExecuteSlot( aReq );
+ pView->ExecPrint( aCheckedArgs, sal_True, sal_False );
// Ok - may be execution before has finished (or started!) printing.
// And may it was a printing to a file.
@@ -764,11 +792,11 @@ void IMPL_PrintListener_DataContainer::Notify( SfxBroadcaster& rBC, const SfxHin
SfxPrintingHint* pPrintHint = PTR_CAST( SfxPrintingHint, &rHint );
if ( pPrintHint )
{
- if ( pPrintHint->GetWhich() == -1 ) // -1 : Initialisation of PrintOptions
+ if ( pPrintHint->GetWhich() == com::sun::star::view::PrintableState_JOB_STARTED )
{
if ( !m_xPrintJob.is() )
m_xPrintJob = new SfxPrintJob_Impl( this );
-
+/*
PrintDialog* pDlg = pPrintHint->GetPrintDialog();
Printer* pPrinter = pPrintHint->GetPrinter();
::rtl::OUString aPrintFile ( ( pPrinter && pPrinter->IsPrintFileEnabled() ) ? pPrinter->GetPrintFile() : String() );
@@ -805,7 +833,10 @@ void IMPL_PrintListener_DataContainer::Notify( SfxBroadcaster& rBC, const SfxHin
m_aPrintOptions[nArgs-1].Name = DEFINE_CONST_UNICODE("FileName");
m_aPrintOptions[nArgs-1].Value <<= aPrintFile;
}
+*/
+ m_aPrintOptions = pPrintHint->GetOptions();
}
+/*
else if ( pPrintHint->GetWhich() == -3 ) // -3 : AdditionalPrintOptions
{
uno::Sequence < beans::PropertyValue >& lOldOpts = m_aPrintOptions;
@@ -839,6 +870,7 @@ void IMPL_PrintListener_DataContainer::Notify( SfxBroadcaster& rBC, const SfxHin
// at least one new options has overwritten an old one, so we allocated too much
lOldOpts.realloc( nTotal );
}
+*/
else if ( pPrintHint->GetWhich() != -2 ) // -2 : CancelPrintJob
{
view::PrintJobEvent aEvent;
diff --git a/sfx2/source/view/makefile.mk b/sfx2/source/view/makefile.mk
index 98d34215e097..cad12052720c 100644
--- a/sfx2/source/view/makefile.mk
+++ b/sfx2/source/view/makefile.mk
@@ -1,7 +1,7 @@
#*************************************************************************
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
+#
# Copyright 2008 by Sun Microsystems, Inc.
#
# OpenOffice.org - a multi-platform office productivity suite
@@ -54,7 +54,6 @@ SLOFILES = \
$(SLO)$/frmload.obj \
$(SLO)$/frame.obj \
$(SLO)$/printer.obj \
- $(SLO)$/prnmon.obj \
$(SLO)$/viewprn.obj \
$(SLO)$/viewfac.obj \
$(SLO)$/orgmgr.obj \
diff --git a/sfx2/source/view/printer.cxx b/sfx2/source/view/printer.cxx
index 1ea49ecd879b..2b7f89eac7c4 100644
--- a/sfx2/source/view/printer.cxx
+++ b/sfx2/source/view/printer.cxx
@@ -546,14 +546,17 @@ SfxPrintOptionsDialog::SfxPrintOptionsDialog( Window *pParent,
// TabPage einh"angen
pPage = pViewSh->CreatePrintOptionsPage( this, *pOptions );
DBG_ASSERT( pPage, "CreatePrintOptions != SFX_VIEW_HAS_PRINTOPTIONS" );
- pPage->Reset( *pOptions );
- SetHelpId( pPage->GetHelpId() );
- pPage->Show();
+ if( pPage )
+ {
+ pPage->Reset( *pOptions );
+ SetHelpId( pPage->GetHelpId() );
+ pPage->Show();
+ }
// Dialoggr"o\se bestimmen
Size a6Sz = LogicToPixel( Size( 6, 6 ), MAP_APPFONT );
Size aBtnSz = LogicToPixel( Size( 50, 14 ), MAP_APPFONT );
- Size aOutSz( pPage->GetSizePixel() );
+ Size aOutSz( pPage ? pPage->GetSizePixel() : Size() );
aOutSz.Height() += 6;
long nWidth = aBtnSz.Width();
nWidth += a6Sz.Width();
@@ -589,6 +592,9 @@ SfxPrintOptionsDialog::~SfxPrintOptionsDialog()
short SfxPrintOptionsDialog::Execute()
{
+ if( ! pPage )
+ return RET_CANCEL;
+
short nRet = ModalDialog::Execute();
if ( nRet == RET_OK )
pPage->FillItemSet( *pOptions );
diff --git a/sfx2/source/view/prnmon.cxx b/sfx2/source/view/prnmon.cxx
index f875143bfab0..de075647ab48 100644
--- a/sfx2/source/view/prnmon.cxx
+++ b/sfx2/source/view/prnmon.cxx
@@ -274,10 +274,12 @@ SfxPrintProgress::SfxPrintProgress( SfxViewShell* pViewSh, FASTBOOL bShow )
String(SfxResId(STR_PRINTING)), 1, FALSE ),
pImp( new SfxPrintProgress_Impl( pViewSh, pViewSh->GetPrinter() ) )
{
+ #if 0
pImp->pPrinter->SetEndPrintHdl( LINK( this, SfxPrintProgress, EndPrintNotify ) );
pImp->pPrinter->SetErrorHdl( LINK( this, SfxPrintProgress, PrintErrorNotify ) );
pImp->pPrinter->SetStartPrintHdl( LINK( this, SfxPrintProgress, StartPrintNotify ) );
pImp->bCallbacks = TRUE;
+ #endif
SfxObjectShell* pDoc = pViewSh->GetObjectShell();
SFX_ITEMSET_ARG( pDoc->GetMedium()->GetItemSet(), pItem, SfxBoolItem, SID_HIDDEN, FALSE );
@@ -307,7 +309,7 @@ SfxPrintProgress::~SfxPrintProgress()
// ggf. Callbacks entfermen
if ( pImp->bCallbacks )
{
- pImp->pPrinter->SetEndPrintHdl( Link() );
+ // pImp->pPrinter->SetEndPrintHdl( Link() );
pImp->pPrinter->SetErrorHdl( Link() );
pImp->bCallbacks = FALSE;
}
@@ -410,7 +412,7 @@ IMPL_LINK( SfxPrintProgress, EndPrintNotify, void *, EMPTYARG )
//! if( pMDI->IsPrinterChanged() ) pMDI->Changed( 0L );
// Callbacks rausnehmen
- pImp->pPrinter->SetEndPrintHdl( Link() );
+ // pImp->pPrinter->SetEndPrintHdl( Link() );
pImp->pPrinter->SetErrorHdl( Link() );
pImp->bCallbacks = FALSE;
diff --git a/sfx2/source/view/topfrm.cxx b/sfx2/source/view/topfrm.cxx
index f3596de6b1c2..6f5c2ffcc3eb 100644
--- a/sfx2/source/view/topfrm.cxx
+++ b/sfx2/source/view/topfrm.cxx
@@ -370,7 +370,7 @@ void SfxTopViewWin_Impl::StateChanged( StateChangedType nStateChange )
if ( nStateChange == STATE_CHANGE_INITSHOW )
{
SfxObjectShell* pDoc = pFrame->GetObjectShell();
- if ( pDoc && !pFrame->IsVisible_Impl() )
+ if ( pDoc && !pFrame->IsVisible() )
pFrame->Show();
pFrame->Resize();
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 945419189b78..ba87f0fc33ca 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1331,7 +1331,7 @@ String SfxViewFrame::UpdateTitle()
// Name des SbxObjects
String aSbxName = pObjSh->SfxShell::GetName();
- if ( IsVisible_Impl() )
+ if ( IsVisible() )
{
aSbxName += ':';
aSbxName += String::CreateFromInt32(pImp->nDocViewNo);
@@ -1801,7 +1801,7 @@ sal_uInt16 SfxViewFrame::Count(TypeId aType)
{
SfxViewFrame *pFrame = rFrames[i];
if ( ( !aType || pFrame->IsA(aType) ) &&
- pFrame->IsVisible_Impl() )
+ pFrame->IsVisible() )
++nFound;
}
return nFound;
@@ -1825,7 +1825,7 @@ SfxViewFrame* SfxViewFrame::GetFirst
SfxViewFrame *pFrame = rFrames.GetObject(nPos);
if ( ( !pDoc || pDoc == pFrame->GetObjectShell() ) &&
( !aType || pFrame->IsA(aType) ) &&
- ( !bOnlyIfVisible || pFrame->IsVisible_Impl()) )
+ ( !bOnlyIfVisible || pFrame->IsVisible()) )
return pFrame;
}
@@ -1857,7 +1857,7 @@ SfxViewFrame* SfxViewFrame::GetNext
SfxViewFrame *pFrame = rFrames.GetObject(nPos);
if ( ( !pDoc || pDoc == pFrame->GetObjectShell() ) &&
( !aType || pFrame->IsA(aType) ) &&
- ( !bOnlyIfVisible || pFrame->IsVisible_Impl()) )
+ ( !bOnlyIfVisible || pFrame->IsVisible()) )
return pFrame;
}
return 0;
@@ -1870,7 +1870,7 @@ void SfxViewFrame::CloseHiddenFrames_Impl()
for ( sal_uInt16 nPos=0; nPos<rFrames.Count(); )
{
SfxViewFrame *pFrame = rFrames.GetObject(nPos);
- if ( !pFrame->IsVisible_Impl() )
+ if ( !pFrame->IsVisible() )
pFrame->DoClose();
else
nPos++;
@@ -2142,7 +2142,7 @@ void SfxViewFrame::Show()
}
//--------------------------------------------------------------------
-sal_Bool SfxViewFrame::IsVisible_Impl() const
+sal_Bool SfxViewFrame::IsVisible() const
{
//Window *pWin = pImp->bInCtor ? 0 : &GetWindow();
//return GetFrame()->HasComponent() || pImp->bObjLocked || ( pWin && pWin->IsVisible() );
@@ -2172,7 +2172,7 @@ void SfxViewFrame::MakeActive_Impl( BOOL bGrabFocus )
{
if ( GetViewShell() && !GetFrame()->IsClosing_Impl() )
{
- if ( IsVisible_Impl() )
+ if ( IsVisible() )
{
if ( GetViewShell() )
{
diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx
index 97f86ee1f395..9e3791340daa 100644
--- a/sfx2/source/view/viewimp.hxx
+++ b/sfx2/source/view/viewimp.hxx
@@ -58,6 +58,7 @@ typedef SfxShell* SfxShellPtr_Impl;
SV_DECL_PTRARR( SfxShellArr_Impl, SfxShellPtr_Impl, 4, 4 )
// struct SfxViewShell_Impl ----------------------------------------------
+#if 0
class SfxAsyncPrintExec_Impl : public SfxListener
{
SfxViewShell* pView;
@@ -72,6 +73,7 @@ public:
void AddRequest( SfxRequest& rReq );
};
+#endif
class SfxClipboardChangeListener;
@@ -98,7 +100,7 @@ struct SfxViewShell_Impl
USHORT nFamily;
SfxBaseController* pController;
::svt::AcceleratorExecute* pAccExec;
- SfxAsyncPrintExec_Impl* pPrinterCommandQueue;
+// SfxAsyncPrintExec_Impl* pPrinterCommandQueue;
com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aPrintOpts;
::rtl::Reference< SfxClipboardChangeListener > xClipboardListener;
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index e4a53a8a6e7a..24d31337a662 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -33,16 +33,12 @@
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/view/PrintableState.hpp>
+#include "com/sun/star/view/XRenderable.hpp"
+
#include <svl/itempool.hxx>
-#ifndef _MSGBOX_HXX //autogen
#include <vcl/msgbox.hxx>
-#endif
-#ifndef _SV_PRINTDLG_HXX //autogen
#include <svtools/printdlg.hxx>
-#endif
-#ifndef _SV_PRNSETUP_HXX //autogen
#include <svtools/prnsetup.hxx>
-#endif
#include <svl/flagitem.hxx>
#include <svl/stritem.hxx>
#include <svl/intitem.hxx>
@@ -51,9 +47,9 @@
#include <unotools/useroptions.hxx>
#include <unotools/printwarningoptions.hxx>
#include <tools/datetime.hxx>
-
+#include <sfx2/bindings.hxx>
+#include <sfx2/objface.hxx>
#include <sfx2/viewsh.hxx>
-#include <sfx2/dispatch.hxx>
#include "viewimp.hxx"
#include <sfx2/viewfrm.hxx>
#include <sfx2/prnmon.hxx>
@@ -65,50 +61,282 @@
#include <sfx2/docfile.hxx>
#include <sfx2/docfilt.hxx>
+#include "toolkit/awt/vclxdevice.hxx"
+
#include "view.hrc"
#include "helpid.hrc"
+using namespace com::sun::star;
+using namespace com::sun::star::uno;
+
TYPEINIT1(SfxPrintingHint, SfxHint);
// -----------------------------------------------------------------------
+class SfxPrinterController : public vcl::PrinterController, public SfxListener
+{
+ Any maCompleteSelection;
+ Any maSelection;
+ Reference< view::XRenderable > mxRenderable;
+ mutable Printer* mpLastPrinter;
+ mutable Reference<awt::XDevice> mxDevice;
+ SfxViewShell* mpViewShell;
+ SfxObjectShell* mpObjectShell;
+ sal_Bool m_bOrigStatus;
+ sal_Bool m_bNeedsChange;
+ sal_Bool m_bApi;
+ util::DateTime m_aLastPrinted;
+ ::rtl::OUString m_aLastPrintedBy;
-void SfxAsyncPrintExec_Impl::AddRequest( SfxRequest& rReq )
+ Sequence< beans::PropertyValue > getMergedOptions() const;
+ const Any& getSelectionObject() const;
+public:
+ SfxPrinterController( const Any& i_rComplete,
+ const Any& i_rSelection,
+ const Any& i_rViewProp,
+ const Reference< view::XRenderable >& i_xRender,
+ sal_Bool i_bApi, sal_Bool i_bDirect,
+ SfxViewShell* pView,
+ const uno::Sequence< beans::PropertyValue >& rProps
+ );
+
+ virtual ~SfxPrinterController();
+ virtual void Notify( SfxBroadcaster&, const SfxHint& );
+
+ virtual int getPageCount() const;
+ virtual Sequence< beans::PropertyValue > getPageParameters( int i_nPage ) const;
+ virtual void printPage( int i_nPage ) const;
+ virtual void jobStarted();
+ virtual void jobFinished( com::sun::star::view::PrintableState );
+};
+
+SfxPrinterController::SfxPrinterController( const Any& i_rComplete,
+ const Any& i_rSelection,
+ const Any& i_rViewProp,
+ const Reference< view::XRenderable >& i_xRender,
+ sal_Bool i_bApi, sal_Bool i_bDirect,
+ SfxViewShell* pView,
+ const uno::Sequence< beans::PropertyValue >& rProps
+ )
+ : maCompleteSelection( i_rComplete )
+ , maSelection( i_rSelection )
+ , mxRenderable( i_xRender )
+ , mpLastPrinter( NULL )
+ , mpViewShell( pView )
+ , mpObjectShell(0)
+ , m_bOrigStatus( sal_False )
+ , m_bNeedsChange( sal_False )
+ , m_bApi(i_bApi)
{
- if ( rReq.GetArgs() )
+ if ( mpViewShell )
{
- // only queue API requests
- if ( aReqs.empty() )
- StartListening( *pView->GetObjectShell() );
+ StartListening( *mpViewShell );
+ mpObjectShell = mpViewShell->GetObjectShell();
+ StartListening( *mpObjectShell );
+ m_bOrigStatus = mpObjectShell->IsEnableSetModified();
+
+ // check configuration: shall update of printing information in DocInfo set the document to "modified"?
+ if ( m_bOrigStatus && !SvtPrintWarningOptions().IsModifyDocumentOnPrintingAllowed() )
+ {
+ mpObjectShell->EnableSetModified( sal_False );
+ m_bNeedsChange = sal_True;
+ }
+
+ // refresh document info
+ uno::Reference<document::XDocumentProperties> xDocProps(mpObjectShell->getDocProperties());
+ m_aLastPrintedBy = xDocProps->getPrintedBy();
+ m_aLastPrinted = xDocProps->getPrintDate();
+
+ xDocProps->setPrintedBy( mpObjectShell->IsUseUserData()
+ ? ::rtl::OUString( SvtUserOptions().GetFullName() )
+ : ::rtl::OUString() );
+ ::DateTime now;
+
+ xDocProps->setPrintDate( util::DateTime(
+ now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(),
+ now.GetDay(), now.GetMonth(), now.GetYear() ) );
+ }
- aReqs.push( new SfxRequest( rReq ) );
+ // initialize extra ui options
+ if( mxRenderable.is() )
+ {
+ for (sal_Int32 nProp=0; nProp<rProps.getLength(); nProp++)
+ setValue( rProps[nProp].Name, rProps[nProp].Value );
+
+ Sequence< beans::PropertyValue > aRenderOptions( 3 );
+ aRenderOptions[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ExtraPrintUIOptions" ) );
+ aRenderOptions[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "View" ) );
+ aRenderOptions[1].Value = i_rViewProp;
+ aRenderOptions[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsPrinter" ) );
+ aRenderOptions[2].Value <<= sal_True;
+ Sequence< beans::PropertyValue > aRenderParms( mxRenderable->getRenderer( 0 , getSelectionObject(), aRenderOptions ) );
+ int nProps = aRenderParms.getLength();
+ for( int i = 0; i < nProps; i++ )
+ {
+ if( aRenderParms[i].Name.equalsAscii( "ExtraPrintUIOptions" ) )
+ {
+ Sequence< beans::PropertyValue > aUIProps;
+ aRenderParms[i].Value >>= aUIProps;
+ setUIOptions( aUIProps );
+ break;
+ }
+ }
}
+
+ // set some job parameters
+ setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsApi" ) ), makeAny( i_bApi ) );
+ setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDirect" ) ), makeAny( i_bDirect ) );
+ setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsPrinter" ) ), makeAny( sal_True ) );
+ setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "View" ) ), i_rViewProp );
}
-void SfxAsyncPrintExec_Impl::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
+void SfxPrinterController::Notify( SfxBroadcaster& , const SfxHint& rHint )
{
- if ( &rBC == pView->GetObjectShell() )
+ if ( rHint.IsA(TYPE(SfxSimpleHint)) )
{
- SfxPrintingHint* pPrintHint = PTR_CAST( SfxPrintingHint, &rHint );
- if ( pPrintHint && pPrintHint->GetWhich() == com::sun::star::view::PrintableState_JOB_COMPLETED )
+ if ( ((SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
{
- while ( aReqs.front() )
+ EndListening(*mpViewShell);
+ EndListening(*mpObjectShell);
+ mpViewShell = 0;
+ mpObjectShell = 0;
+ }
+ }
+}
+
+SfxPrinterController::~SfxPrinterController()
+{
+}
+
+const Any& SfxPrinterController::getSelectionObject() const
+{
+ sal_Int32 nChoice = 0;
+ sal_Bool bSel = sal_False;
+ const beans::PropertyValue* pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ) );
+ if( pVal )
+ pVal->Value >>= nChoice;
+ pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) ) );
+ if( pVal )
+ pVal->Value >>= bSel;
+ return (nChoice > 1 || bSel) ? maSelection : maCompleteSelection;
+}
+
+Sequence< beans::PropertyValue > SfxPrinterController::getMergedOptions() const
+{
+ boost::shared_ptr<Printer> pPrinter( getPrinter() );
+ if( pPrinter.get() != mpLastPrinter )
+ {
+ mpLastPrinter = pPrinter.get();
+ VCLXDevice* pXDevice = new VCLXDevice();
+ pXDevice->SetOutputDevice( mpLastPrinter );
+ mxDevice = Reference< awt::XDevice >( pXDevice );
+ }
+
+ Sequence< beans::PropertyValue > aRenderOptions( 1 );
+ aRenderOptions[ 0 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RenderDevice" ) );
+ aRenderOptions[ 0 ].Value <<= mxDevice;
+
+ aRenderOptions = getJobProperties( aRenderOptions );
+ return aRenderOptions;
+}
+
+int SfxPrinterController::getPageCount() const
+{
+ int nPages = 0;
+ boost::shared_ptr<Printer> pPrinter( getPrinter() );
+ if( mxRenderable.is() && pPrinter )
+ {
+ Sequence< beans::PropertyValue > aJobOptions( getMergedOptions() );
+ nPages = mxRenderable->getRendererCount( getSelectionObject(), aJobOptions );
+ }
+ return nPages;
+}
+
+Sequence< beans::PropertyValue > SfxPrinterController::getPageParameters( int i_nPage ) const
+{
+ boost::shared_ptr<Printer> pPrinter( getPrinter() );
+ Sequence< beans::PropertyValue > aResult;
+
+ if( mxRenderable.is() && pPrinter )
+ {
+ Sequence< beans::PropertyValue > aJobOptions( getMergedOptions() );
+ aResult = mxRenderable->getRenderer( i_nPage, getSelectionObject(), aJobOptions );
+ }
+ return aResult;
+}
+
+void SfxPrinterController::printPage( int i_nPage ) const
+{
+ boost::shared_ptr<Printer> pPrinter( getPrinter() );
+ if( mxRenderable.is() && pPrinter )
+ {
+ Sequence< beans::PropertyValue > aJobOptions( getMergedOptions() );
+ try
+ {
+ mxRenderable->render( i_nPage, getSelectionObject(), aJobOptions );
+ }
+ catch( lang::IllegalArgumentException& )
+ {
+ // don't care enough about nonexistant page here
+ // to provoke a crash
+ }
+ }
+}
+
+void SfxPrinterController::jobStarted()
+{
+ if ( mpObjectShell )
+ {
+ // FIXME: how to get all print options incl. AdditionalOptions easily?
+ uno::Sequence < beans::PropertyValue > aOpts;
+ mpObjectShell->Broadcast( SfxPrintingHint( view::PrintableState_JOB_STARTED, aOpts ) );
+ }
+}
+
+void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nState )
+{
+ if ( mpObjectShell )
+ {
+ mpObjectShell->Broadcast( SfxPrintingHint( nState ) );
+ switch ( nState )
+ {
+ case view::PrintableState_JOB_FAILED :
{
- SfxRequest* pReq = aReqs.front();
- aReqs.pop();
- pView->GetViewFrame()->GetDispatcher()->Execute( pReq->GetSlot(), SFX_CALLMODE_ASYNCHRON, *pReq->GetArgs() );
- USHORT nSlot = pReq->GetSlot();
- delete pReq;
- if ( nSlot == SID_PRINTDOC || nSlot == SID_PRINTDOCDIRECT )
- // print jobs must be executed before the next command can be dispatched
- break;
+ // "real" problem (not simply printing cancelled by user)
+ String aMsg( SfxResId( STR_NOSTARTPRINTER ) );
+ if ( !m_bApi )
+ ErrorBox( mpViewShell->GetWindow(), WB_OK | WB_DEF_OK, aMsg ).Execute();
+ // intentionally no break
+ }
+ case view::PrintableState_JOB_ABORTED :
+ {
+ // printing not succesful, reset DocInfo
+ uno::Reference<document::XDocumentProperties> xDocProps(mpObjectShell->getDocProperties());
+ xDocProps->setPrintedBy(m_aLastPrintedBy);
+ xDocProps->setPrintDate(m_aLastPrinted);
+ break;
}
- if ( aReqs.empty() )
- EndListening( *pView->GetObjectShell() );
+ case view::PrintableState_JOB_SPOOLED :
+ case view::PrintableState_JOB_COMPLETED :
+ {
+ SfxBindings& rBind = mpViewShell->GetViewFrame()->GetBindings();
+ rBind.Invalidate( SID_PRINTDOC );
+ rBind.Invalidate( SID_PRINTDOCDIRECT );
+ rBind.Invalidate( SID_SETUPPRINTER );
+ break;
+ }
+
+ default:
+ break;
}
+
+ if ( m_bNeedsChange )
+ mpObjectShell->EnableSetModified( m_bOrigStatus );
}
}
+// -----------------------------------------------------------------------
+
void DisableRanges( PrintDialog& rDlg, SfxPrinter* pPrinter )
/* [Beschreibung]
@@ -391,68 +619,137 @@ SfxPrinter* SfxViewShell::SetPrinter_Impl( SfxPrinter *pNewPrinter )
#pragma optimize ( "", off )
#endif
-class SfxPrintGuard_Impl
+void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rProps, sal_Bool bIsAPI, sal_Bool bIsDirect )
{
- SfxObjectShell* m_pObjectShell;
- sal_Bool m_bOrigStatus;
- sal_Bool m_bNeedsChange;
-
-public:
- SfxPrintGuard_Impl( SfxObjectShell* pObjectShell )
- : m_pObjectShell( pObjectShell )
- , m_bOrigStatus( sal_False )
- , m_bNeedsChange( sal_False )
- {
- if ( m_pObjectShell )
- {
- m_bOrigStatus = m_pObjectShell->IsEnableSetModified();
+ // get the current selection; our controller should know it
+ Reference< frame::XController > xController( GetController() );
+ Reference< view::XSelectionSupplier > xSupplier( xController, UNO_QUERY );
- // check configuration: shall update of printing information in DocInfo set the document to "modified"?
- if ( m_bOrigStatus && !SvtPrintWarningOptions().IsModifyDocumentOnPrintingAllowed() )
- {
- m_pObjectShell->EnableSetModified( sal_False );
- m_bNeedsChange = sal_True;
- }
- }
- }
-
- ~SfxPrintGuard_Impl()
- {
- if ( m_pObjectShell && m_bNeedsChange )
- m_pObjectShell->EnableSetModified( m_bOrigStatus );
- }
-};
+ Any aSelection;
+ if( xSupplier.is() )
+ aSelection = xSupplier->getSelection();
+ else
+ aSelection <<= GetObjectShell()->GetModel();
+ Any aComplete( makeAny( GetObjectShell()->GetModel() ) );
+ Any aViewProp( makeAny( xController ) );
+
+ boost::shared_ptr<vcl::PrinterController> pController( new SfxPrinterController( aComplete,
+ aSelection,
+ aViewProp,
+ GetRenderable(),
+ bIsAPI,
+ bIsDirect,
+ this,
+ rProps
+ ) );
+ SfxObjectShell *pObjShell = GetObjectShell();
+ pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "JobName" ) ),
+ makeAny( rtl::OUString( pObjShell->GetTitle(0) ) ) );
+
+ // FIXME: job setup
+ SfxPrinter* pDocPrt = GetPrinter(FALSE);
+ JobSetup aJobSetup = pDocPrt ? pDocPrt->GetJobSetup() : GetJobSetup();
+ if( bIsDirect )
+ aJobSetup.SetValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsQuickJob" ) ),
+ String( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
+
+ Printer::PrintJob( pController, aJobSetup );
+}
void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
{
- USHORT nCopies=1;
+ // USHORT nCopies=1;
USHORT nDialogRet = RET_CANCEL;
- BOOL bCollate=TRUE;
+ // BOOL bCollate=FALSE;
SfxPrinter* pPrinter = 0;
PrintDialog* pPrintDlg = 0;
SfxDialogExecutor_Impl* pExecutor = 0;
bool bSilent = false;
BOOL bIsAPI = rReq.GetArgs() && rReq.GetArgs()->Count();
-
- if ( bIsAPI && GetPrinter( FALSE ) && GetPrinter( FALSE )->IsPrinting() )
+ if ( bIsAPI )
{
- pImp->pPrinterCommandQueue->AddRequest( rReq );
- return;
+ SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT, FALSE);
+ bSilent = pSilentItem && pSilentItem->GetValue();
}
+ //FIXME: how to transport "bPrintOnHelp"?
+
+ // no help button in dialogs if called from the help window
+ // (pressing help button would exchange the current page inside the help document that is going to be printed!)
+ String aHelpFilterName( DEFINE_CONST_UNICODE("writer_web_HTML_help") );
+ SfxMedium* pMedium = GetViewFrame()->GetObjectShell()->GetMedium();
+ const SfxFilter* pFilter = pMedium ? pMedium->GetFilter() : NULL;
+ sal_Bool bPrintOnHelp = ( pFilter && pFilter->GetFilterName() == aHelpFilterName );
+
const USHORT nId = rReq.GetSlot();
switch( nId )
{
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
case SID_PRINTDOC:
- case SID_SETUPPRINTER:
- case SID_PRINTER_NAME :
+ case SID_PRINTDOCDIRECT:
{
- // quiet mode (AppEvent, API call)
- SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT, FALSE);
- bSilent = pSilentItem && pSilentItem->GetValue();
+ SfxObjectShell* pDoc = GetObjectShell();
+ bool bDetectHidden = ( !bSilent && pDoc );
+ if ( bDetectHidden && pDoc->QueryHiddenInformation( WhenPrinting, NULL ) != RET_YES )
+ break;
+
+ SFX_REQUEST_ARG(rReq, pSelectItem, SfxBoolItem, SID_SELECTION, FALSE);
+ sal_Bool bSelection = pSelectItem && pSelectItem->GetValue();
+ if( pSelectItem && rReq.GetArgs()->Count() == 1 )
+ bIsAPI = FALSE;
+
+ uno::Sequence < beans::PropertyValue > aProps;
+ if ( bIsAPI )
+ {
+ // supported properties:
+ // String PrinterName
+ // String FileName
+ // Int16 From
+ // Int16 To
+ // In16 Copies
+ // String RangeText
+ // bool Selection
+ // bool Asynchron
+ // bool Collate
+ // bool Silent
+ TransformItems( nId, *rReq.GetArgs(), aProps, GetInterface()->GetSlot(nId) );
+ for ( sal_Int32 nProp=0; nProp<aProps.getLength(); nProp++ )
+ {
+ if ( aProps[nProp].Name.equalsAscii("Copies") )
+ aProps[nProp]. Name = rtl::OUString::createFromAscii("CopyCount");
+ else if ( aProps[nProp].Name.equalsAscii("RangeText") )
+ aProps[nProp]. Name = rtl::OUString::createFromAscii("Pages");
+ if ( aProps[nProp].Name.equalsAscii("Asynchron") )
+ {
+ aProps[nProp]. Name = rtl::OUString::createFromAscii("Wait");
+ sal_Bool bAsynchron = sal_False;
+ aProps[nProp].Value >>= bAsynchron;
+ aProps[nProp].Value <<= (sal_Bool) (!bAsynchron);
+ }
+ if ( aProps[nProp].Name.equalsAscii("Silent") )
+ {
+ aProps[nProp]. Name = rtl::OUString::createFromAscii("MonitorVisible");
+ sal_Bool bPrintSilent = sal_False;
+ aProps[nProp].Value >>= bPrintSilent;
+ aProps[nProp].Value <<= (sal_Bool) (!bPrintSilent);
+ }
+ }
+ }
+ sal_Int32 nLen = aProps.getLength();
+ aProps.realloc( nLen + 1 );
+ aProps[nLen].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) );
+ aProps[nLen].Value = makeAny( bSelection );
+
+ ExecPrint( aProps, bIsAPI, (nId == SID_PRINTDOCDIRECT) );
+
+ // FIXME: Recording
+ rReq.Done();
+ break;
+ }
+ case SID_SETUPPRINTER :
+ case SID_PRINTER_NAME : // only for recorded macros
+ {
// get printer and printer settings from the document
SfxPrinter *pDocPrinter = GetPrinter(TRUE);
@@ -473,7 +770,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
// just set a recorded printer name
if ( pPrinter )
SetPrinter( pPrinter, SFX_PRINTER_PRINTER );
- return;
+ break;
}
// no PrinterName parameter in ItemSet or the PrinterName points to an unknown printer
@@ -487,7 +784,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
if ( bSilent )
{
rReq.SetReturnValue(SfxBoolItem(0,FALSE));
- return;
+ break;
}
else
ErrorBox( NULL, WB_OK | WB_DEF_OK, String( SfxResId( STR_NODEFPRINTER ) ) ).Execute();
@@ -497,112 +794,57 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
{
// printer is not available, but standard printer should not be used
rReq.SetReturnValue(SfxBoolItem(0,FALSE));
- return;
+ break;
}
+ // FIXME: printer isn't used for printing anymore!
if( pPrinter->IsPrinting() )
{
// if printer is busy, abort printing
if ( !bSilent )
InfoBox( NULL, String( SfxResId( STR_ERROR_PRINTER_BUSY ) ) ).Execute();
rReq.SetReturnValue(SfxBoolItem(0,FALSE));
- return;
+ break;
}
- // the print dialog shouldn't use a help button if it is called from the help window
- // (pressing help button would exchange the current page inside the help document that is going to be printed!)
- String aHelpFilterName( DEFINE_CONST_UNICODE("writer_web_HTML_help") );
- SfxMedium* pMedium = GetViewFrame()->GetObjectShell()->GetMedium();
- const SfxFilter* pFilter = pMedium ? pMedium->GetFilter() : NULL;
- sal_Bool bPrintOnHelp = ( pFilter && pFilter->GetFilterName() == aHelpFilterName );
-
- SfxObjectShell* pDoc = NULL;
- if ( SID_PRINTDOC == nId )
- pDoc = GetObjectShell();
-
- // Let the document stay nonmodified during the printing if the configuration says to do so
- SfxPrintGuard_Impl aGuard( pDoc );
-
// if no arguments are given, retrieve them from a dialog
if ( !bIsAPI )
{
// PrinterDialog needs a temporary printer
SfxPrinter* pDlgPrinter = pPrinter->Clone();
nDialogRet = 0;
- if ( SID_PRINTDOC == nId )
+
+ // execute PrinterSetupDialog
+ PrinterSetupDialog* pPrintSetupDlg = new PrinterSetupDialog( GetWindow() );
+
+ if ( pImp->bHasPrintOptions )
{
- bool bDetectHidden = ( !bSilent && !bPrintOnHelp && pDoc );
- if ( !bDetectHidden
- || pDoc->QueryHiddenInformation( WhenPrinting, NULL ) == RET_YES )
- {
- // execute PrintDialog
- pPrintDlg = CreatePrintDialog( NULL );
- if ( bPrintOnHelp )
- pPrintDlg->DisableHelp();
-
- if ( pImp->bHasPrintOptions )
- {
- // additional controls for dialog
- pExecutor = new SfxDialogExecutor_Impl( this, pPrintDlg );
- if ( bPrintOnHelp )
- pExecutor->DisableHelp();
- pPrintDlg->SetOptionsHdl( pExecutor->GetLink() );
- pPrintDlg->ShowOptionsButton();
- }
-
- // set printer on dialog and execute
- pPrintDlg->SetPrinter( pDlgPrinter );
- ::DisableRanges( *pPrintDlg, pDlgPrinter );
- nDialogRet = pPrintDlg->Execute();
- if ( pExecutor && pExecutor->GetOptions() )
- {
- if ( nDialogRet == RET_OK )
- // remark: have to be recorded if possible!
- pDlgPrinter->SetOptions( *pExecutor->GetOptions() );
- else
- {
- pPrinter->SetOptions( *pExecutor->GetOptions() );
- SetPrinter( pPrinter, SFX_PRINTER_OPTIONS );
- }
- }
-
- DELETEZ( pExecutor );
- }
+ // additional controls for dialog
+ pExecutor = new SfxDialogExecutor_Impl( this, pPrintSetupDlg );
+ if ( bPrintOnHelp )
+ pExecutor->DisableHelp();
+ pPrintSetupDlg->SetOptionsHdl( pExecutor->GetLink() );
}
- else
- {
- // execute PrinterSetupDialog
- PrinterSetupDialog* pPrintSetupDlg = new PrinterSetupDialog( GetWindow() );
-
- if ( pImp->bHasPrintOptions )
- {
- // additional controls for dialog
- pExecutor = new SfxDialogExecutor_Impl( this, pPrintSetupDlg );
- if ( bPrintOnHelp )
- pExecutor->DisableHelp();
- pPrintSetupDlg->SetOptionsHdl( pExecutor->GetLink() );
- }
- pPrintSetupDlg->SetPrinter( pDlgPrinter );
- nDialogRet = pPrintSetupDlg->Execute();
+ pPrintSetupDlg->SetPrinter( pDlgPrinter );
+ nDialogRet = pPrintSetupDlg->Execute();
- if ( pExecutor && pExecutor->GetOptions() )
+ if ( pExecutor && pExecutor->GetOptions() )
+ {
+ if ( nDialogRet == RET_OK )
+ // remark: have to be recorded if possible!
+ pDlgPrinter->SetOptions( *pExecutor->GetOptions() );
+ else
{
- if ( nDialogRet == RET_OK )
- // remark: have to be recorded if possible!
- pDlgPrinter->SetOptions( *pExecutor->GetOptions() );
- else
- {
- pPrinter->SetOptions( *pExecutor->GetOptions() );
- SetPrinter( pPrinter, SFX_PRINTER_OPTIONS );
- }
+ pPrinter->SetOptions( *pExecutor->GetOptions() );
+ SetPrinter( pPrinter, SFX_PRINTER_OPTIONS );
}
+ }
- DELETEZ( pPrintSetupDlg );
+ DELETEZ( pPrintSetupDlg );
- // no recording of PrinterSetup except printer name (is printer dependent)
- rReq.Ignore();
- }
+ // no recording of PrinterSetup except printer name (is printer dependent)
+ rReq.Ignore();
if ( nDialogRet == RET_OK )
{
@@ -623,14 +865,6 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
/* Now lets reset the Dialog printer, since its freed */
if (pPrintDlg)
pPrintDlg->SetPrinter (pPrinter);
-
- if ( SID_PRINTDOC == nId )
- {
- nCopies = pPrintDlg->GetCopyCount();
- bCollate = pPrintDlg->IsCollateChecked();
- }
- else
- break;
}
else
{
@@ -641,226 +875,11 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
rReq.Ignore();
if ( SID_PRINTDOC == nId )
rReq.SetReturnValue(SfxBoolItem(0,FALSE));
- break;
- }
-
- // recording
- rReq.AppendItem( SfxBoolItem( SID_PRINT_COLLATE, bCollate ) );
- rReq.AppendItem( SfxInt16Item( SID_PRINT_COPIES, (INT16) pPrintDlg->GetCopyCount() ) );
- if ( pPrinter->IsPrintFileEnabled() )
- rReq.AppendItem( SfxStringItem( SID_FILE_NAME, pPrinter->GetPrintFile() ) );
- if ( pPrintDlg->IsRangeChecked(PRINTDIALOG_SELECTION) )
- rReq.AppendItem( SfxBoolItem( SID_SELECTION, TRUE ) );
- else if ( pPrintDlg->IsRangeChecked(PRINTDIALOG_RANGE) )
- rReq.AppendItem( SfxStringItem( SID_PRINT_PAGES, pPrintDlg->GetRangeText() ) );
- else if ( pPrintDlg->IsRangeChecked(PRINTDIALOG_FROMTO) )
- {
- // currently this doesn't seem to work -> return values of dialog are always 0
- // seems to be encoded as range string like "1-3"
- rReq.AppendItem( SfxInt16Item( SID_PRINT_FIRST_PAGE, (INT16) pPrintDlg->GetFirstPage() ) );
- rReq.AppendItem( SfxInt16Item( SID_PRINT_LAST_PAGE, (INT16) pPrintDlg->GetLastPage() ) );
}
}
- else if ( rReq.GetArgs() )
- {
- if ( SID_PRINTDOC != nId )
- {
- DBG_ERROR("Wrong slotid!");
- break;
- }
-
- // PrinterDialog is used to transfer information on printing
- pPrintDlg = CreatePrintDialog( GetWindow() );
- if ( bPrintOnHelp )
- pPrintDlg->DisableHelp();
- pPrintDlg->SetPrinter( pPrinter );
- ::DisableRanges( *pPrintDlg, pPrinter );
-
- // PrintToFile requested?
- SFX_REQUEST_ARG(rReq, pFileItem, SfxStringItem, SID_FILE_NAME, FALSE);
- if ( pFileItem )
- {
- pPrinter->EnablePrintFile(TRUE);
- pPrinter->SetPrintFile( pFileItem->GetValue() );
- }
-
- // Collate
- SFX_REQUEST_ARG(rReq, pCollateItem, SfxBoolItem, SID_PRINT_COLLATE, FALSE);
- if ( pCollateItem )
- {
- bCollate = pCollateItem->GetValue();
- pPrintDlg->CheckCollate( bCollate );
- }
-
- // Selection
- SFX_REQUEST_ARG(rReq, pSelectItem, SfxBoolItem, SID_SELECTION, FALSE);
-
- // Pages (as String)
- SFX_REQUEST_ARG(rReq, pPagesItem, SfxStringItem, SID_PRINT_PAGES, FALSE);
-
- // FirstPage
- SFX_REQUEST_ARG(rReq, pFirstPgItem, SfxInt16Item, SID_PRINT_FIRST_PAGE, FALSE);
- USHORT nFrom = 1;
- if ( pFirstPgItem )
- nFrom = pFirstPgItem->GetValue();
-
- // LastPage
- SFX_REQUEST_ARG(rReq, pLastPgItem, SfxInt16Item, SID_PRINT_LAST_PAGE, FALSE);
- USHORT nTo = 9999;
- if ( pLastPgItem )
- nTo = pLastPgItem->GetValue();
-
- // CopyCount
- SFX_REQUEST_ARG(rReq, pCopyItem, SfxInt16Item, SID_PRINT_COPIES, FALSE);
- if ( pCopyItem )
- {
- nCopies = pCopyItem->GetValue();
- pPrintDlg->SetCopyCount( nCopies );
- }
-
- // does the view support ranges?
- if ( pSelectItem && pSelectItem->GetValue() )
- {
- // print selection only
- pPrintDlg->CheckRange(PRINTDIALOG_SELECTION);
- }
- else if ( pPagesItem )
- {
- // get range text from parameter
- // enable ranges
- pPrintDlg->CheckRange(PRINTDIALOG_RANGE);
- pPrintDlg->SetRangeText( pPagesItem->GetValue() );
- }
- else if ( pPrintDlg->IsRangeEnabled(PRINTDIALOG_RANGE) )
- {
- // enable ranges
- // construct range text from page range
- pPrintDlg->CheckRange(PRINTDIALOG_RANGE);
- String aRange = String::CreateFromInt32( nFrom );
- aRange += '-';
- aRange += String::CreateFromInt32( nTo );
- pPrintDlg->SetRangeText( aRange );
- }
- else
- {
- // print page rage
- pPrintDlg->CheckRange(PRINTDIALOG_FROMTO);
- pPrintDlg->SetFirstPage( nFrom );
- pPrintDlg->SetLastPage( nTo );
- }
- }
-
- // intentionally no break for SID_PRINTDOC
- // printing now proceeds like SID_PRINTDOCDIRECT
}
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- case SID_PRINTDOCDIRECT:
- {
- if ( SID_PRINTDOCDIRECT == nId )
- {
- SfxObjectShell* pDoc = GetObjectShell();
- bool bDetectHidden = ( !bSilent && pDoc );
- if ( bDetectHidden && pDoc->QueryHiddenInformation( WhenPrinting, NULL ) != RET_YES )
- return;
-
- // if no printer was selected before
- if ( !pPrinter )
- pPrinter = GetPrinter(TRUE);
-
- if( !pPrinter->IsValid() )
- {
- // redirect slot to call the print dialog if the document's printer is not valid!
- rReq.SetSlot( SID_PRINTDOC );
- ExecPrint_Impl( rReq );
- return;
- }
-
- if( pPrinter->IsOriginal() && pPrinter->GetName() != Printer::GetDefaultPrinterName() )
- {
- // redirect slot to call the print dialog
- // if the document's printer is available but not system default
- rReq.SetSlot( SID_PRINTDOC );
- ExecPrint_Impl( rReq );
- return;
- }
-
- pPrinter->SetNextJobIsQuick();
- }
-
- // if "Collate" was checked, the SfxPrinter must handle the CopyCount itself,
- // usually this is handled by the printer driver
- if( bCollate )
- // set printer to default, handle multiple copies explicitly
- pPrinter->SetCopyCount( 1 );
- else
- pPrinter->SetCopyCount( nCopies );
-
- // enable background printing
- pPrinter->SetPageQueueSize( 1 );
-
- // refresh document info
- using namespace ::com::sun::star;
- SfxObjectShell *pObjSh = GetObjectShell();
- uno::Reference<document::XDocumentProperties> xDocProps(
- pObjSh->getDocProperties());
- ::rtl::OUString aLastPrintedBy = xDocProps->getPrintedBy();
- util::DateTime aLastPrinted = xDocProps->getPrintDate();
-
- // Let the document stay nonmodified during the printing if the configuration says to do so
- SfxPrintGuard_Impl aGuard( pObjSh );
-
- xDocProps->setPrintedBy( GetObjectShell()->IsUseUserData()
- ? ::rtl::OUString( SvtUserOptions().GetFullName() )
- : ::rtl::OUString() );
- ::DateTime now;
- xDocProps->setPrintDate( util::DateTime(
- now.Get100Sec(), now.GetSec(), now.GetMin(), now.GetHour(),
- now.GetDay(), now.GetMonth(), now.GetYear() ) );
-
- GetObjectShell()->Broadcast( SfxPrintingHint( -1, pPrintDlg, pPrinter ) );
- ErrCode nError = DoPrint( pPrinter, pPrintDlg, bSilent, bIsAPI );
- if ( nError == PRINTER_OK )
- {
- Invalidate( SID_PRINTDOC );
- Invalidate( SID_PRINTDOCDIRECT );
- Invalidate( SID_SETUPPRINTER );
- rReq.SetReturnValue(SfxBoolItem(0,TRUE));
-
- SFX_REQUEST_ARG(rReq, pAsyncItem, SfxBoolItem, SID_ASYNCHRON, FALSE);
- if ( pAsyncItem && !pAsyncItem->GetValue() )
- {
- // synchronous execution wanted - wait for end of printing
- while ( pPrinter->IsPrinting())
- Application::Yield();
- }
-
- rReq.Done();
- }
- else
- {
- // printing not succesful, reset DocInfo
- xDocProps->setPrintedBy(aLastPrintedBy);
- xDocProps->setPrintDate(aLastPrinted);
-
- if ( nError != PRINTER_ABORT )
- {
- // "real" problem (not simply printing cancelled by user)
- String aMsg( SfxResId( STR_NOSTARTPRINTER ) );
- if ( !bIsAPI )
- ErrorBox( NULL, WB_OK | WB_DEF_OK, aMsg ).Execute();
- rReq.SetReturnValue(SfxBoolItem(0,FALSE));
- }
-
- rReq.Ignore();
- }
-
- pPrinter->SetNextJobIsQuick( false );
-
- delete pPrintDlg;
- break;
- }
+ break;
}
}
@@ -871,7 +890,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
//--------------------------------------------------------------------
-PrintDialog* SfxViewShell::CreatePrintDialog( Window* pParent )
+PrintDialog* SfxViewShell::CreatePrintDialog( Window* /*pParent*/ )
/* [Beschreibung]
@@ -881,11 +900,15 @@ PrintDialog* SfxViewShell::CreatePrintDialog( Window* pParent )
*/
{
+ #if 0
PrintDialog *pDlg = new PrintDialog( pParent, false );
pDlg->SetFirstPage( 1 );
pDlg->SetLastPage( 9999 );
pDlg->EnableCollate();
return pDlg;
+ #else
+ return NULL;
+ #endif
}
//--------------------------------------------------------------------
@@ -897,10 +920,11 @@ void SfxViewShell::PreparePrint( PrintDialog * )
//--------------------------------------------------------------------
-ErrCode SfxViewShell::DoPrint( SfxPrinter *pPrinter,
- PrintDialog *pPrintDlg,
- BOOL bSilent, BOOL bIsAPI )
+ErrCode SfxViewShell::DoPrint( SfxPrinter* /*pPrinter*/,
+ PrintDialog* /*pPrintDlg*/,
+ BOOL /*bSilent*/, BOOL /*bIsAPI*/ )
{
+ #if 0
// Printer-Dialogbox waehrend des Ausdrucks mu\s schon vor
// StartJob erzeugt werden, da SV bei einem Quit-Event h"angt
SfxPrintProgress *pProgress = new SfxPrintProgress( this, !bSilent );
@@ -910,11 +934,8 @@ ErrCode SfxViewShell::DoPrint( SfxPrinter *pPrinter,
else if ( pDocPrinter != pPrinter )
{
pProgress->RestoreOnEndPrint( pDocPrinter->Clone() );
- USHORT nError = SetPrinter( pPrinter, SFX_PRINTER_PRINTER );
- if ( nError != SFX_PRINTERROR_NONE )
- return PRINTER_ACCESSDENIED;
+ SetPrinter( pPrinter, SFX_PRINTER_PRINTER );
}
-
pProgress->SetWaitMode(FALSE);
// Drucker starten
@@ -935,6 +956,10 @@ ErrCode SfxViewShell::DoPrint( SfxPrinter *pPrinter,
}
return pPrinter->GetError();
+ #else
+ DBG_ERROR( "DoPrint called, dead code !" );
+ return ERRCODE_IO_NOTSUPPORTED;
+ #endif
}
//--------------------------------------------------------------------
@@ -990,23 +1015,12 @@ SfxTabPage* SfxViewShell::CreatePrintOptionsPage
Window* /*pParent*/,
const SfxItemSet& /*rOptions*/
)
-
-/* [Beschreibung]
-
- Diese Factory-Methode wird vom SFx verwendet, um die TabPage mit den
- Print-Optionen, welche "uber das <SfxItemSet> am <SfxPrinter>
- transportiert werden, zu erzeugen.
-
- Abgeleitete Klassen k"onnen diese Methode also "uberladen um die zu
- ihren SfxPrinter passenden Einstellungen vorzunehmen. Dieses sollte
- genau die <SfxTabPage> sein, die auch unter Extras/Einstellungen
- verwendet wird.
-
- Die Basisimplementierung liefert einen 0-Pointer.
-*/
-
{
return 0;
}
+JobSetup SfxViewShell::GetJobSetup() const
+{
+ return JobSetup();
+}
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 86c9ba0bb70e..4ee90289347e 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1261,7 +1261,7 @@ SfxViewShell::SfxViewShell
{
DBG_CTOR(SfxViewShell, 0);
- pImp->pPrinterCommandQueue = new SfxAsyncPrintExec_Impl( this );
+ //pImp->pPrinterCommandQueue = new SfxAsyncPrintExec_Impl( this );
pImp->pController = 0;
pImp->bIsShowView =
!(SFX_VIEW_NO_SHOW == (nFlags & SFX_VIEW_NO_SHOW));
@@ -1322,7 +1322,7 @@ SfxViewShell::~SfxViewShell()
DELETEZ( pImp->pAccExec );
}
- DELETEZ( pImp->pPrinterCommandQueue );
+ //DELETEZ( pImp->pPrinterCommandQueue );
DELETEZ( pImp );
DELETEZ( pIPClientList );
}
@@ -1578,7 +1578,7 @@ SfxViewShell* SfxViewShell::GetFirst
if ( pFrame == pShell->GetViewFrame() )
{
// only ViewShells with a valid ViewFrame will be returned
- if ( ( !bOnlyVisible || pFrame->IsVisible_Impl() ) && ( !pType || pShell->IsA(*pType) ) )
+ if ( ( !bOnlyVisible || pFrame->IsVisible() ) && ( !pType || pShell->IsA(*pType) ) )
return pShell;
break;
}
@@ -1620,7 +1620,7 @@ SfxViewShell* SfxViewShell::GetNext
if ( pFrame == pShell->GetViewFrame() )
{
// only ViewShells with a valid ViewFrame will be returned
- if ( ( !bOnlyVisible || pFrame->IsVisible_Impl() ) && ( !pType || pShell->IsA(*pType) ) )
+ if ( ( !bOnlyVisible || pFrame->IsVisible() ) && ( !pType || pShell->IsA(*pType) ) )
return pShell;
break;
}
@@ -2211,7 +2211,7 @@ BOOL SfxViewShell::HasMouseClickListeners_Impl()
void SfxViewShell::SetAdditionalPrintOptions( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& rOpts )
{
pImp->aPrintOpts = rOpts;
- GetObjectShell()->Broadcast( SfxPrintingHint( -3, NULL, NULL, rOpts ) );
+// GetObjectShell()->Broadcast( SfxPrintingHint( -3, NULL, NULL, rOpts ) );
}
BOOL SfxViewShell::Escape()
@@ -2219,6 +2219,19 @@ BOOL SfxViewShell::Escape()
return GetViewFrame()->GetBindings().Execute( SID_TERMINATE_INPLACEACTIVATION );
}
+Reference< view::XRenderable > SfxViewShell::GetRenderable()
+{
+ Reference< view::XRenderable >xRender;
+ SfxObjectShell* pObj = GetObjectShell();
+ if( pObj )
+ {
+ Reference< frame::XModel > xModel( pObj->GetModel() );
+ if( xModel.is() )
+ xRender = Reference< view::XRenderable >( xModel, UNO_QUERY );
+ }
+ return xRender;
+}
+
void SfxViewShell::AddRemoveClipboardListener( const uno::Reference < datatransfer::clipboard::XClipboardListener >& rClp, BOOL bAdd )
{
try
diff --git a/svx/inc/fmhelp.hrc b/svx/inc/fmhelp.hrc
index 5c3acad950e6..ef445ab11f82 100644
--- a/svx/inc/fmhelp.hrc
+++ b/svx/inc/fmhelp.hrc
@@ -33,6 +33,10 @@
// include -----------------------------------------------------------
#include <svl/solar.hrc>
+// in solar.hrc
+//#define HID_FORMS_START (HID_LIB_START+4000)
+//#define HID_FORMS_END (HID_LIB_START+4999)
+
// Help-Ids --------------------------------------------------------------
#define HID_DLG_DBMSG ( HID_FORMS_START + 1)
#define HID_FORM_NAVIGATOR ( HID_FORMS_START + 2)
diff --git a/svx/inc/svx/svdpntv.hxx b/svx/inc/svx/svdpntv.hxx
index 940133da5568..014afacb0706 100644..100755
--- a/svx/inc/svx/svdpntv.hxx
+++ b/svx/inc/svx/svdpntv.hxx
@@ -215,10 +215,11 @@ protected:
// is this a preview renderer?
unsigned mbPreviewRenderer : 1;
- // flags for calc for suppressing OLE, CHART or DRAW objects
+ // flags for calc and sw for suppressing OLE, CHART or DRAW objects
unsigned mbHideOle : 1;
unsigned mbHideChart : 1;
- unsigned mbHideDraw : 1;
+ unsigned mbHideDraw : 1; // hide draw objects other than form controls
+ unsigned mbHideFormControl : 1; // hide form controls only
public:
// #114898#
@@ -433,13 +434,15 @@ public:
sal_Bool IsPreviewRenderer() const { return (sal_Bool )mbPreviewRenderer; }
void SetPreviewRenderer(bool bOn) { if((unsigned)bOn != mbPreviewRenderer) { mbPreviewRenderer=bOn; }}
- // access methods for calc hide object modes
+ // access methods for calc and sw hide object modes
bool getHideOle() const { return mbHideOle; }
bool getHideChart() const { return mbHideChart; }
bool getHideDraw() const { return mbHideDraw; }
+ bool getHideFormControl() const { return mbHideFormControl; }
void setHideOle(bool bNew) { if(bNew != (bool)mbHideOle) mbHideOle = bNew; }
void setHideChart(bool bNew) { if(bNew != (bool)mbHideChart) mbHideChart = bNew; }
void setHideDraw(bool bNew) { if(bNew != (bool)mbHideDraw) mbHideDraw = bNew; }
+ void setHideFormControl(bool bNew) { if(bNew != (bool)mbHideFormControl) mbHideFormControl = bNew; }
void SetGridCoarse(const Size& rSiz) { aGridBig=rSiz; }
void SetGridFine(const Size& rSiz) { aGridFin=rSiz; if (aGridFin.Height()==0) aGridFin.Height()=aGridFin.Width(); if (bGridVisible) InvalidateAllWin(); } // #40479#
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 58455f48589e..513a3aa57a80 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -33,7 +33,7 @@
// include ---------------------------------------------------------------
#include <sfx2/viewsh.hxx> // SfxViewShell
-#include <sfx2/printer.hxx> // SfxPrinter
+#include <sfx2/printer.hxx> // Printer
#include <vcl/metric.hxx>
#include <vcl/svapp.hxx>
#include <unicode/uchar.h>
diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx
index b785b2285873..244fea07285f 100644..100755
--- a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx
@@ -40,6 +40,8 @@
#include <svx/svdoole2.hxx>
#include <svx/svdview.hxx>
+#include "fmobj.hxx"
+
//////////////////////////////////////////////////////////////////////////////
namespace sdr
@@ -91,8 +93,9 @@ namespace sdr
const bool bHideOle(rSdrView.getHideOle());
const bool bHideChart(rSdrView.getHideChart());
const bool bHideDraw(rSdrView.getHideDraw());
+ const bool bHideFormControl(rSdrView.getHideFormControl());
- if(bHideOle || bHideChart || bHideDraw)
+ if(bHideOle || bHideChart || bHideDraw || bHideFormControl)
{
if(OBJ_OLE2 == rObject.GetObjIdentifier())
{
@@ -123,8 +126,13 @@ namespace sdr
}
else
{
+ const bool bIsFormControl = dynamic_cast< const FmFormObj * >( &rObject ) != 0;
+ if(bIsFormControl && bHideFormControl)
+ {
+ return false;
+ }
// any other draw object
- if(bHideDraw)
+ if(!bIsFormControl && bHideDraw)
{
return false;
}
diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
index 224327f01a8b..5f7bf41386e0 100644
--- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
@@ -351,6 +351,12 @@ namespace sdr { namespace contact {
if ( !_rControl.is() )
return;
+ #if OSL_DEBUG_LEVEL > 0
+ ::basegfx::B2DTuple aViewScale, aViewTranslate;
+ double nViewRotate(0), nViewShearX(0);
+ _rViewTransformation.decompose( aViewScale, aViewTranslate, nViewRotate, nViewShearX );
+ #endif
+
// transform the logic bound rect, using the view transformation, to pixel coordinates
::basegfx::B2DPoint aTopLeft( _rLogicBoundingRect.Left(), _rLogicBoundingRect.Top() );
aTopLeft *= _rViewTransformation;
@@ -615,7 +621,7 @@ namespace sdr { namespace contact {
Failure of this method will be reported via an assertion in a non-product version.
*/
- bool ensureControl();
+ bool ensureControl( const basegfx::B2DHomMatrix* _pInitialViewTransformationOrNULL );
/** returns our XControl, if it already has been created
@@ -658,6 +664,8 @@ namespace sdr { namespace contact {
IPageViewAccess& _rPageView,
const OutputDevice& _rDevice,
const SdrUnoObj& _rUnoObject,
+ const basegfx::B2DHomMatrix& _rInitialViewTransformation,
+ const basegfx::B2DHomMatrix& _rInitialZoomNormalization,
ControlHolder& _out_rControl
);
@@ -832,7 +840,11 @@ namespace sdr { namespace contact {
/** ensures that we have a control for the given PageView/OutputDevice
*/
- bool impl_ensureControl_nothrow( IPageViewAccess& _rPageView, const OutputDevice& _rDevice );
+ bool impl_ensureControl_nothrow(
+ IPageViewAccess& _rPageView,
+ const OutputDevice& _rDevice,
+ const basegfx::B2DHomMatrix& _rInitialViewTransformation
+ );
/** retrieves the device which a PageView belongs to, starting from its ObjectContactOfPageView
@@ -1018,8 +1030,8 @@ namespace sdr { namespace contact {
//--------------------------------------------------------------------
void ViewObjectContactOfUnoControl_Impl::positionAndZoomControl( const basegfx::B2DHomMatrix& _rViewTransformation ) const
{
- OSL_PRECOND( ( m_pOutputDeviceForWindow != NULL ) && m_aControl.is(), "ViewObjectContactOfUnoControl_Impl::positionAndZoomControl: no output device or no control!" );
- if ( ( m_pOutputDeviceForWindow == NULL ) || !m_aControl.is() )
+ OSL_PRECOND( m_aControl.is(), "ViewObjectContactOfUnoControl_Impl::positionAndZoomControl: no output device or no control!" );
+ if ( !m_aControl.is() )
return;
try
@@ -1039,7 +1051,7 @@ namespace sdr { namespace contact {
}
//--------------------------------------------------------------------
- bool ViewObjectContactOfUnoControl_Impl::ensureControl()
+ bool ViewObjectContactOfUnoControl_Impl::ensureControl( const basegfx::B2DHomMatrix* _pInitialViewTransformationOrNULL )
{
OSL_PRECOND( !impl_isDisposed_nofail(), "ViewObjectContactOfUnoControl_Impl::ensureControl: already disposed()" );
if ( impl_isDisposed_nofail() )
@@ -1049,16 +1061,20 @@ namespace sdr { namespace contact {
if ( pPageViewContact )
{
SdrPageViewAccess aPVAccess( pPageViewContact->GetPageWindow().GetPageView() );
+ const OutputDevice& rDevice( impl_getPageViewOutputDevice_nothrow( *pPageViewContact ) );
return impl_ensureControl_nothrow(
aPVAccess,
- impl_getPageViewOutputDevice_nothrow( *pPageViewContact )
+ rDevice,
+ _pInitialViewTransformationOrNULL ? *_pInitialViewTransformationOrNULL : rDevice.GetViewTransformation()
);
}
DummyPageViewAccess aNoPageView;
+ const OutputDevice& rDevice( impl_getOutputDevice_throw() );
return impl_ensureControl_nothrow(
aNoPageView,
- impl_getOutputDevice_throw()
+ rDevice,
+ _pInitialViewTransformationOrNULL ? *_pInitialViewTransformationOrNULL : rDevice.GetViewTransformation()
);
}
@@ -1101,7 +1117,8 @@ namespace sdr { namespace contact {
}
//--------------------------------------------------------------------
- bool ViewObjectContactOfUnoControl_Impl::impl_ensureControl_nothrow( IPageViewAccess& _rPageView, const OutputDevice& _rDevice )
+ bool ViewObjectContactOfUnoControl_Impl::impl_ensureControl_nothrow( IPageViewAccess& _rPageView, const OutputDevice& _rDevice,
+ const basegfx::B2DHomMatrix& _rInitialViewTransformation )
{
if ( m_bCreatingControl )
{
@@ -1145,7 +1162,7 @@ namespace sdr { namespace contact {
return false;
ControlHolder aControl;
- if ( !createControlForDevice( _rPageView, _rDevice, *pUnoObject, aControl ) )
+ if ( !createControlForDevice( _rPageView, _rDevice, *pUnoObject, _rInitialViewTransformation, m_aZoomLevelNormalization, aControl ) )
return false;
m_pOutputDeviceForWindow = &_rDevice;
@@ -1180,7 +1197,8 @@ namespace sdr { namespace contact {
//--------------------------------------------------------------------
bool ViewObjectContactOfUnoControl_Impl::createControlForDevice( IPageViewAccess& _rPageView,
- const OutputDevice& _rDevice, const SdrUnoObj& _rUnoObject, ControlHolder& _out_rControl )
+ const OutputDevice& _rDevice, const SdrUnoObj& _rUnoObject, const basegfx::B2DHomMatrix& _rInitialViewTransformation,
+ const basegfx::B2DHomMatrix& _rInitialZoomNormalization, ControlHolder& _out_rControl )
{
_out_rControl.clear();
@@ -1204,8 +1222,8 @@ namespace sdr { namespace contact {
UnoControlContactHelper::adjustControlGeometry_throw(
_out_rControl,
_rUnoObject.GetLogicRect(),
- _rDevice.GetViewTransformation(),
- _rDevice.GetInverseViewTransformation()
+ _rInitialViewTransformation,
+ _rInitialZoomNormalization
);
// #107049# set design mode before peer is created,
@@ -1650,7 +1668,7 @@ namespace sdr { namespace contact {
#endif
// force control here to make it a VCL ChildWindow. Will be fetched
// and used below by getExistentControl()
- m_pVOCImpl->ensureControl();
+ m_pVOCImpl->ensureControl( &_rViewInformation.getObjectToViewTransformation() );
impl_positionAndZoomControl( _rViewInformation );
// get needed data
@@ -1709,7 +1727,7 @@ namespace sdr { namespace contact {
Reference< XControl > ViewObjectContactOfUnoControl::getControl()
{
VOCGuard aGuard( *m_pImpl );
- m_pImpl->ensureControl();
+ m_pImpl->ensureControl( NULL );
return m_pImpl->getExistentControl().getControl();
}
@@ -1720,7 +1738,8 @@ namespace sdr { namespace contact {
ControlHolder aControl;
InvisibleControlViewAccess aSimulatePageView( _inout_ControlContainer );
- OSL_VERIFY( ViewObjectContactOfUnoControl_Impl::createControlForDevice( aSimulatePageView, _rWindow, _rUnoObject, aControl ) );
+ OSL_VERIFY( ViewObjectContactOfUnoControl_Impl::createControlForDevice( aSimulatePageView, _rWindow, _rUnoObject,
+ _rWindow.GetViewTransformation(), _rWindow.GetInverseViewTransformation(), aControl ) );
return aControl.getControl();
}
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 8c46e1d06bb6..238bdf497180 100644..100755
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -275,7 +275,8 @@ SdrPaintView::SdrPaintView(SdrModel* pModel1, OutputDevice* pOut)
mbPagePaintingAllowed(true),
mbHideOle(false),
mbHideChart(false),
- mbHideDraw(false)
+ mbHideDraw(false),
+ mbHideFormControl(false)
{
DBG_CTOR(SdrPaintView,NULL);
pMod=pModel1;