Hi Mikhail,
Thanks a lot for your help, and here is a patch that makes MSOLE
printable at last. :-)
However I find there are still several problems to be dealt with:
1. The object, when standalone, does not print the same scale as in the
document. For MS Word it's about 4~5 times larger, while for Paintbrush
it's bizarrely small, only about 20% small. ( I took a photo with my
phone, it's temporarily available at http://s5.tinypic.com/ih4dwp.jpg )
2. The aTitle we got for the job is not printed to paper. I'm not sure
if this feature is available for the whole document, but it's not the
default behavior at present.
3. This is actually a question: Could you please explain what a printer
state is when pPrinter->IsPrinting() is true? Does it mean there's other
printing jobs in the queue? Is it the same state as when the printer has
to "Wait", as in css::view::PrintOptions::Wait ?
Best Regards,
Felix.
Index: embeddedobj/source/commonembedding/embedobj.cxx
===================================================================
--- embeddedobj/source/commonembedding/embedobj.cxx (revision 267538)
+++ embeddedobj/source/commonembedding/embedobj.cxx (working copy)
@@ -88,7 +88,7 @@
if ( m_aVerbTable[nInd][0] == nVerb )
return m_aVerbTable[nInd][1];
- throw lang::IllegalArgumentException(); // TODO: unexpected verb
provided
+ return -1;
}
//----------------------------------------------
@@ -547,18 +547,18 @@
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) )
);
// for internal documents this call is just a duplicate of changeState
- sal_Int32 nNewState = -1;
- try
- {
- nNewState = ConvertVerbToState_Impl( nVerbID );
- }
- catch( uno::Exception& )
- {}
+ sal_Int32 nNewState = ConvertVerbToState_Impl( nVerbID );
if ( nNewState == -1 )
{
- // TODO/LATER: Save Copy as... verb ( -8 ) is implemented by
container
+ // TODO/LATER: Save Copy as... verb (
embed::EmbedVerbs::OLEVERB_SAVECOPYAS ) is implemented by container
// TODO/LATER: check if the verb is a supported one and if it
is produce related operation
+ if ( nVerbID == embed::EmbedVerbs::OLEVERB_PRINT )
+ {
+ if ( m_nObjectState == embed::EmbedStates::LOADED )
+ SwitchStateTo_Impl( embed::EmbedStates::RUNNING );
+ m_pDocHolder->PrintDocument();
+ }
}
else
changeState( nNewState );
Index: embeddedobj/source/commonembedding/specialobject.cxx
===================================================================
--- embeddedobj/source/commonembedding/specialobject.cxx (revision
267538)
+++ embeddedobj/source/commonembedding/specialobject.cxx (working copy)
@@ -233,7 +233,7 @@
throw embed::WrongStateException(
::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) )
);
- if ( nVerbID == -7 )
+ if ( nVerbID == embed::EmbedVerbs::OLEVERB_PROPERTIES )
{
uno::Reference < ui::dialogs::XExecutableDialog > xDlg(
m_pDocHolder->GetComponent(), uno::UNO_QUERY );
Index: embeddedobj/source/general/docholder.cxx
===================================================================
--- embeddedobj/source/general/docholder.cxx (revision 267538)
+++ embeddedobj/source/general/docholder.cxx (working copy)
@@ -77,6 +77,9 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/embed/StateChangeInProgressException.hpp>
+#include <com/sun/star/view/XPrintable.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+
#include <com/sun/star/embed/EmbedMisc.hpp>
#include <com/sun/star/embed/EmbedStates.hpp>
#include <osl/diagnose.h>
@@ -531,7 +534,7 @@
if ( m_xComponent.is() )
{
- if ( !LoadDocToFrame( sal_True ) )
+ if ( !LoadDocToFrame( sal_True, sal_False, m_xFrame ) )
{
CloseFrame();
return sal_False;
@@ -924,7 +927,7 @@
// TODO/LATER: get it for the real aspect
awt::Size aSize;
GetExtent( embed::Aspects::MSOLE_CONTENT, &aSize );
- LoadDocToFrame(sal_False);
+ LoadDocToFrame( sal_False, sal_False, m_xFrame );
if ( xOwnLM.is() )
{
@@ -1013,32 +1016,41 @@
}
if ( m_xFrame.is() )
- LoadDocToFrame(sal_False);
+ LoadDocToFrame( sal_False, sal_False, m_xFrame );
}
//---------------------------------------------------------------------------
-sal_Bool DocumentHolder::LoadDocToFrame( sal_Bool bInPlace )
+sal_Bool DocumentHolder::LoadDocToFrame( sal_Bool bInPlace, sal_Bool bHidden,
uno::Reference< frame::XFrame >& xFrame )
{
- if ( m_xFrame.is() && m_xComponent.is() )
+ if ( xFrame.is() && m_xComponent.is() )
{
uno::Reference < frame::XModel > xDoc( m_xComponent, uno::UNO_QUERY );
if ( xDoc.is() )
{
// load new document in to the frame
- uno::Reference< frame::XComponentLoader > xComponentLoader(
m_xFrame, uno::UNO_QUERY );
+ uno::Reference< frame::XComponentLoader > xComponentLoader(
xFrame, uno::UNO_QUERY );
if( !xComponentLoader.is() )
throw uno::RuntimeException();
- uno::Sequence< beans::PropertyValue > aArgs( bInPlace ? 3 : 2 );
+ sal_Int32 nInd = 2;
+ uno::Sequence< beans::PropertyValue > aArgs( nInd );
aArgs[0].Name = ::rtl::OUString::createFromAscii( "Model" );
aArgs[0].Value <<= m_xComponent;
aArgs[1].Name = ::rtl::OUString::createFromAscii( "ReadOnly" );
aArgs[1].Value <<= m_bReadOnly;
if ( bInPlace )
{
- aArgs[2].Name = ::rtl::OUString::createFromAscii( "PluginMode"
);
- aArgs[2].Value <<= sal_Int16(1);
+ aArgs.realloc( ++nInd );
+ aArgs[nInd-1].Name = ::rtl::OUString::createFromAscii(
"PluginMode" );
+ aArgs[nInd-1].Value <<= sal_Int16(1);
}
+ if ( bHidden)
+ {
+ aArgs.realloc( ++nInd );
+ aArgs[nInd-1].Name = ::rtl::OUString::createFromAscii(
"Hidden" );
+ aArgs[nInd-1].Value <<= bHidden;
+ }
+
::rtl::OUString sUrl;
uno::Reference< lang::XServiceInfo>
xServiceInfo(xDoc,uno::UNO_QUERY);
if ( xServiceInfo.is()
@@ -1063,7 +1075,7 @@
{
uno::Reference < frame::XSynchronousFrameLoader > xLoader(
m_xComponent, uno::UNO_QUERY );
if ( xLoader.is() )
- return xLoader->load( uno::Sequence < beans::PropertyValue
>(), m_xFrame );
+ return xLoader->load( uno::Sequence < beans::PropertyValue
>(), xFrame );
else
return sal_False;
}
@@ -1366,3 +1378,60 @@
// deactivation is too unspecific to be useful; usually we only trigger
code from activation
// so UIDeactivation is actively triggered by the container
}
+
+void DocumentHolder::PrintDocument()
+// TODO/LATER: This should be moved to the document implementation to allow
printing of documents without view.
+{
+ if ( !m_xFrame.is() )
+ {
+ uno::Reference< lang::XSingleServiceFactory > xFrameFact(
+ m_xFactory->createInstance( ::rtl::OUString::createFromAscii(
"com.sun.star.frame.TaskCreator" ) ),
+ uno::UNO_QUERY_THROW );
+
+ uno::Sequence< uno::Any > aOutplaceFrameProps( 2 );
+
+ beans::NamedValue aArgs;
+ aArgs.Name = ::rtl::OUString::createFromAscii( "TopWindow" );
+ aArgs.Value <<= sal_True;
+ aOutplaceFrameProps[0] <<= aArgs;
+
+ aArgs.Name = ::rtl::OUString::createFromAscii( "MakeVisible" );
+ aArgs.Value <<= sal_False;
+ aOutplaceFrameProps[1] <<= aArgs;
+
+
+ uno::Reference< frame::XFrame > xFrame;
+ xFrame.set( xFrameFact->createInstanceWithArguments(
aOutplaceFrameProps ), uno::UNO_QUERY_THROW );
+
+ if ( LoadDocToFrame( sal_False, sal_True, xFrame ) )
+ {
+ uno::Reference < view::XPrintable > xDoc ( m_xComponent,
uno::UNO_QUERY );
+ if ( xDoc.is() )
+ {
+ uno::Sequence < beans::PropertyValue > aPrinterArgs( 1 );
+ aPrinterArgs[0].Name =
::rtl::OUString::createFromAscii("Wait");
+ aPrinterArgs[0].Value <<= sal_True;
+ xDoc->print( aPrinterArgs );
+ }
+ }
+
+ uno::Reference<util::XCloseable> xCloseable( xFrame,uno::UNO_QUERY );
+ if( xCloseable.is() )
+ try {
+ xCloseable->close( sal_True );
+ }
+ catch( const uno::Exception& ) {
+ }
+ }
+ else
+ {
+ uno::Reference < view::XPrintable > xDoc ( m_xComponent,
uno::UNO_QUERY );
+ if ( xDoc.is() )
+ {
+ uno::Sequence < beans::PropertyValue > aPrinterArgs( 1 );
+ aPrinterArgs[0].Name = ::rtl::OUString::createFromAscii("Wait");
+ aPrinterArgs[0].Value <<= sal_True;
+ xDoc->print( aPrinterArgs );
+ }
+ }
+}
\ No newline at end of file
Index: embeddedobj/source/inc/docholder.hxx
===================================================================
--- embeddedobj/source/inc/docholder.hxx (revision 267538)
+++ embeddedobj/source/inc/docholder.hxx (working copy)
@@ -97,7 +97,8 @@
::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
GetDocFrame();
- sal_Bool LoadDocToFrame( sal_Bool );
+ sal_Bool LoadDocToFrame( sal_Bool bInPlace, sal_Bool bHidden,
+ ::com::sun::star::uno::Reference<
::com::sun::star::frame::XFrame >& xFrame );
::com::sun::star::awt::Rectangle CalculateBorderedArea( const
::com::sun::star::awt::Rectangle& aRect );
::com::sun::star::awt::Rectangle AddBorderToArea( const
::com::sun::star::awt::Rectangle& aRect );
@@ -169,6 +170,8 @@
void Show();
+ void PrintDocument();
+
// sal_Bool SetVisArea( sal_Int64 nAspect, const
::com::sun::star::awt::Rectangle& aRect );
// sal_Bool GetVisArea( sal_Int64 nAspect,
::com::sun::star::awt::Rectangle *pRect );
sal_Bool SetExtent( sal_Int64 nAspect, const
::com::sun::star::awt::Size& aSize );
Index: embeddedobj/source/msole/oleembed.cxx
===================================================================
--- embeddedobj/source/msole/oleembed.cxx (revision 267538)
+++ embeddedobj/source/msole/oleembed.cxx (working copy)
@@ -703,8 +703,11 @@
if ( m_nObjectState == -1 )
throw embed::WrongStateException(
::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
-
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) )
);
+ uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject*
>(this) ) );
+ if ( nVerbID == embed::EmbedVerbs::OLEVERB_PRINT )
+ throw embed::UnreachableStateException();
+
#ifdef WNT
if ( m_pOleComponent )
{
@@ -757,7 +760,7 @@
else
#endif
{
- if ( nVerbID == -9 )
+ if ( nVerbID == embed::EmbedVerbs::OLEVERB_VIEWIMPORT )
{
// the workaround verb to show the object in case no
server is available
@@ -822,6 +825,12 @@
if ( m_nObjectState == -1 )
throw embed::WrongStateException(
::rtl::OUString::createFromAscii( "The object has no persistence!\n" ),
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) )
);
+
+ uno::Sequence< embed::VerbDescriptor > aVerbs;
+
+ ::comphelper::MimeConfigurationHelper aConfigHelper( m_xFactory );
+
+
#ifdef WNT
if ( m_pOleComponent )
{
@@ -832,13 +841,18 @@
// throw embed::NeedsRunningStateException(); // TODO:
// }
- return m_pOleComponent->GetVerbList();
+ aVerbs = m_pOleComponent->GetVerbList();
+ aVerbs.realloc( aVerbs.getLength() + 1 );
+ aConfigHelper.GetVerbByShortcut( ::rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM( "PRINT" ) ), aVerbs[aVerbs.getLength()-1] );
}
else
#endif
{
- return uno::Sequence< embed::VerbDescriptor >();
- }
+ aVerbs = uno::Sequence< embed::VerbDescriptor > (1);
+ aConfigHelper.GetVerbByShortcut( ::rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM( "PRINT" ) ), aVerbs[0] );
+ }
+
+ return aVerbs;
}
//----------------------------------------------
Index: offapi/com/sun/star/embed/EmbedVerbs.idl
===================================================================
--- offapi/com/sun/star/embed/EmbedVerbs.idl (revision 266626)
+++ offapi/com/sun/star/embed/EmbedVerbs.idl (working copy)
@@ -77,6 +77,26 @@
*/
const long MS_OLEVERB_DISCARDUNDOSTATE = -6;
+
//------------------------------------------------------------------------
+ /** lets the object display its properties.
+ */
+ const long OLEVERB_PROPERTIES = -7;
+
+
//------------------------------------------------------------------------
+ /** lets the object save copy as a file.
+ */
+ const long OLEVERB_SAVECOPYAS = -8;
+
+
//------------------------------------------------------------------------
+ /** lets MSOLE objects be imported in OOo document and shown readonly.
+ */
+ const long OLEVERB_VIEWIMPORT = -9;
+
+ //------------------------------------------------------------------------
+ /** lets the object print itself.
+ */
+ const long OLEVERB_PRINT = -10;
+
};
//============================================================================
Index: officecfg/registry/data/org/openoffice/Office/Embedding.xcu
===================================================================
--- officecfg/registry/data/org/openoffice/Office/Embedding.xcu (revision
266626)
+++ officecfg/registry/data/org/openoffice/Office/Embedding.xcu (working copy)
@@ -123,6 +123,21 @@
<value>0</value>
</prop>
</node>
+ <node oor:name="DISCARDUNDOSTATE" oor:op="replace">
+ <prop oor:name="VerbUIName">
+ <value>Discard Undo State</value>
+ <value xml:lang="x-comment">Is not shown in UI. No translation is
required.</value>
+ </prop>
+ <prop oor:name="VerbID">
+ <value>-6</value>
+ </prop>
+ <prop oor:name="VerbFlags">
+ <value>0</value>
+ </prop>
+ <prop oor:name="VerbAttributes">
+ <value>0</value>
+ </prop>
+ </node>
<node oor:name="PROPERTIES" oor:op="replace">
<prop oor:name="VerbUIName">
@@ -155,6 +170,37 @@
<value>2</value>
</prop>
</node>
+ <node oor:name="VIEWIMPORT" oor:op="replace">
+ <prop oor:name="VerbUIName">
+ <value>View Import</value>
+ <value xml:lang="x-comment">Is not shown in UI. No translation is
required.</value>
+ </prop>
+ <prop oor:name="VerbID">
+ <value>-9</value>
+ </prop>
+ <prop oor:name="VerbFlags">
+ <value>0</value>
+ </prop>
+ <prop oor:name="VerbAttributes">
+ <value>0</value>
+ </prop>
+ </node>
+ <node oor:name="PRINT" oor:op="replace">
+ <prop oor:name="VerbUIName">
+
+ <value xml:lang="en-US">P~rint</value>
+ <value xml:lang="x-comment">This verb will let the object be
printed.</value>
+ </prop>
+ <prop oor:name="VerbID">
+ <value>-10</value>
+ </prop>
+ <prop oor:name="VerbFlags">
+ <value>0</value>
+ </prop>
+ <prop oor:name="VerbAttributes">
+ <value>2</value>
+ </prop>
+ </node>
</node>
<node oor:name="Objects">
<node oor:name="970B1E81-CF2D-11CF-89CA-008029E4B0B1" oor:op="replace">
@@ -168,7 +214,7 @@
<value>4294969728</value>
</prop>
<prop oor:name="ObjectVerbs">
- <value>PRIMARY SHOW IPACTIVATE PROPERTIES</value>
+ <value>PRIMARY SHOW IPACTIVATE PROPERTIES PRINT</value>
</prop>
</node>
<node oor:name="4CAA7761-6B8B-11CF-89CA-008029E4B0B1" oor:op="replace">
@@ -182,7 +228,7 @@
<value>2432</value>
</prop>
<prop oor:name="ObjectVerbs">
- <value>PRIMARY SHOW IPACTIVATE PROPERTIES</value>
+ <value>PRIMARY SHOW IPACTIVATE PROPERTIES PRINT</value>
</prop>
</node>
<node oor:name="1A8A6701-DE58-11CF-89CA-008029E4B0B1" oor:op="replace">
@@ -196,7 +242,7 @@
<value>2432</value>
</prop>
<prop oor:name="ObjectVerbs">
- <value>PRIMARY SHOW IPACTIVATE PROPERTIES</value>
+ <value>PRIMARY SHOW IPACTIVATE PROPERTIES PRINT</value>
</prop>
</node>
<node oor:name="47BBB4CB-CE4C-4E80-A591-42D9AE74950F" oor:op="replace"
install:module="calc">
@@ -208,7 +254,7 @@
</prop>
<prop oor:name="ObjectMiscStatus"/>
<prop oor:name="ObjectVerbs">
- <value>PRIMARY SHOW OPEN HIDE UIACTIVATE IPACTIVATE SAVECOPYAS</value>
+ <value>PRIMARY SHOW OPEN HIDE UIACTIVATE IPACTIVATE SAVECOPYAS
PRINT</value>
</prop>
</node>
<node oor:name="12DCAE26-281F-416F-A234-C3086127382E" oor:op="replace"
install:module="chart">
@@ -222,7 +268,7 @@
<value>1</value>
</prop>
<prop oor:name="ObjectVerbs">
- <value>PRIMARY SHOW OPEN HIDE UIACTIVATE IPACTIVATE</value>
+ <value>PRIMARY SHOW OPEN HIDE UIACTIVATE IPACTIVATE PRINT</value>
</prop>
</node>
<node oor:name="4BAB8970-8A3B-45B3-991C-CBEEAC6BD5E3" oor:op="replace"
install:module="draw">
@@ -234,7 +280,7 @@
</prop>
<prop oor:name="ObjectMiscStatus"/>
<prop oor:name="ObjectVerbs">
- <value>PRIMARY SHOW OPEN HIDE UIACTIVATE IPACTIVATE SAVECOPYAS</value>
+ <value>PRIMARY SHOW OPEN HIDE UIACTIVATE IPACTIVATE SAVECOPYAS
PRINT</value>
</prop>
</node>
<node oor:name="9176E48A-637A-4D1F-803B-99D9BFAC1047" oor:op="replace"
install:module="impress">
@@ -246,7 +292,7 @@
</prop>
<prop oor:name="ObjectMiscStatus"/>
<prop oor:name="ObjectVerbs">
- <value>PRIMARY SHOW OPEN HIDE UIACTIVATE IPACTIVATE SAVECOPYAS</value>
+ <value>PRIMARY SHOW OPEN HIDE UIACTIVATE IPACTIVATE SAVECOPYAS
PRINT</value>
</prop>
</node>
<node oor:name="078B7ABA-54FC-457F-8551-6147E776A997" oor:op="replace"
install:module="math">
@@ -260,7 +306,7 @@
<value>8589934592</value>
</prop>
<prop oor:name="ObjectVerbs">
- <value>PRIMARY SHOW OPEN HIDE UIACTIVATE IPACTIVATE SAVECOPYAS</value>
+ <value>PRIMARY SHOW OPEN HIDE UIACTIVATE IPACTIVATE SAVECOPYAS
PRINT</value>
</prop>
</node>
<node oor:name="8BC6B165-B1B2-4EDD-AA47-DAE2EE689DD6" oor:op="replace"
install:module="writer">
@@ -272,7 +318,7 @@
</prop>
<prop oor:name="ObjectMiscStatus"/>
<prop oor:name="ObjectVerbs">
- <value>PRIMARY SHOW OPEN HIDE UIACTIVATE IPACTIVATE SAVECOPYAS</value>
+ <value>PRIMARY SHOW OPEN HIDE UIACTIVATE IPACTIVATE SAVECOPYAS
PRINT</value>
</prop>
</node>
</node>
Index: sfx2/source/view/ipclient.cxx
===================================================================
--- sfx2/source/view/ipclient.cxx (revision 269064)
+++ sfx2/source/view/ipclient.cxx (working copy)
@@ -50,6 +50,8 @@
#include <com/sun/star/embed/EmbedMisc.hpp>
#include <svtools/embedhlp.hxx>
+#include <svtools/filter.hxx>
+#include <unotools/ucbstreamhelper.hxx>
#include <vcl/svapp.hxx>
#include <sfx2/ipclient.hxx>
@@ -57,6 +59,7 @@
#include <sfx2/viewfrm.hxx>
#include <sfx2/objsh.hxx>
#include <sfx2/dispatch.hxx>
+#include <sfx2/printer.hxx>
#include "workwin.hxx"
#include "guisaveas.hxx"
#include <sfx2/topfrm.hxx>
@@ -927,7 +930,7 @@
if ( m_pImp->m_xObject.is() )
{
sal_Bool bSaveCopyAs = sal_False;
- if ( nVerb == -8 ) // "Save Copy as..."
+ if ( nVerb == embed::EmbedVerbs::OLEVERB_SAVECOPYAS ) // "Save
Copy as..."
{
svt::EmbeddedObjectRef::TryRunningState( m_pImp->m_xObject );
// TODO/LATER: this special verb should disappear when
outplace activation is completely available
@@ -986,12 +989,12 @@
}
catch ( embed::UnreachableStateException& )
{
- if ( nVerb == 0 || nVerb ==
embed::EmbedVerbs::MS_OLEVERB_OPEN )
+ if ( nVerb ==
embed::EmbedVerbs::MS_OLEVERB_PRIMARY || nVerb ==
embed::EmbedVerbs::MS_OLEVERB_OPEN )
{
// a workaround for the default
verb, usually makes sence for alien objects
try
{
-
m_pImp->m_xObject->doVerb( -9 ); // open own view, a workaround verb that is
not visible
+
m_pImp->m_xObject->doVerb( embed::EmbedVerbs::OLEVERB_VIEWIMPORT ); // open own
view, a workaround verb that is not visible
if ( m_pImp->m_xObject->getCurrentState() ==
embed::EmbedStates::UI_ACTIVE )
{
@@ -1012,6 +1015,70 @@
nError =
ERRCODE_SO_GENERALERROR;
}
}
+ if ( nVerb == embed::EmbedVerbs::OLEVERB_PRINT )
+ {
+ try
+ {
+ nError = ERRCODE_SO_GENERALERROR;
+
+ SfxViewShell* pViewShell = GetViewShell();
+ if ( pViewShell )
+ {
+ SfxPrinter* pPrinter = pViewShell->GetPrinter(
TRUE );
+
+ if ( pPrinter && pPrinter->IsValid() )
+ {
+ if ( pPrinter->IsPrinting() )
+ nError = ERRCODE_SO_CANNOT_DOVERB_NOW;
+ else
+ {
+ SfxObjectShell* pObjectShell =
pViewShell->GetObjectShell();
+ if ( pObjectShell )
+ {
+ uno::Reference < io::XInputStream
> xStream = pObjectShell->GetEmbeddedObjectContainer().GetGraphicStream(
m_pImp->m_xObject );
+ if ( xStream.is() )
+ {
+ const sal_Int32
nConstBufferSize = 32000;
+ SvStream *pStream = new
SvMemoryStream( 32000, 32000 );
+ sal_Int32 nRead=0;
+ uno::Sequence < sal_Int8 >
aSequence ( nConstBufferSize );
+ do
+ {
+ nRead = xStream->readBytes
( aSequence, nConstBufferSize );
+ pStream->Write(
aSequence.getConstArray(), nRead );
+ }
+ while ( nRead ==
nConstBufferSize );
+ pStream->Seek(0);
+ if ( pStream )
+ {
+ String aTitle =
pObjectShell->GetTitle(0); // ToDo: doc title + object name
+ pPrinter->StartJob( aTitle
);
+ pPrinter->StartPage();
+
+ GraphicFilter* pGF =
GraphicFilter::GetGraphicFilter();
+ Graphic* pGraphic = new
Graphic;
+ pGF->ImportGraphic(
*pGraphic, String(), *pStream );
+ pGraphic->Draw(
(OutputDevice*)pPrinter, Point( 0, 0 ) );
+
+ pPrinter->EndPage();
+ pPrinter->EndJob();
+
+ DELETEZ( pGraphic );
+ DELETEZ( pStream );
+
+ nError = ERRCODE_NONE;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ catch ( uno::Exception& )
+ {
+ nError = ERRCODE_SO_GENERALERROR;
+ }
+ }
}
catch ( embed::StateChangeInProgressException& )
{
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@framework.openoffice.org
For additional commands, e-mail: dev-h...@framework.openoffice.org