Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
1bfae56d
Kaydet (Commit)
1bfae56d
authored
Şub 24, 2013
tarafından
Ariel Constenla-Haile
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
i121810 - Adapt SfxPrintingHint to work with the "new" XDocumentEventBroadcaster
üst
914cb68e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
25 deletions
+48
-25
event.hxx
sfx2/inc/sfx2/event.hxx
+35
-19
printhelper.cxx
sfx2/source/doc/printhelper.cxx
+4
-2
viewprn.cxx
sfx2/source/view/viewprn.cxx
+9
-4
No files found.
sfx2/inc/sfx2/event.hxx
Dosyayı görüntüle @
1bfae56d
...
...
@@ -25,6 +25,7 @@
#include "sal/config.h"
#include "sfx2/dllapi.h"
#include "sfx2/sfx.hrc"
#include <tools/string.hxx>
#include <svl/hint.hxx>
#include <unotools/eventcfg.hxx>
...
...
@@ -33,6 +34,9 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/frame/XController2.hpp>
#include <com/sun/star/view/PrintableState.hpp>
namespace
css
=
::
com
::
sun
::
star
;
class
SfxObjectShell
;
...
...
@@ -66,22 +70,22 @@ public:
class
SFX2_DLLPUBLIC
SfxViewEventHint
:
public
SfxEventHint
{
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
frame
::
XController2
>
xViewController
;
::
com
::
sun
::
star
::
uno
::
Reference
<
css
::
frame
::
XController2
>
xViewController
;
public
:
TYPEINFO
();
SfxViewEventHint
(
sal_uInt16
nId
,
const
::
rtl
::
OUString
&
aName
,
SfxObjectShell
*
pObj
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
frame
::
XController
>&
xController
)
SfxViewEventHint
(
sal_uInt16
nId
,
const
::
rtl
::
OUString
&
aName
,
SfxObjectShell
*
pObj
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XController
>&
xController
)
:
SfxEventHint
(
nId
,
aName
,
pObj
)
,
xViewController
(
xController
,
::
com
::
sun
::
star
::
uno
::
UNO_QUERY
)
,
xViewController
(
xController
,
css
::
uno
::
UNO_QUERY
)
{}
SfxViewEventHint
(
sal_uInt16
nId
,
const
::
rtl
::
OUString
&
aName
,
SfxObjectShell
*
pObj
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
frame
::
XController2
>&
xController
)
SfxViewEventHint
(
sal_uInt16
nId
,
const
::
rtl
::
OUString
&
aName
,
SfxObjectShell
*
pObj
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XController2
>&
xController
)
:
SfxEventHint
(
nId
,
aName
,
pObj
)
,
xViewController
(
xController
)
{}
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
frame
::
XController2
>
GetController
()
const
css
::
uno
::
Reference
<
css
::
frame
::
XController2
>
GetController
()
const
{
return
xViewController
;
}
};
...
...
@@ -116,23 +120,35 @@ public:
};
class
Printer
;
class
SfxPrintingHint
:
public
SfxHint
class
SfxPrintingHint
:
public
SfxViewEventHint
{
sal_Int32
nWhich
;
sal_Int32
mnPrintableState
;
com
::
sun
::
star
::
uno
::
Sequence
<
com
::
sun
::
star
::
beans
::
PropertyValue
>
aOpts
;
public
:
TYPEINFO
();
SfxPrintingHint
(
sal_Int32
nEvent
,
const
com
::
sun
::
star
::
uno
::
Sequence
<
com
::
sun
::
star
::
beans
::
PropertyValue
>&
rOpts
)
:
nWhich
(
nEvent
)
,
aOpts
(
rOpts
)
{}
SfxPrintingHint
(
sal_Int32
nEvent
)
:
nWhich
(
nEvent
)
{}
sal_Int32
GetWhich
()
const
{
return
nWhich
;
}
const
com
::
sun
::
star
::
uno
::
Sequence
<
com
::
sun
::
star
::
beans
::
PropertyValue
>&
GetOptions
()
{
return
aOpts
;
}
TYPEINFO
();
SfxPrintingHint
(
sal_Int32
nEvent
,
const
css
::
uno
::
Sequence
<
css
::
beans
::
PropertyValue
>&
rOpts
,
SfxObjectShell
*
pObj
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XController2
>&
xController
)
:
SfxViewEventHint
(
SFX_EVENT_PRINTDOC
,
GlobalEventConfig
::
GetEventName
(
STR_EVENT_PRINTDOC
),
pObj
,
xController
)
,
mnPrintableState
(
nEvent
)
,
aOpts
(
rOpts
)
{}
SfxPrintingHint
(
sal_Int32
nEvent
)
:
SfxViewEventHint
(
SFX_EVENT_PRINTDOC
,
rtl
::
OUString
(),
0
,
css
::
uno
::
Reference
<
css
::
frame
::
XController
>
()
)
,
mnPrintableState
(
nEvent
)
{}
sal_Int32
GetWhich
()
const
{
return
mnPrintableState
;
}
const
css
::
uno
::
Sequence
<
css
::
beans
::
PropertyValue
>&
GetOptions
()
{
return
aOpts
;
}
};
#endif
sfx2/source/doc/printhelper.cxx
Dosyayı görüntüle @
1bfae56d
...
...
@@ -60,6 +60,8 @@
#include <sfx2/objsh.hxx>
#include <sfx2/event.hxx>
#define SFX_PRINTABLESTATE_CANCELJOB -2
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
uno
;
...
...
@@ -143,7 +145,7 @@ 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
)
);
m_pData
->
m_pObjectShell
->
Broadcast
(
SfxPrintingHint
(
SFX_PRINTABLESTATE_CANCELJOB
)
);
}
SfxPrintHelper
::
SfxPrintHelper
()
...
...
@@ -788,7 +790,7 @@ void IMPL_PrintListener_DataContainer::Notify( SfxBroadcaster& rBC, const SfxHin
SfxPrintingHint
*
pPrintHint
=
PTR_CAST
(
SfxPrintingHint
,
&
rHint
);
if
(
&
rBC
!=
m_pObjectShell
||
!
pPrintHint
||
pPrintHint
->
GetWhich
()
==
-
2
)
// -2 : CancelPrintJob
||
pPrintHint
->
GetWhich
()
==
SFX_PRINTABLESTATE_CANCELJOB
)
return
;
if
(
pPrintHint
->
GetWhich
()
==
com
::
sun
::
star
::
view
::
PrintableState_JOB_STARTED
)
...
...
sfx2/source/view/viewprn.cxx
Dosyayı görüntüle @
1bfae56d
...
...
@@ -25,7 +25,6 @@
#include "precompiled_sfx2.hxx"
#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>
...
...
@@ -61,7 +60,7 @@
using
namespace
com
::
sun
::
star
;
using
namespace
com
::
sun
::
star
::
uno
;
TYPEINIT1
(
SfxPrintingHint
,
SfxHint
);
TYPEINIT1
(
SfxPrintingHint
,
Sfx
ViewEvent
Hint
);
// -----------------------------------------------------------------------
class
SfxPrinterController
:
public
vcl
::
PrinterController
,
public
SfxListener
...
...
@@ -305,9 +304,15 @@ void SfxPrinterController::jobStarted()
now
.
Get100Sec
(),
now
.
GetSec
(),
now
.
GetMin
(),
now
.
GetHour
(),
now
.
GetDay
(),
now
.
GetMonth
(),
now
.
GetYear
()
)
);
// FIXME: how to get all print options incl. AdditionalOptions easily?
uno
::
Sequence
<
beans
::
PropertyValue
>
aOpts
;
mpObjectShell
->
Broadcast
(
SfxPrintingHint
(
view
::
PrintableState_JOB_STARTED
,
aOpts
)
);
aOpts
=
getJobProperties
(
aOpts
);
uno
::
Reference
<
frame
::
XController2
>
xController
;
if
(
mpViewShell
)
xController
.
set
(
mpViewShell
->
GetController
(),
uno
::
UNO_QUERY
);
mpObjectShell
->
Broadcast
(
SfxPrintingHint
(
view
::
PrintableState_JOB_STARTED
,
aOpts
,
mpObjectShell
,
xController
)
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment