summaryrefslogtreecommitdiff
path: root/basctl
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2010-01-15 16:47:42 +0100
committerKurt Zenker <kz@openoffice.org>2010-01-15 16:47:42 +0100
commite2d9dd6fb86e50b45f2e7e838b5b0cd230bebef4 (patch)
tree3026fa256bcbbea6713e5bb3f57a7f015308b432 /basctl
parent341b78bd15504496e4c2177842a40657cef277d7 (diff)
parentf1f63e211d1052b0005f3a7abed07d6b3240fd43 (diff)
CWS-TOOLING: integrate CWS printerpullpages
Notes
split repo tag: components_ooo/DEV300_m70
Diffstat (limited to 'basctl')
-rw-r--r--basctl/inc/basidesh.hrc1
-rw-r--r--basctl/source/basicide/basicprint.src43
-rw-r--r--basctl/source/basicide/basicrenderable.cxx197
-rw-r--r--basctl/source/basicide/basicrenderable.hxx76
-rw-r--r--basctl/source/basicide/baside2.cxx50
-rw-r--r--basctl/source/basicide/baside2.hxx7
-rw-r--r--basctl/source/basicide/baside3.cxx9
-rw-r--r--basctl/source/basicide/basides2.cxx10
-rw-r--r--basctl/source/basicide/bastypes.cxx7
-rw-r--r--basctl/source/basicide/makefile.mk5
-rw-r--r--basctl/source/dlged/dlged.cxx19
-rw-r--r--basctl/source/inc/baside3.hxx5
-rw-r--r--basctl/source/inc/basidesh.hxx4
-rw-r--r--basctl/source/inc/bastypes.hxx6
-rw-r--r--basctl/source/inc/dlged.hxx5
15 files changed, 404 insertions, 40 deletions
diff --git a/basctl/inc/basidesh.hrc b/basctl/inc/basidesh.hrc
index ddff29283d2d..d4f048cda8d7 100644
--- a/basctl/inc/basidesh.hrc
+++ b/basctl/inc/basidesh.hrc
@@ -58,6 +58,7 @@
#define RID_DLG_NEWLIB ( RID_BASICIDE_START + 42 )
#define RID_DLG_EXPORT ( RID_BASICIDE_START + 43 )
#define RID_POPUP_DLGED ( RID_BASICIDE_START + 62 )
+#define RID_PRINTDLG_STRLIST ( RID_BASICIDE_START + 78 )
#define RID_IMG_LOCKED_HC ( RID_BASICIDE_START + 6 )
#define RID_IMGBTN_REMOVEWATCH ( RID_BASICIDE_START + 8 )
diff --git a/basctl/source/basicide/basicprint.src b/basctl/source/basicide/basicprint.src
new file mode 100644
index 000000000000..be5e7d2e1de3
--- /dev/null
+++ b/basctl/source/basicide/basicprint.src
@@ -0,0 +1,43 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * $RCSfile: basidesh.src,v $
+ * $Revision: 1.107 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#include <basidesh.hrc>
+
+StringArray RID_PRINTDLG_STRLIST
+{
+ ItemList [en-US] =
+ {
+ < "Print range"; >;
+ < "All ~Pages"; >;
+ < "Print all pages of the printable content."; >;
+ < "Pa~ges"; >;
+ < "Print only some pages of the printable content."; >;
+ };
+};
diff --git a/basctl/source/basicide/basicrenderable.cxx b/basctl/source/basicide/basicrenderable.cxx
new file mode 100644
index 000000000000..fa30af874cff
--- /dev/null
+++ b/basctl/source/basicide/basicrenderable.cxx
@@ -0,0 +1,197 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * $RCSfile: basidesh.hxx,v $
+ * $Revision: 1.10 $
+ *
+ * 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.
+ *
+ ************************************************************************/
+#include "precompiled_basctl.hxx"
+
+#include "basicrenderable.hxx"
+#include "bastypes.hxx"
+#include "basidesh.hrc"
+
+#include "com/sun/star/awt/XDevice.hpp"
+#include "toolkit/awt/vclxdevice.hxx"
+#include "vcl/print.hxx"
+#include "tools/multisel.hxx"
+#include "tools/resary.hxx"
+
+using namespace com::sun::star;
+using namespace com::sun::star::uno;
+using namespace basicide;
+
+BasicRenderable::BasicRenderable( IDEBaseWindow* pWin )
+: cppu::WeakComponentImplHelper1< com::sun::star::view::XRenderable >( maMutex )
+, mpWindow( pWin )
+{
+ ResStringArray aStrings( IDEResId( RID_PRINTDLG_STRLIST ) );
+ DBG_ASSERT( aStrings.Count() >= 5, "resource incomplete" );
+ if( aStrings.Count() < 5 ) // bad resource ?
+ return;
+
+ m_aUIProperties.realloc( 3 );
+
+ // create Subgroup for print range
+ vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt;
+ aPrintRangeOpt.maGroupHint = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintRange" ) );
+ aPrintRangeOpt.mbInternalOnly = sal_True;
+ m_aUIProperties[0].Value = getSubgroupControlOpt( rtl::OUString( aStrings.GetString( 0 ) ),
+ rtl::OUString(),
+ aPrintRangeOpt
+ );
+
+ // create a choice for the range to print
+ rtl::OUString aPrintContentName( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) );
+ Sequence< rtl::OUString > aChoices( 2 );
+ Sequence< rtl::OUString > aHelpTexts( 2 );
+ aChoices[0] = aStrings.GetString( 1 );
+ aHelpTexts[0] = aStrings.GetString( 2 );
+ aChoices[1] = aStrings.GetString( 3 );
+ aHelpTexts[1] = aStrings.GetString( 4 );
+ m_aUIProperties[1].Value = getChoiceControlOpt( rtl::OUString(),
+ aHelpTexts,
+ aPrintContentName,
+ aChoices,
+ 0 );
+
+ // create a an Edit dependent on "Pages" selected
+ vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintContentName, 1, sal_True );
+ m_aUIProperties[2].Value = getEditControlOpt( rtl::OUString(),
+ rtl::OUString(),
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageRange" ) ),
+ rtl::OUString(),
+ aPageRangeOpt
+ );
+}
+
+BasicRenderable::~BasicRenderable()
+{
+}
+
+Printer* BasicRenderable::getPrinter()
+{
+ Printer* pPrinter = NULL;
+ Any aValue( getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RenderDevice" ) ) ) );
+ Reference<awt::XDevice> xRenderDevice;
+
+ if( aValue >>= xRenderDevice )
+ {
+ VCLXDevice* pDevice = VCLXDevice::GetImplementation(xRenderDevice);
+ OutputDevice* pOut = pDevice ? pDevice->GetOutputDevice() : NULL;
+ pPrinter = dynamic_cast<Printer*>(pOut);
+ }
+ return pPrinter;
+}
+
+sal_Int32 SAL_CALL BasicRenderable::getRendererCount (
+ const Any&, const Sequence<beans::PropertyValue >& i_xOptions
+ ) throw (lang::IllegalArgumentException, RuntimeException)
+{
+ processProperties( i_xOptions );
+
+ sal_Int32 nCount = 0;
+ if( mpWindow )
+ {
+ Printer* pPrinter = getPrinter();
+ if( pPrinter )
+ {
+ nCount = mpWindow->countPages( pPrinter );
+ sal_Int64 nContent = getIntValue( "PrintContent", -1 );
+ if( nContent == 1 )
+ {
+ rtl::OUString aPageRange( getStringValue( "PageRange" ) );
+ MultiSelection aSel( aPageRange );
+ long nSelCount = aSel.GetSelectCount();
+ if( nSelCount >= 0 && nSelCount < nCount )
+ nCount = nSelCount;
+ }
+ }
+ else
+ throw lang::IllegalArgumentException();
+ }
+
+ return nCount;
+}
+
+Sequence<beans::PropertyValue> SAL_CALL BasicRenderable::getRenderer (
+ sal_Int32, const Any&, const Sequence<beans::PropertyValue>& i_xOptions
+ ) throw (lang::IllegalArgumentException, RuntimeException)
+{
+ processProperties( i_xOptions );
+
+ Sequence< beans::PropertyValue > aVals;
+ // insert page size here
+ Printer* pPrinter = getPrinter();
+ // no renderdevice is legal; the first call is to get our print ui options
+ if( pPrinter )
+ {
+ Size aPageSize( pPrinter->PixelToLogic( pPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
+
+ aVals.realloc( 1 );
+ aVals[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) );
+ awt::Size aSize;
+ aSize.Width = aPageSize.Width();
+ aSize.Height = aPageSize.Height();
+ aVals[0].Value <<= aSize;
+ }
+
+ appendPrintUIOptions( aVals );
+
+ return aVals;
+}
+
+void SAL_CALL BasicRenderable::render (
+ sal_Int32 nRenderer, const Any&,
+ const Sequence<beans::PropertyValue>& i_xOptions
+ ) throw (lang::IllegalArgumentException, RuntimeException)
+{
+ processProperties( i_xOptions );
+
+ if( mpWindow )
+ {
+ Printer* pPrinter = getPrinter();
+ if( pPrinter )
+ {
+ sal_Int64 nContent = getIntValue( "PrintContent", -1 );
+ if( nContent == 1 )
+ {
+ rtl::OUString aPageRange( getStringValue( "PageRange" ) );
+ MultiSelection aSel( aPageRange );
+ long nSelect = aSel.FirstSelected();
+ while( nSelect != long(SFX_ENDOFSELECTION) && nRenderer-- )
+ nSelect = aSel.NextSelected();
+ if( nSelect != long(SFX_ENDOFSELECTION) )
+ mpWindow->printPage( sal_Int32(nSelect-1), pPrinter );
+ }
+ else
+ mpWindow->printPage( nRenderer, pPrinter );
+ }
+ else
+ throw lang::IllegalArgumentException();
+ }
+}
+
+
diff --git a/basctl/source/basicide/basicrenderable.hxx b/basctl/source/basicide/basicrenderable.hxx
new file mode 100644
index 000000000000..7cad19c784be
--- /dev/null
+++ b/basctl/source/basicide/basicrenderable.hxx
@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ * 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
+ *
+ * $RCSfile: basidesh.hxx,v $
+ * $Revision: 1.10 $
+ *
+ * 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 _BASICRENDERABLE_HXX
+#define _BASICRENDERABLE_HXX
+
+#include "com/sun/star/view/XRenderable.hpp"
+#include "cppuhelper/compbase1.hxx"
+
+#include "vcl/print.hxx"
+
+class IDEBaseWindow;
+
+namespace basicide
+{
+class BasicRenderable :
+ public cppu::WeakComponentImplHelper1< com::sun::star::view::XRenderable >,
+ public vcl::PrinterOptionsHelper
+{
+ IDEBaseWindow* mpWindow;
+ osl::Mutex maMutex;
+
+ Printer* getPrinter();
+public:
+ BasicRenderable( IDEBaseWindow* pWin );
+ virtual ~BasicRenderable();
+
+ // XRenderable
+ virtual sal_Int32 SAL_CALL getRendererCount (
+ const com::sun::star::uno::Any& aSelection,
+ const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue >& xOptions)
+ throw (com::sun::star::lang::IllegalArgumentException, com::sun::star::uno::RuntimeException);
+
+ virtual com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> SAL_CALL getRenderer (
+ sal_Int32 nRenderer,
+ const com::sun::star::uno::Any& rSelection,
+ const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rxOptions)
+ throw (com::sun::star::lang::IllegalArgumentException, com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL render (
+ sal_Int32 nRenderer,
+ const com::sun::star::uno::Any& rSelection,
+ const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& rxOptions)
+ throw (com::sun::star::lang::IllegalArgumentException, com::sun::star::uno::RuntimeException);
+
+};
+
+} // namespace
+
+#endif
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index e23cd68a75af..6612f82fb92b 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -110,7 +110,7 @@ DBG_NAME( ModulWindow )
TYPEINIT1( ModulWindow , IDEBaseWindow );
-void lcl_PrintHeader( Printer* pPrinter, USHORT nPages, USHORT nCurPage, const String& rTitle )
+void lcl_PrintHeader( Printer* pPrinter, USHORT nPages, USHORT nCurPage, const String& rTitle, bool bOutput )
{
short nLeftMargin = LMARGPRN;
Size aSz = pPrinter->GetOutputSize();
@@ -136,14 +136,16 @@ void lcl_PrintHeader( Printer* pPrinter, USHORT nPages, USHORT nCurPage, const S
long nXLeft = nLeftMargin-nBorder;
long nXRight = aSz.Width()-RMARGPRN+nBorder;
- pPrinter->DrawRect( Rectangle(
- Point( nXLeft, nYTop ),
- Size( nXRight-nXLeft, aSz.Height() - nYTop - BMARGPRN + nBorder ) ) );
+ if( bOutput )
+ pPrinter->DrawRect( Rectangle(
+ Point( nXLeft, nYTop ),
+ Size( nXRight-nXLeft, aSz.Height() - nYTop - BMARGPRN + nBorder ) ) );
long nY = TMARGPRN-2*nBorder;
Point aPos( nLeftMargin, nY );
- pPrinter->DrawText( aPos, rTitle );
+ if( bOutput )
+ pPrinter->DrawText( aPos, rTitle );
if ( nPages != 1 )
{
aFont.SetWeight( WEIGHT_NORMAL );
@@ -154,13 +156,15 @@ void lcl_PrintHeader( Printer* pPrinter, USHORT nPages, USHORT nCurPage, const S
aPageStr += String::CreateFromInt32( nCurPage );
aPageStr += ']';
aPos.X() += pPrinter->GetTextWidth( rTitle );
- pPrinter->DrawText( aPos, aPageStr );
+ if( bOutput )
+ pPrinter->DrawText( aPos, aPageStr );
}
nY = TMARGPRN-nBorder;
- pPrinter->DrawLine( Point( nXLeft, nY ), Point( nXRight, nY ) );
+ if( bOutput )
+ pPrinter->DrawLine( Point( nXLeft, nY ), Point( nXRight, nY ) );
pPrinter->SetFont( aOldFont );
pPrinter->SetFillColor( aOldFillColor );
@@ -914,8 +918,23 @@ void __EXPORT ModulWindow::UpdateData()
}
}
+sal_Int32 ModulWindow::countPages( Printer* pPrinter )
+{
+ return FormatAndPrint( pPrinter, -1 );
+}
+
+void ModulWindow::printPage( sal_Int32 nPage, Printer* pPrinter )
+{
+ FormatAndPrint( pPrinter, nPage );
+}
-void __EXPORT ModulWindow::PrintData( Printer* pPrinter )
+/* implementation note: this is totally inefficient for the XRenderable interface
+ usage since the whole "document" will be format for every page. Should this ever
+ become a problem we should
+ - format only once for every new printer
+ - keep an index list for each page which is the starting paragraph
+*/
+sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage )
{
DBG_CHKTHIS( ModulWindow, 0 );
@@ -949,10 +968,8 @@ void __EXPORT ModulWindow::PrintData( Printer* pPrinter )
USHORT nPages = (USHORT) (nParas/nLinespPage+1 );
USHORT nCurPage = 1;
- pPrinter->StartJob( aTitle );
- pPrinter->StartPage();
// Header drucken...
- lcl_PrintHeader( pPrinter, nPages, nCurPage, aTitle );
+ lcl_PrintHeader( pPrinter, nPages, nCurPage, aTitle, nPrintPage == 0 );
Point aPos( LMARGPRN, TMARGPRN );
for ( ULONG nPara = 0; nPara < nParas; nPara++ )
{
@@ -966,20 +983,19 @@ void __EXPORT ModulWindow::PrintData( Printer* pPrinter )
if ( aPos.Y() > ( aPaperSz.Height()+TMARGPRN ) )
{
nCurPage++;
- pPrinter->EndPage();
- pPrinter->StartPage();
- lcl_PrintHeader( pPrinter, nPages, nCurPage, aTitle );
+ lcl_PrintHeader( pPrinter, nPages, nCurPage, aTitle, nCurPage-1 == nPrintPage );
aPos = Point( LMARGPRN, TMARGPRN+nLineHeight );
}
- pPrinter->DrawText( aPos, aTmpLine );
+ if( nCurPage-1 == nPrintPage )
+ pPrinter->DrawText( aPos, aTmpLine );
}
aPos.Y() += nParaSpace;
}
- pPrinter->EndPage();
- pPrinter->EndJob();
pPrinter->SetFont( aOldFont );
pPrinter->SetMapMode( eOldMapMode );
+
+ return sal_Int32(nCurPage);
}
diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx
index 0c575229411e..25a04b0da6ab 100644
--- a/basctl/source/basicide/baside2.hxx
+++ b/basctl/source/basicide/baside2.hxx
@@ -359,6 +359,7 @@ private:
void GoOnTop();
void AssertValidEditEngine();
+ sal_Int32 FormatAndPrint( Printer* pPrinter, sal_Int32 nPage = -1 );
protected:
virtual void Resize();
virtual void GetFocus();
@@ -380,7 +381,11 @@ public:
virtual void StoreData();
virtual void UpdateData();
virtual BOOL CanClose();
- virtual void PrintData( Printer* pPrinter );
+ // virtual void PrintData( Printer* pPrinter );
+ // return number of pages to be printed
+ virtual sal_Int32 countPages( Printer* pPrinter );
+ // print page
+ virtual void printPage( sal_Int32 nPage, Printer* pPrinter );
virtual String GetTitle();
virtual BasicEntryDescriptor CreateEntryDescriptor();
virtual BOOL AllowUndo();
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index d33310b6e339..77181a0a2044 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -1368,9 +1368,14 @@ void DialogWindow::Deactivating()
BasicIDE::MarkDocumentModified( GetDocument() );
}
-void DialogWindow::PrintData( Printer* pPrinter )
+sal_Int32 DialogWindow::countPages( Printer* pPrinter )
{
- pEditor->PrintData( pPrinter, CreateQualifiedName() );
+ return pEditor->countPages( pPrinter );
+}
+
+void DialogWindow::printPage( sal_Int32 nPage, Printer* pPrinter )
+{
+ pEditor->printPage( nPage, pPrinter, CreateQualifiedName() );
}
void DialogWindow::DataChanged( const DataChangedEvent& rDCEvt )
diff --git a/basctl/source/basicide/basides2.cxx b/basctl/source/basicide/basides2.cxx
index 74e1d59aad4d..eb59ca4f082b 100644
--- a/basctl/source/basicide/basides2.cxx
+++ b/basctl/source/basicide/basides2.cxx
@@ -38,8 +38,7 @@
#include <ide_pch.hxx>
#include <basic/sbx.hxx>
-
-#define _SOLAR__PRIVATE 1
+#include "basicrenderable.hxx"
#include <com/sun/star/frame/XTitle.hpp>
@@ -85,6 +84,12 @@ IMPL_LINK( BasicIDEShell, ObjectDialogInsertHdl, ObjectCatalog *, pObjCat )
}
*/
+Reference< view::XRenderable > BasicIDEShell::GetRenderable()
+{
+ return Reference< view::XRenderable >( new basicide::BasicRenderable( pCurWin ) );
+}
+
+#if 0
USHORT __EXPORT BasicIDEShell::Print( SfxProgress &rProgress, BOOL bIsAPI, PrintDialog *pPrintDialog )
{
if ( pCurWin )
@@ -98,6 +103,7 @@ USHORT __EXPORT BasicIDEShell::Print( SfxProgress &rProgress, BOOL bIsAPI, Print
}
return 0;
}
+#endif
BOOL BasicIDEShell::HasSelection( BOOL /* bText */ ) const
{
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 3b64b11b9abc..c44d3d00fdf0 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -207,13 +207,6 @@ void __EXPORT IDEBaseWindow::UpdateData()
}
-
-void __EXPORT IDEBaseWindow::PrintData( Printer* )
-{
-}
-
-
-
String __EXPORT IDEBaseWindow::GetTitle()
{
return String();
diff --git a/basctl/source/basicide/makefile.mk b/basctl/source/basicide/makefile.mk
index 8766473d8157..c5222951da6c 100644
--- a/basctl/source/basicide/makefile.mk
+++ b/basctl/source/basicide/makefile.mk
@@ -51,7 +51,8 @@ CDEFS+=-DBASICDEBUG
# --- Allgemein ----------------------------------------------------------
-EXCEPTIONSFILES=$(SLO)$/scriptdocument.obj \
+EXCEPTIONSFILES=$(SLO)$/basicrenderable.obj \
+ $(SLO)$/scriptdocument.obj \
$(SLO)$/basidesh.obj \
$(SLO)$/basides1.obj \
$(SLO)$/basides2.obj \
@@ -84,7 +85,7 @@ SLOFILES = $(EXCEPTIONSFILES) \
$(SLO)$/objdlg.obj \
SRS1NAME=$(TARGET)
-SRC1FILES= basidesh.src macrodlg.src moptions.src moduldlg.src objdlg.src brkdlg.src tbxctl.src
+SRC1FILES= basidesh.src macrodlg.src moptions.src moduldlg.src objdlg.src brkdlg.src tbxctl.src basicprint.src
.INCLUDE : target.mk
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index 423ef39079a0..80b9c26e07b4 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -1283,7 +1283,20 @@ void lcl_PrintHeader( Printer* pPrinter, const String& rTitle ) // not working y
//----------------------------------------------------------------------------
-void DlgEditor::PrintData( Printer* pPrinter, const String& rTitle ) // not working yet
+sal_Int32 DlgEditor::countPages( Printer* )
+{
+ return 1;
+}
+
+void DlgEditor::printPage( sal_Int32 nPage, Printer* pPrinter, const String& rTitle )
+{
+ if( nPage == 0 )
+ Print( pPrinter, rTitle );
+}
+
+//----------------------------------------------------------------------------
+
+void DlgEditor::Print( Printer* pPrinter, const String& rTitle ) // not working yet
{
if( pDlgEdView )
{
@@ -1304,8 +1317,6 @@ void DlgEditor::PrintData( Printer* pPrinter, const String& rTitle ) // not w
aPaperSz.Width() -= (LMARGPRN+RMARGPRN);
aPaperSz.Height() -= (TMARGPRN+BMARGPRN);
- pPrinter->StartPage();
-
lcl_PrintHeader( pPrinter, rTitle );
Bitmap aDlg;
@@ -1350,8 +1361,6 @@ void DlgEditor::PrintData( Printer* pPrinter, const String& rTitle ) // not w
pPrinter->DrawBitmap( aPosOffs, aOutputSz, aDlg );
- pPrinter->EndPage();
-
pPrinter->SetMapMode( aOldMap );
pPrinter->SetFont( aOldFont );
}
diff --git a/basctl/source/inc/baside3.hxx b/basctl/source/inc/baside3.hxx
index 4c361d4545f5..7920e9ebdfc6 100644
--- a/basctl/source/inc/baside3.hxx
+++ b/basctl/source/inc/baside3.hxx
@@ -110,7 +110,10 @@ public:
virtual BOOL IsPasteAllowed();
virtual SfxUndoManager* GetUndoManager();
- virtual void PrintData( Printer* pPrinter );
+ // return number of pages to be printed
+ virtual sal_Int32 countPages( Printer* pPrinter );
+ // print page
+ virtual void printPage( sal_Int32 nPage, Printer* pPrinter );
virtual void Deactivating();
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx
index d8e58b968398..f4f118b0b277 100644
--- a/basctl/source/inc/basidesh.hxx
+++ b/basctl/source/inc/basidesh.hxx
@@ -199,7 +199,9 @@ public:
SfxUndoManager* GetUndoManager();
- virtual USHORT Print( SfxProgress &rProgress, BOOL bIsAPI, PrintDialog *pPrintDialog = 0 );
+ virtual com::sun::star::uno::Reference< com::sun::star::view::XRenderable > GetRenderable();
+
+ // virtual USHORT Print( SfxProgress &rProgress, BOOL bIsAPI, PrintDialog *pPrintDialog = 0 );
virtual SfxPrinter* GetPrinter( BOOL bCreate );
virtual USHORT SetPrinter( SfxPrinter *pNewPrinter, USHORT nDiffFlags = SFX_PRINTER_ALL, bool bIsAPI=false );
virtual String GetSelectionText( BOOL bCompleteWords );
diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx
index 0c542ac405ad..a9540762172d 100644
--- a/basctl/source/inc/bastypes.hxx
+++ b/basctl/source/inc/bastypes.hxx
@@ -205,9 +205,13 @@ public:
virtual void StoreData();
virtual void UpdateData();
- virtual void PrintData( Printer* pPrinter );
virtual BOOL CanClose();
+ // return number of pages to be printed
+ virtual sal_Int32 countPages( Printer* pPrinter ) = 0;
+ // print page
+ virtual void printPage( sal_Int32 nPage, Printer* pPrinter ) = 0;
+
virtual String GetTitle();
String CreateQualifiedName();
virtual BasicEntryDescriptor CreateEntryDescriptor() = 0;
diff --git a/basctl/source/inc/dlged.hxx b/basctl/source/inc/dlged.hxx
index 9a75e80a53e2..001c689a78a5 100644
--- a/basctl/source/inc/dlged.hxx
+++ b/basctl/source/inc/dlged.hxx
@@ -102,6 +102,8 @@ private:
DECL_LINK( PaintTimeout, Timer * );
DECL_LINK( MarkTimeout, Timer * );
+ void Print( Printer* pPrinter, const String& rTitle );
+
protected:
ScrollBar* pHScroll;
ScrollBar* pVScroll;
@@ -199,7 +201,8 @@ public:
void ShowProperties();
void UpdatePropertyBrowserDelayed();
- void PrintData( Printer*, const String& rTitle ); // not working yet
+ sal_Int32 countPages( Printer* pPrinter );
+ void printPage( sal_Int32 nPage, Printer* pPrinter, const String& );
bool AdjustPageSize();