summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorPhilipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM>2011-03-23 18:06:39 +0100
committerPhilipp Lohmann [pl] <Philipp.Lohmann@Oracle.COM>2011-03-23 18:06:39 +0100
commitd05df6bf49c6e3cc8f7f9f60022430fb930b8fbf (patch)
tree490081e069dc1c461fcf8199265c47170114cf02 /sfx2
parenteb11c413ee1c257f92d1227bdcbdad52332610bd (diff)
parent61879c218dd0e6e94884e7c6e06e3c5c18540b4a (diff)
vcl2gnumake: rebase to DEV300m103
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/dinfdlg.hxx2
-rw-r--r--sfx2/inc/sfx2/mgetempl.hxx2
-rw-r--r--sfx2/inc/sfx2/module.hxx12
-rwxr-xr-xsfx2/inc/sfx2/sfx.hrc3
-rw-r--r--sfx2/prj/build.lst2
-rw-r--r--sfx2/qa/cppunit/makefile.mk86
-rw-r--r--sfx2/qa/unoapi/makefile.mk48
-rw-r--r--sfx2/source/appl/module.cxx34
-rw-r--r--sfx2/source/appl/sfx.src5
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx15
-rw-r--r--sfx2/source/dialog/dinfdlg.hrc4
-rw-r--r--sfx2/source/dialog/dinfdlg.src4
-rw-r--r--sfx2/source/dialog/mgetempl.cxx2
-rw-r--r--sfx2/source/dialog/newstyle.cxx1
-rw-r--r--sfx2/source/dialog/passwd.cxx1
-rw-r--r--sfx2/source/dialog/passwd.hrc3
-rw-r--r--sfx2/source/dialog/passwd.src37
-rw-r--r--sfx2/source/dialog/tabdlg.cxx5
-rw-r--r--sfx2/source/dialog/templdlg.cxx2
-rw-r--r--sfx2/source/dialog/templdlg.hrc3
-rw-r--r--sfx2/source/dialog/templdlg.src4
-rw-r--r--sfx2/source/doc/SfxDocumentMetaData.cxx46
-rw-r--r--sfx2/source/doc/objxtor.cxx5
-rwxr-xr-x[-rw-r--r--]sfx2/source/view/viewprn.cxx83
24 files changed, 340 insertions, 69 deletions
diff --git a/sfx2/inc/sfx2/dinfdlg.hxx b/sfx2/inc/sfx2/dinfdlg.hxx
index 8cf17e3f6e4f..61e972c99278 100644
--- a/sfx2/inc/sfx2/dinfdlg.hxx
+++ b/sfx2/inc/sfx2/dinfdlg.hxx
@@ -552,9 +552,9 @@ public:
class SfxCustomPropertiesPage : public SfxTabPage
{
private:
- FixedText m_aPropertiesFT;
CustomPropertiesControl m_aPropertiesCtrl;
PushButton m_aAddBtn;
+ FixedText m_aPropertiesFT; // Sym2_5121----, Moved by Steve Yin
DECL_LINK( AddHdl, PushButton* );
diff --git a/sfx2/inc/sfx2/mgetempl.hxx b/sfx2/inc/sfx2/mgetempl.hxx
index 60375f5272c0..a599163116e5 100644
--- a/sfx2/inc/sfx2/mgetempl.hxx
+++ b/sfx2/inc/sfx2/mgetempl.hxx
@@ -70,9 +70,9 @@ class SfxManageStyleSheetPage : public SfxTabPage
FixedText aFilterFt;
ListBox aFilterLb;
+ FixedLine aDescGb;
FixedInfo aDescFt;
MultiLineEdit aDescED;
- FixedLine aDescGb;
SfxStyleSheetBase *pStyle;
SfxStyleFamilies *pFamilies;
diff --git a/sfx2/inc/sfx2/module.hxx b/sfx2/inc/sfx2/module.hxx
index f944b29c18da..5551df850ff2 100644
--- a/sfx2/inc/sfx2/module.hxx
+++ b/sfx2/inc/sfx2/module.hxx
@@ -34,6 +34,7 @@
#include <sfx2/imgdef.hxx>
#include <sal/types.h>
#include <tools/fldunit.hxx>
+#include <com/sun/star/uno/Reference.hxx>
class ImageList;
@@ -56,6 +57,9 @@ class SfxStbCtrlFactArr_Impl;
class SfxTabPage;
class Window;
+namespace com { namespace sun { namespace star { namespace frame {
+ class XFrame;
+} } } }
//====================================================================
class SFX2_DLLPUBLIC SfxModule : public SfxShell
@@ -97,6 +101,14 @@ public:
static SfxModule* GetActiveModule( SfxViewFrame* pFrame=NULL );
static FieldUnit GetCurrentFieldUnit();
+ /** retrieves the field unit of the module belonging to the document displayed in the given frame
+
+ Effectively, this method looks up the SfxViewFrame belonging to the given XFrame, then the SfxModule belonging to
+ the document in this frame, then this module's field unit.
+
+ Failures in any of those steps are reported as assertion in non-product builds, and then FUNIT_100TH_MM is returned.
+ */
+ static FieldUnit GetModuleFieldUnit( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > const & i_frame );
FieldUnit GetFieldUnit() const;
//#if 0 // _SOLAR__PRIVATE
diff --git a/sfx2/inc/sfx2/sfx.hrc b/sfx2/inc/sfx2/sfx.hrc
index ca1d3eb6b8a4..dfa3cc8593ec 100755
--- a/sfx2/inc/sfx2/sfx.hrc
+++ b/sfx2/inc/sfx2/sfx.hrc
@@ -253,6 +253,9 @@
#define STR_ERRUNOEVENTBINDUNG (RID_SFX_START+119)
#define STR_SHARED (RID_SFX_START+120)
#define RID_XMLSEC_DOCUMENTSIGNED (RID_SFX_START+121)
+// IAccessibility2 implementation 2009. ------
+#define STR_ACCTITLE_PRODUCTIVITYTOOLS (RID_SFX_START+157)
+// ------ IAccessibility2 implementation 2009.
//=========================================================================
diff --git a/sfx2/prj/build.lst b/sfx2/prj/build.lst
index ca582c0aaf12..f25e991f84f4 100644
--- a/sfx2/prj/build.lst
+++ b/sfx2/prj/build.lst
@@ -1,3 +1,3 @@
-sf sfx2 : l10n idl basic xmlscript framework readlicense_oo shell setup_native sax SYSTRAY_GTK:libegg LIBXML2:libxml2 LIBXSLT:libxslt NULL
+sf sfx2 : L10N:l10n idl basic xmlscript framework readlicense_oo shell setup_native sax SYSTRAY_GTK:libegg LIBXML2:libxml2 LIBXSLT:libxslt NULL
sf sfx2\prj nmake - all sf_prj NULL
diff --git a/sfx2/qa/cppunit/makefile.mk b/sfx2/qa/cppunit/makefile.mk
new file mode 100644
index 000000000000..b53a04ec43f9
--- /dev/null
+++ b/sfx2/qa/cppunit/makefile.mk
@@ -0,0 +1,86 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ=../..
+PRJNAME=sfx2
+TARGET=qa_cppunit
+
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+
+#building with stlport, but cppunit was not built with stlport
+.IF "$(USE_SYSTEM_STL)"!="YES"
+.IF "$(SYSTEM_CPPUNIT)"=="YES"
+CFLAGSCXX+=-DADAPT_EXT_STL
+.ENDIF
+.ENDIF
+
+CFLAGSCXX += $(CPPUNIT_CFLAGS)
+DLLPRE = # no leading "lib" on .so files
+
+# --- Libs ---------------------------------------------------------
+
+SHL1OBJS= \
+ $(SLO)/test_metadatable.obj \
+
+
+SHL1STDLIBS= \
+ $(CPPUNITLIB) \
+ $(SALLIB) \
+ $(CPPULIB) \
+ $(CPPUHELPERLIB) \
+ $(VCLLIB) \
+ $(SFXLIB) \
+
+
+SHL1TARGET= test_metadatable
+SHL1RPATH = NONE
+SHL1IMPLIB= i$(SHL1TARGET)
+# SHL1DEF= $(MISC)/$(SHL1TARGET).def
+DEF1NAME=$(SHL1TARGET)
+# DEF1EXPORTFILE= export.exp
+SHL1VERSIONMAP= version.map
+
+# --- All object files ---------------------------------------------
+
+SLOFILES= \
+ $(SHL1OBJS) \
+
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+.INCLUDE : _cppunit.mk
+
+.END
diff --git a/sfx2/qa/unoapi/makefile.mk b/sfx2/qa/unoapi/makefile.mk
new file mode 100644
index 000000000000..ea91ba4d1c44
--- /dev/null
+++ b/sfx2/qa/unoapi/makefile.mk
@@ -0,0 +1,48 @@
+#*************************************************************************
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2000, 2010 Oracle and/or its affiliates.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#***********************************************************************/
+
+.IF "$(OOO_SUBSEQUENT_TESTS)" == ""
+nothing .PHONY:
+.ELSE
+
+PRJ = ../..
+PRJNAME = sfx2
+TARGET = qa_unoapi
+
+.IF "$(OOO_JUNIT_JAR)" != ""
+PACKAGE = org/openoffice/sfx2/qa/unoapi
+JAVATESTFILES = Test.java
+JAVAFILES = $(JAVATESTFILES)
+JARFILES = OOoRunner.jar ridl.jar test.jar
+EXTRAJARFILES = $(OOO_JUNIT_JAR)
+.END
+
+.INCLUDE: settings.mk
+.INCLUDE: target.mk
+.INCLUDE: installationtest.mk
+
+ALLTAR : javatest
+
+.END
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx
index 90b93cc3748e..87953e134292 100644
--- a/sfx2/source/appl/module.cxx
+++ b/sfx2/source/appl/module.cxx
@@ -51,6 +51,7 @@
#include <svl/intitem.hxx>
#include "sfx2/taskpane.hxx"
#include <tools/diagnose_ex.h>
+#include <rtl/strbuf.hxx>
#define SfxModule
#include "sfxslots.hxx"
@@ -423,6 +424,39 @@ SfxModule* SfxModule::GetActiveModule( SfxViewFrame* pFrame )
return pSh ? pSh->GetModule() : 0;
}
+FieldUnit SfxModule::GetModuleFieldUnit( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > const & i_frame )
+{
+ ENSURE_OR_RETURN( i_frame.is(), "SfxModule::GetModuleFieldUnit: invalid frame!", FUNIT_100TH_MM );
+
+ // find SfxViewFrame for the given XFrame
+ SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst();
+ while ( pViewFrame != NULL )
+ {
+ if ( pViewFrame->GetFrame().GetFrameInterface() == i_frame )
+ break;
+ pViewFrame = SfxViewFrame::GetNext( *pViewFrame );
+ }
+ ENSURE_OR_RETURN( pViewFrame != NULL, "SfxModule::GetModuleFieldUnit: unable to find an SfxViewFrame for the given XFrame", FUNIT_100TH_MM );
+
+ // find the module
+ SfxModule const * pModule = GetActiveModule( pViewFrame );
+ ENSURE_OR_RETURN( pModule != NULL, "SfxModule::GetModuleFieldUnit: no SfxModule for the given frame!", FUNIT_100TH_MM );
+
+ SfxPoolItem const * pItem = pModule->GetItem( SID_ATTR_METRIC );
+ if ( pItem == NULL )
+ {
+#if OSL_DEBUG_LEVEL > 0
+ ::rtl::OStringBuffer message;
+ message.append( "SfxModule::GetFieldUnit: no metric item in the module implemented by '" );
+ message.append( typeid( *pModule ).name() );
+ message.append( "'!" );
+ OSL_ENSURE( false, message.makeStringAndClear().getStr() );
+#endif
+ return FUNIT_100TH_MM;
+ }
+ return (FieldUnit)( (SfxUInt16Item*)pItem )->GetValue();
+}
+
FieldUnit SfxModule::GetCurrentFieldUnit()
{
FieldUnit eUnit = FUNIT_INCH;
diff --git a/sfx2/source/appl/sfx.src b/sfx2/source/appl/sfx.src
index c3b734e327de..3bca517c5fd5 100644
--- a/sfx2/source/appl/sfx.src
+++ b/sfx2/source/appl/sfx.src
@@ -40,3 +40,8 @@ String STR_STYLE_FILTER_ALL
Text [ en-US ] = "All Styles" ;
};
+String STR_ACCTITLE_PRODUCTIVITYTOOLS
+{
+ Text [ en-US ] = "%PRODUCTNAME";
+};
+
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index b8c2bec4ba5a..2d5c383f8b89 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -828,6 +828,7 @@ SfxDocumentPage::SfxDocumentPage( Window* pParent, const SfxItemSet& rItemSet )
bHandleDelete ( sal_False )
{
+ aNameED.SetAccessibleName(String(SfxResId(EDIT_FILE_NAME)));
FreeResource();
ImplUpdateSignatures();
@@ -1818,6 +1819,11 @@ CustomPropertiesWindow::CustomPropertiesWindow( Window* pParent, const ResId& rR
m_aEditLoseFocusTimer.SetTimeoutHdl( LINK( this, CustomPropertiesWindow, EditTimeoutHdl ) );
m_aBoxLoseFocusTimer.SetTimeout( 300 );
m_aBoxLoseFocusTimer.SetTimeoutHdl( LINK( this, CustomPropertiesWindow, BoxTimeoutHdl ) );
+
+ ResMgr* pResMgr = rResId.GetResMgr();
+ m_aNameBox.SetAccessibleName( String( ResId( STR_HEADER_NAME, *pResMgr ) ) );
+ m_aTypeBox.SetAccessibleName( String( ResId( STR_HEADER_TYPE, *pResMgr ) ) );
+ m_aValueEdit.SetAccessibleName( String( ResId( STR_HEADER_VALUE, *pResMgr ) ) );
}
CustomPropertiesWindow::~CustomPropertiesWindow()
@@ -2064,6 +2070,11 @@ void CustomPropertiesWindow::AddLine( const ::rtl::OUString& sName, Any& rAny )
//add lose focus handlers of date/time fields
pNewLine->m_aTypeBox.SetLoseFocusHdl( LINK( this, CustomPropertiesWindow, BoxLoseFocusHdl ) );
+
+ pNewLine->m_aNameBox.SetAccessibleName(m_aNameBox.GetAccessibleName());
+ pNewLine->m_aTypeBox.SetAccessibleName(m_aTypeBox.GetAccessibleName());
+ pNewLine->m_aValueEdit.SetAccessibleName(m_aValueEdit.GetAccessibleName());
+
long nPos = GetVisibleLineCount() * GetLineHeight();
m_aCustomPropertiesLines.push_back( pNewLine );
Window* pWindows[] = { &m_aNameBox, &m_aTypeBox, &m_aValueEdit,
@@ -2384,9 +2395,9 @@ void CustomPropertiesControl::AddLine( const ::rtl::OUString& sName, Any& rAny,
SfxCustomPropertiesPage::SfxCustomPropertiesPage( Window* pParent, const SfxItemSet& rItemSet ) :
SfxTabPage( pParent, SfxResId( TP_CUSTOMPROPERTIES ), rItemSet ),
- m_aPropertiesFT ( this, SfxResId( FT_PROPERTIES ) ),
m_aPropertiesCtrl ( this, SfxResId( CTRL_PROPERTIES ) ),
- m_aAddBtn ( this, SfxResId( BTN_ADD ) )
+ m_aAddBtn ( this, SfxResId( BTN_ADD ) ),
+ m_aPropertiesFT ( this, SfxResId( FT_PROPERTIES ) )
{
FreeResource();
diff --git a/sfx2/source/dialog/dinfdlg.hrc b/sfx2/source/dialog/dinfdlg.hrc
index 5453e3606026..43bd848844a0 100644
--- a/sfx2/source/dialog/dinfdlg.hrc
+++ b/sfx2/source/dialog/dinfdlg.hrc
@@ -153,6 +153,10 @@
#define STR_HEADER_VALUE 92
#define STR_HEADER_ACTION 93
+//IAccessibility2 Implementation 2009-----
+#define EDIT_FILE_NAME 94
+//-----IAccessibility2 Implementation 2009
+
#define PB_OK 100
#define PB_CANCEL 101
#define PB_HELP 102
diff --git a/sfx2/source/dialog/dinfdlg.src b/sfx2/source/dialog/dinfdlg.src
index c78347e3dba3..eaa24105bb17 100644
--- a/sfx2/source/dialog/dinfdlg.src
+++ b/sfx2/source/dialog/dinfdlg.src
@@ -303,6 +303,10 @@ TabPage TP_DOCINFODOC
{
Text [ en-US ] = "unknown" ;
};
+ String EDIT_FILE_NAME
+ {
+ Text [ en-US ] = "File Name" ;
+ };
};
// TP_DOCINFOUSER --------------------------------------------------------
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index 454c42896cfe..5cac88236f4a 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -77,9 +77,9 @@ SfxManageStyleSheetPage::SfxManageStyleSheetPage( Window* pParent, const SfxItem
aFilterFt ( this, SfxResId( FT_REGION ) ),
aFilterLb ( this, SfxResId( LB_REGION ) ),
+ aDescGb ( this, SfxResId( GB_DESC ) ),
aDescFt ( this, SfxResId( FT_DESC ) ),
aDescED ( this, SfxResId( ED_DESC ) ),
- aDescGb ( this, SfxResId( GB_DESC ) ),
pStyle( &( (SfxStyleDialog*)pParent->GetParent() )->GetStyleSheet() ),
diff --git a/sfx2/source/dialog/newstyle.cxx b/sfx2/source/dialog/newstyle.cxx
index 8235333857d5..17bbee8c126f 100644
--- a/sfx2/source/dialog/newstyle.cxx
+++ b/sfx2/source/dialog/newstyle.cxx
@@ -91,6 +91,7 @@ SfxNewStyleDlg::SfxNewStyleDlg( Window* pParent, SfxStyleSheetBasePool& rInPool
aOKBtn.SetClickHdl(LINK(this, SfxNewStyleDlg, OKHdl));
aColBox.SetModifyHdl(LINK(this, SfxNewStyleDlg, ModifyHdl));
aColBox.SetDoubleClickHdl(LINK(this, SfxNewStyleDlg, OKHdl));
+ aColBox.SetAccessibleName(SfxResId(FL_COL));
SfxStyleSheetBase *pStyle = rPool.First();
while ( pStyle )
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index d9c1ea80636d..47af8e61d81b 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -125,6 +125,7 @@ SfxPasswordDialog::SfxPasswordDialog( Window* pParent, const String* pGroupText
mbAsciiOnly ( false )
{
+ maPasswordED.SetAccessibleName(String(SfxResId(TEXT_PASSWD)));
FreeResource();
// setup layout
diff --git a/sfx2/source/dialog/passwd.hrc b/sfx2/source/dialog/passwd.hrc
index 5c9b07c7a130..dd35a6449dd8 100644
--- a/sfx2/source/dialog/passwd.hrc
+++ b/sfx2/source/dialog/passwd.hrc
@@ -46,6 +46,9 @@
#define FT_PASSWD_CONFIRM2 27
#define ED_PASSWD_CONFIRM2 28
+//IAccessibility2 Implementation 2009-----
+#define TEXT_PASSWD 31
+//-----IAccessibility2 Implementation 2009
#endif
// ******************************************************************* EOF
diff --git a/sfx2/source/dialog/passwd.src b/sfx2/source/dialog/passwd.src
index 426fb9986d5a..beb2f96a5e21 100644
--- a/sfx2/source/dialog/passwd.src
+++ b/sfx2/source/dialog/passwd.src
@@ -129,37 +129,10 @@ ModalDialog DLG_PASSWD
Pos = MAP_APPFONT( 144, 43 );
Size = MAP_APPFONT( 50, 14 );
};
-};
-
-// ********************************************************************** EOF
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ String TEXT_PASSWD
+ {
+ Text [ en-US ] = "Password" ;
+ };
+};
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index e9c66e2a5f13..35a5fb766b97 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -697,6 +697,11 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText )
pExampleSet = new SfxItemSet( *pSet );
pOutSet = new SfxItemSet( *pSet->GetPool(), pSet->GetRanges() );
}
+
+ aOKBtn.SetAccessibleRelationMemberOf( &aOKBtn );
+ aCancelBtn.SetAccessibleRelationMemberOf( &aCancelBtn );
+ aHelpBtn.SetAccessibleRelationMemberOf( &aHelpBtn );
+ aResetBtn.SetAccessibleRelationMemberOf( &aResetBtn );
}
// -----------------------------------------------------------------------
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 54df29e63e4a..d8ea47baf32d 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -778,6 +778,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, Sfx
bHierarchical ( sal_False ),
bBindingUpdate ( sal_True )
{
+ aFmtLb.SetAccessibleName(SfxResId(STR_STYLE_ELEMTLIST));
aFmtLb.SetHelpId( HID_TEMPLATE_FMT );
aFilterLb.SetHelpId( HID_TEMPLATE_FILTER );
aFmtLb.SetStyle( aFmtLb.GetStyle() | WB_SORT | WB_HIDESELECTION );
@@ -1792,6 +1793,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, ListBox *, pBox )
FillTreeBox();
SelectStyle(aSelectEntry);
+ pTreeBox->SetAccessibleName(SfxResId(STR_STYLE_ELEMTLIST));
pTreeBox->Show();
}
}
diff --git a/sfx2/source/dialog/templdlg.hrc b/sfx2/source/dialog/templdlg.hrc
index 58563fb9c160..e39108ce57a9 100644
--- a/sfx2/source/dialog/templdlg.hrc
+++ b/sfx2/source/dialog/templdlg.hrc
@@ -49,4 +49,7 @@
#define BT_VLIST 9
#define BT_TOOL 10
+//IAccessibility2 Implementation 2009-----
+#define STR_STYLE_ELEMTLIST 18
+//-----IAccessibility2 Implementation 2009
diff --git a/sfx2/source/dialog/templdlg.src b/sfx2/source/dialog/templdlg.src
index 60979450d9f6..ff2661181434 100644
--- a/sfx2/source/dialog/templdlg.src
+++ b/sfx2/source/dialog/templdlg.src
@@ -143,6 +143,10 @@ ModalDialog RID_STYLECATALOG
};
};
// Strings ---------------------------------------------------------------
+String STR_STYLE_ELEMTLIST
+{
+ Text [ en-US ] = "Style List" ;
+};
String STR_STYLE_FILTER_HIERARCHICAL
{
Text [ en-US ] = "Hierarchical" ;
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index f18e903eb6e4..41b969fc1e59 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -1142,7 +1142,6 @@ void SAL_CALL SfxDocumentMetaData::init(
m_isInitialized = false;
m_xDoc = i_xDoc;
- m_xDoc->normalize();
// select nodes for standard meta data stuff
xPath->registerNS(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("xlink")),
@@ -1171,26 +1170,49 @@ void SAL_CALL SfxDocumentMetaData::init(
if (!m_xParent.is()) {
// all this create/append stuff may throw DOMException
try {
- css::uno::Reference<css::xml::dom::XElement> xRElem(
- i_xDoc->createElementNS(
+ css::uno::Reference<css::xml::dom::XElement> xRElem;
+ css::uno::Reference<css::xml::dom::XNode> xNode(
+ i_xDoc->getFirstChild());
+ while (xNode.is()) {
+ if (css::xml::dom::NodeType_ELEMENT_NODE ==xNode->getNodeType())
+ {
+ if (xNode->getNamespaceURI().equalsAscii(s_nsODF) &&
+ xNode->getLocalName().equalsAscii("document-meta"))
+ {
+ xRElem.set(xNode, css::uno::UNO_QUERY_THROW);
+ break;
+ }
+ else
+ {
+ OSL_TRACE("SfxDocumentMetaData::init(): "
+ "deleting unexpected root element: %s",
+ ::rtl::OUStringToOString(xNode->getLocalName(),
+ RTL_TEXTENCODING_UTF8).getStr());
+ i_xDoc->removeChild(xNode);
+ xNode = i_xDoc->getFirstChild(); // start over
+ }
+ } else {
+ xNode = xNode->getNextSibling();
+ }
+ }
+ if (!xRElem.is()) {
+ xRElem = i_xDoc->createElementNS(
::rtl::OUString::createFromAscii(s_nsODF),
- ::rtl::OUString::createFromAscii("office:document-meta")));
- css::uno::Reference<css::xml::dom::XNode> xRNode(xRElem,
- css::uno::UNO_QUERY_THROW);
- // NB: the following is a _bad_idea_ with our DOM implementation
- // do _not_ create attributes with xmlns prefix!
-// xRElem->setAttribute(::rtl::OUString::createFromAscii("xmlns:office"),
-// ::rtl::OUString::createFromAscii(s_nsODF));
+ ::rtl::OUString::createFromAscii("office:document-meta"));
+ css::uno::Reference<css::xml::dom::XNode> xRNode(xRElem,
+ css::uno::UNO_QUERY_THROW);
+ i_xDoc->appendChild(xRNode);
+ }
xRElem->setAttributeNS(::rtl::OUString::createFromAscii(s_nsODF),
::rtl::OUString::createFromAscii("office:version"),
::rtl::OUString::createFromAscii("1.0"));
- i_xDoc->appendChild(xRNode);
+ // does not exist, otherwise m_xParent would not be null
css::uno::Reference<css::xml::dom::XNode> xParent (
i_xDoc->createElementNS(
::rtl::OUString::createFromAscii(s_nsODF),
::rtl::OUString::createFromAscii("office:meta")),
css::uno::UNO_QUERY_THROW);
- xRNode->appendChild(xParent);
+ xRElem->appendChild(xParent);
m_xParent = xParent;
} catch (css::xml::dom::DOMException & e) {
css::uno::Any a(e);
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 4255e9bd2939..3da1f374af1c 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -921,11 +921,6 @@ void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComp
s_xCurrentComponent = _rxComponent;
if ( pAppMgr )
pAppMgr->SetGlobalUNOConstant( "ThisComponent", makeAny( _rxComponent ) );
-
-#if OSL_DEBUG_LEVEL > 0
- const char* pComponentImplName = _rxComponent.get() ? typeid( *_rxComponent.get() ).name() : "void";
- OSL_TRACE( "current component is a %s\n", pComponentImplName );
-#endif
}
Reference< XInterface > SfxObjectShell::GetCurrentComponent()
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index 515149c5a2d3..b91e8b4848ba 100644..100755
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -80,13 +80,15 @@ class SfxPrinterController : public vcl::PrinterController, public SfxListener
sal_Bool m_bOrigStatus;
sal_Bool m_bNeedsChange;
sal_Bool m_bApi;
+ sal_Bool m_bTempPrinter;
util::DateTime m_aLastPrinted;
::rtl::OUString m_aLastPrintedBy;
Sequence< beans::PropertyValue > getMergedOptions() const;
const Any& getSelectionObject() const;
public:
- SfxPrinterController( const Any& i_rComplete,
+ SfxPrinterController( const boost::shared_ptr<Printer>& i_rPrinter,
+ const Any& i_rComplete,
const Any& i_rSelection,
const Any& i_rViewProp,
const Reference< view::XRenderable >& i_xRender,
@@ -105,7 +107,8 @@ public:
virtual void jobFinished( com::sun::star::view::PrintableState );
};
-SfxPrinterController::SfxPrinterController( const Any& i_rComplete,
+SfxPrinterController::SfxPrinterController( const boost::shared_ptr<Printer>& i_rPrinter,
+ const Any& i_rComplete,
const Any& i_rSelection,
const Any& i_rViewProp,
const Reference< view::XRenderable >& i_xRender,
@@ -113,7 +116,8 @@ SfxPrinterController::SfxPrinterController( const Any& i_rComplete,
SfxViewShell* pView,
const uno::Sequence< beans::PropertyValue >& rProps
)
- : maCompleteSelection( i_rComplete )
+ : PrinterController( i_rPrinter)
+ , maCompleteSelection( i_rComplete )
, maSelection( i_rSelection )
, mxRenderable( i_xRender )
, mpLastPrinter( NULL )
@@ -122,6 +126,7 @@ SfxPrinterController::SfxPrinterController( const Any& i_rComplete,
, m_bOrigStatus( sal_False )
, m_bNeedsChange( sal_False )
, m_bApi(i_bApi)
+ , m_bTempPrinter( i_rPrinter.get() != NULL )
{
if ( mpViewShell )
{
@@ -191,15 +196,19 @@ SfxPrinterController::~SfxPrinterController()
const Any& SfxPrinterController::getSelectionObject() const
{
+ const beans::PropertyValue* pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) ) );
+ if( pVal )
+ {
+ sal_Bool bSel = sal_False;
+ pVal->Value >>= bSel;
+ return bSel ? maSelection : maCompleteSelection;
+ }
+
sal_Int32 nChoice = 0;
- sal_Bool bSel = sal_False;
- const beans::PropertyValue* pVal = getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintContent" ) ) );
+ 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;
+ return (nChoice > 1) ? maSelection : maCompleteSelection;
}
Sequence< beans::PropertyValue > SfxPrinterController::getMergedOptions() const
@@ -307,6 +316,7 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
{
if ( mpObjectShell )
{
+ bool bCopyJobSetup = false;
mpObjectShell->Broadcast( SfxPrintingHint( nState ) );
switch ( nState )
{
@@ -334,6 +344,7 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
rBind.Invalidate( SID_PRINTDOC );
rBind.Invalidate( SID_PRINTDOCDIRECT );
rBind.Invalidate( SID_SETUPPRINTER );
+ bCopyJobSetup = ! m_bTempPrinter;
break;
}
@@ -341,6 +352,27 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
break;
}
+ if( bCopyJobSetup && mpViewShell )
+ {
+ // #i114306#
+ // Note: this possibly creates a printer that gets immediately replaced
+ // by a new one. The reason for this is that otherwise we would not get
+ // the printer's SfxItemSet here to copy. Awkward, but at the moment there is no
+ // other way here to get the item set.
+ SfxPrinter* pDocPrt = mpViewShell->GetPrinter(sal_True);
+ if( pDocPrt )
+ {
+ if( pDocPrt->GetName() == getPrinter()->GetName() )
+ pDocPrt->SetJobSetup( getPrinter()->GetJobSetup() );
+ else
+ {
+ SfxPrinter* pNewPrt = new SfxPrinter( pDocPrt->GetOptions().Clone(), getPrinter()->GetName() );
+ pNewPrt->SetJobSetup( getPrinter()->GetJobSetup() );
+ mpViewShell->SetPrinter( pNewPrt, SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP );
+ }
+ }
+ }
+
if ( m_bNeedsChange )
mpObjectShell->EnableSetModified( m_bOrigStatus );
@@ -586,8 +618,23 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro
aSelection <<= GetObjectShell()->GetModel();
Any aComplete( makeAny( GetObjectShell()->GetModel() ) );
Any aViewProp( makeAny( xController ) );
+ boost::shared_ptr<Printer> aPrt;
- boost::shared_ptr<vcl::PrinterController> pController( new SfxPrinterController( aComplete,
+ const beans::PropertyValue* pVal = rProps.getConstArray();
+ for( sal_Int32 i = 0; i < rProps.getLength(); i++ )
+ {
+ if( pVal[i].Name.equalsAscii( "PrinterName" ) )
+ {
+ rtl::OUString aPrinterName;
+ pVal[i].Value >>= aPrinterName;
+ aPrt.reset( new Printer( aPrinterName ) );
+ break;
+ }
+ }
+
+ boost::shared_ptr<vcl::PrinterController> pController( new SfxPrinterController(
+ aPrt,
+ aComplete,
aSelection,
aViewProp,
GetRenderable(),
@@ -704,10 +751,18 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
}
}
}
- sal_Int32 nLen = aProps.getLength();
- aProps.realloc( nLen + 1 );
- aProps[nLen].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintSelectionOnly" ) );
- aProps[nLen].Value = makeAny( bSelection );
+ // HACK: writer sets the SID_SELECTION item when printing directly and expects
+ // to get only the selection document in that case (see getSelectionObject)
+ // however it also reacts to the PrintContent property. We need this distinction here, too,
+ // else one of the combinations print / print direct and selection / all will not work.
+ // it would be better if writer handled this internally
+ if( nId == SID_PRINTDOCDIRECT )
+ {
+ 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) );