summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2011-03-23 17:00:12 +0100
committerJan Holesovsky <kendy@suse.cz>2011-03-23 17:00:12 +0100
commit5630cca2031eeeaa20c916ea9542ccef2327349f (patch)
treee62a262b1d9e1fcbaee23cfefd0ac2cefbc2beb0 /sw/source/ui
parent0562ba185b5c4783b8f59aa3a3ae8d1ef68011d3 (diff)
parentf6c764706cd411d3353666da91b334a899a12154 (diff)
Merge commit 'ooo/DEV300_m103'
Conflicts: sw/inc/calbck.hxx sw/inc/crsrsh.hxx sw/inc/dcontact.hxx sw/inc/doc.hxx sw/inc/docufld.hxx sw/inc/editsh.hxx sw/inc/expfld.hxx sw/inc/fchrfmt.hxx sw/inc/fmtcol.hxx sw/inc/fmthdft.hxx sw/inc/fmtpdsc.hxx sw/inc/format.hxx sw/inc/frmfmt.hxx sw/inc/ndhints.hxx sw/inc/ndtxt.hxx sw/inc/node.hxx sw/inc/numrule.hxx sw/inc/paratr.hxx sw/inc/swtable.hxx sw/inc/unocrsr.hxx sw/inc/unofield.hxx sw/inc/unoframe.hxx sw/inc/unoport.hxx sw/inc/unostyle.hxx sw/inc/usrfld.hxx sw/inc/viewopt.hxx sw/inc/viewsh.hxx sw/source/core/access/accframebase.cxx sw/source/core/access/accmap.cxx sw/source/core/access/accnotextframe.cxx sw/source/core/access/accpara.cxx sw/source/core/access/accpara.hxx sw/source/core/attr/calbck.cxx sw/source/core/crsr/callnk.cxx sw/source/core/crsr/crsrsh.cxx sw/source/core/doc/acmplwrd.cxx sw/source/core/doc/doc.cxx sw/source/core/doc/docdesc.cxx sw/source/core/doc/docdraw.cxx sw/source/core/doc/docfly.cxx sw/source/core/doc/docfmt.cxx sw/source/core/doc/doclay.cxx sw/source/core/doc/docnew.cxx sw/source/core/doc/docnum.cxx sw/source/core/doc/doctxm.cxx sw/source/core/doc/fmtcol.cxx sw/source/core/doc/htmltbl.cxx sw/source/core/doc/number.cxx sw/source/core/docnode/ndsect.cxx sw/source/core/docnode/ndtbl.cxx sw/source/core/docnode/node.cxx sw/source/core/docnode/node2lay.cxx sw/source/core/docnode/section.cxx sw/source/core/docnode/swbaslnk.cxx sw/source/core/draw/dcontact.cxx sw/source/core/draw/dview.cxx sw/source/core/edit/autofmt.cxx sw/source/core/edit/editsh.cxx sw/source/core/edit/edlingu.cxx sw/source/core/fields/authfld.cxx sw/source/core/fields/dbfld.cxx sw/source/core/fields/docufld.cxx sw/source/core/fields/expfld.cxx sw/source/core/fields/reffld.cxx sw/source/core/fields/tblcalc.cxx sw/source/core/frmedt/fefly1.cxx sw/source/core/frmedt/feshview.cxx sw/source/core/frmedt/tblsel.cxx sw/source/core/inc/flyfrm.hxx sw/source/core/inc/prevwpage.hxx sw/source/core/inc/rolbck.hxx sw/source/core/inc/txtfrm.hxx sw/source/core/layout/atrfrm.cxx sw/source/core/layout/findfrm.cxx sw/source/core/layout/flowfrm.cxx sw/source/core/layout/fly.cxx sw/source/core/layout/flycnt.cxx sw/source/core/layout/flylay.cxx sw/source/core/layout/frmtool.cxx sw/source/core/layout/hffrm.cxx sw/source/core/layout/pagechg.cxx sw/source/core/layout/pagedesc.cxx sw/source/core/layout/paintfrm.cxx sw/source/core/layout/sectfrm.cxx sw/source/core/layout/ssfrm.cxx sw/source/core/layout/tabfrm.cxx sw/source/core/layout/wsfrm.cxx sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx sw/source/core/table/swtable.cxx sw/source/core/text/EnhancedPDFExportHelper.cxx sw/source/core/text/inftxt.cxx sw/source/core/text/porfld.cxx sw/source/core/text/txtdrop.cxx sw/source/core/text/txtfly.cxx sw/source/core/text/txtfrm.cxx sw/source/core/text/txtio.cxx sw/source/core/text/txttab.cxx sw/source/core/tox/tox.cxx sw/source/core/txtnode/atrflyin.cxx sw/source/core/txtnode/fmtatr2.cxx sw/source/core/txtnode/ndtxt.cxx sw/source/core/undo/SwUndoPageDesc.cxx sw/source/core/undo/undraw.cxx sw/source/core/unocore/unochart.cxx sw/source/core/unocore/unocoll.cxx sw/source/core/unocore/unodraw.cxx sw/source/core/unocore/unofield.cxx sw/source/core/unocore/unoframe.cxx sw/source/core/unocore/unoftn.cxx sw/source/core/unocore/unoidx.cxx sw/source/core/unocore/unoobj2.cxx sw/source/core/unocore/unoparagraph.cxx sw/source/core/unocore/unoport.cxx sw/source/core/unocore/unoportenum.cxx sw/source/core/unocore/unoredline.cxx sw/source/core/unocore/unoredlines.cxx sw/source/core/unocore/unorefmk.cxx sw/source/core/unocore/unosect.cxx sw/source/core/unocore/unosett.cxx sw/source/core/unocore/unostyle.cxx sw/source/core/unocore/unotbl.cxx sw/source/core/unocore/unotext.cxx sw/source/core/view/viewimp.cxx sw/source/core/view/viewpg.cxx sw/source/core/view/viewsh.cxx sw/source/core/view/vnew.cxx sw/source/core/view/vprint.cxx sw/source/filter/ww8/rtfexport.cxx sw/source/filter/ww8/rtfexport.hxx sw/source/filter/ww8/wrtw8nds.cxx sw/source/filter/ww8/wrtww8gr.cxx sw/source/filter/xml/XMLRedlineImportHelper.cxx sw/source/ui/app/apphdl.cxx sw/source/ui/app/docsh.cxx sw/source/ui/app/docsh2.cxx sw/source/ui/app/swmodul1.cxx sw/source/ui/config/viewopt.cxx sw/source/ui/fldui/fldpage.cxx sw/source/ui/uiview/srcview.cxx sw/source/ui/uiview/view.cxx sw/source/ui/uno/unotxdoc.cxx sw/source/ui/vba/wordvbahelper.cxx sw/source/ui/wrtsh/wrtsh1.cxx
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/app/apphdl.cxx15
-rw-r--r--sw/source/ui/app/docsh.cxx27
-rw-r--r--sw/source/ui/app/docsh2.cxx169
-rw-r--r--sw/source/ui/app/docstyle.cxx4
-rw-r--r--sw/source/ui/app/swmodul1.cxx4
-rw-r--r--sw/source/ui/config/viewopt.cxx19
-rw-r--r--sw/source/ui/dialog/SwSpellDialogChildWindow.cxx50
-rw-r--r--sw/source/ui/dochdl/swdtflvr.cxx23
-rw-r--r--sw/source/ui/docvw/PostItMgr.cxx10
-rw-r--r--sw/source/ui/docvw/edtwin.cxx2
-rw-r--r--sw/source/ui/fldui/fldmgr.cxx6
-rw-r--r--sw/source/ui/fldui/fldpage.cxx8
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx2
-rw-r--r--sw/source/ui/inc/view.hxx1
-rw-r--r--sw/source/ui/inc/wrtsh.hxx2
-rwxr-xr-x[-rw-r--r--]sw/source/ui/index/cnttab.src4
-rwxr-xr-x[-rw-r--r--]sw/source/ui/lingu/hhcwrp.cxx10
-rw-r--r--sw/source/ui/lingu/sdrhhcwrap.cxx49
-rw-r--r--sw/source/ui/lingu/sdrhhcwrap.hxx1
-rw-r--r--sw/source/ui/shells/textfld.cxx10
-rwxr-xr-x[-rw-r--r--]sw/source/ui/shells/textsh.cxx8
-rw-r--r--sw/source/ui/table/tabledlg.cxx10
-rw-r--r--sw/source/ui/uiview/pview.cxx8
-rw-r--r--sw/source/ui/uiview/srcview.cxx1
-rw-r--r--sw/source/ui/uiview/view.cxx73
-rw-r--r--sw/source/ui/uiview/view0.cxx79
-rw-r--r--sw/source/ui/uiview/view2.cxx7
-rw-r--r--sw/source/ui/uiview/viewport.cxx20
-rw-r--r--sw/source/ui/uiview/viewtab.cxx8
-rw-r--r--sw/source/ui/uno/unomod.cxx11
-rwxr-xr-x[-rw-r--r--]sw/source/ui/uno/unotxdoc.cxx103
-rwxr-xr-x[-rw-r--r--]sw/source/ui/uno/unotxvw.cxx10
-rw-r--r--sw/source/ui/utlui/navipi.cxx4
-rw-r--r--sw/source/ui/utlui/uitool.cxx4
-rw-r--r--sw/source/ui/vba/vbainformationhelper.cxx5
-rw-r--r--sw/source/ui/vba/wordvbahelper.cxx4
-rw-r--r--sw/source/ui/wrtsh/wrtsh1.cxx15
37 files changed, 378 insertions, 408 deletions
diff --git a/sw/source/ui/app/apphdl.cxx b/sw/source/ui/app/apphdl.cxx
index 21d46c39dfd7..0183d955ea18 100644
--- a/sw/source/ui/app/apphdl.cxx
+++ b/sw/source/ui/app/apphdl.cxx
@@ -694,6 +694,20 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
SwWrtShell* pWrtSh = pDocSh ? pDocSh->GetWrtShell() : 0;
switch( rEvHint.GetEventId() )
{
+ case SFX_EVENT_LOADFINISHED:
+ OSL_ASSERT(!pWrtSh);
+ // if it is a new document created from a template,
+ // update fixed fields
+ if (pDocSh->GetMedium())
+ {
+ SFX_ITEMSET_ARG( pDocSh->GetMedium()->GetItemSet(),
+ pTemplateItem, SfxBoolItem,
+ SID_TEMPLATE, sal_False);
+ if (pTemplateItem && pTemplateItem->GetValue())
+ {
+ pDocSh->GetDoc()->SetFixFields(false, 0);
+ }
+ }
case SFX_EVENT_CREATEDOC:
// Update all FIX-Date/Time fields
if( pWrtSh )
@@ -702,7 +716,6 @@ void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
sal_Bool bUpdateFields = sal_True;
if( pUpdateDocItem && pUpdateDocItem->GetValue() == document::UpdateDocMode::NO_UPDATE)
bUpdateFields = sal_False;
- pWrtSh->SetFixFields();
if(bUpdateFields)
{
pWrtSh->UpdateInputFlds();
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx
index 1443ce971aa8..fb182605cecb 100644
--- a/sw/source/ui/app/docsh.cxx
+++ b/sw/source/ui/app/docsh.cxx
@@ -94,8 +94,6 @@
#include <swcli.hxx>
#include <txtftn.hxx>
#include <ftnidx.hxx>
-
-// #i20883# Digital Signatures and Encryption
#include <fldbas.hxx>
#include <docary.hxx>
#include <swerror.h> // Error messages
@@ -122,7 +120,7 @@
#include <unomid.h>
#include <sfx2/Metadatable.hxx>
-
+#include <switerator.hxx>
using rtl::OUString;
using namespace ::com::sun::star;
@@ -932,17 +930,16 @@ sal_uInt16 SwDocShell::GetHiddenInformationState( sal_uInt16 nStates )
if ( GetWrtShell() )
{
SwFieldType* pType = GetWrtShell()->GetFldType( RES_POSTITFLD, aEmptyStr );
- SwClientIter aIter( *pType );
- SwClient* pFirst = aIter.GoStart();
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ SwFmtFld* pFirst = aIter.First();
while( pFirst )
{
- if( static_cast<SwFmtFld*>(pFirst)->GetTxtFld() &&
- static_cast<SwFmtFld*>(pFirst)->IsFldInDoc() )
+ if( pFirst->GetTxtFld() && pFirst->IsFldInDoc() )
{
nState |= HIDDENINFORMATION_NOTES;
break;
}
- pFirst = ++aIter;
+ pFirst = aIter.Next();
}
}
}
@@ -963,13 +960,14 @@ void SwDocShell::GetState(SfxItemSet& rSet)
case SID_PRINTPREVIEW:
{
sal_Bool bDisable = IsInPlaceActive();
+ // Disable "multiple layout"
if ( !bDisable )
{
SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this);
while (pTmpFrm) // Look for Preview
{
if ( PTR_CAST(SwView, pTmpFrm->GetViewShell()) &&
- ((SwView*)pTmpFrm->GetViewShell())->GetWrtShell().getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE))
+ ((SwView*)pTmpFrm->GetViewShell())->GetWrtShell().GetViewOptions()->getBrowseMode() )
{
bDisable = sal_True;
break;
@@ -977,6 +975,7 @@ void SwDocShell::GetState(SfxItemSet& rSet)
pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this);
}
}
+ // End of disabled "multiple layout"
if ( bDisable )
rSet.DisableItem( SID_PRINTPREVIEW );
else
@@ -1162,9 +1161,8 @@ SwFEShell* SwDocShell::GetFEShell()
void SwDocShell::RemoveOLEObjects()
{
- SwClientIter aIter( *(SwModify*)pDoc->GetDfltGrfFmtColl() );
- for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) );
- pNd; pNd = (SwCntntNode*)aIter.Next() )
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *pDoc->GetDfltGrfFmtColl() );
+ for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
{
SwOLENode* pOLENd = pNd->GetOLENode();
if( pOLENd && ( pOLENd->IsOLEObjectDeleted() ||
@@ -1191,9 +1189,8 @@ void SwDocShell::CalcLayoutForOLEObjects()
if( !pWrtShell )
return;
- SwClientIter aIter( *(SwModify*)pDoc->GetDfltGrfFmtColl() );
- for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) );
- pNd; pNd = (SwCntntNode*)aIter.Next() )
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *pDoc->GetDfltGrfFmtColl() );
+ for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
{
SwOLENode* pOLENd = pNd->GetOLENode();
if( pOLENd && pOLENd->IsOLESizeInvalid() )
diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx
index 85a7bd82f81e..b8d9593178ec 100644
--- a/sw/source/ui/app/docsh2.cxx
+++ b/sw/source/ui/app/docsh2.cxx
@@ -157,6 +157,44 @@ SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog(
return pDlg;
}
+// Disable "multiple layout"
+
+void SwDocShell::ToggleBrowserMode(sal_Bool bSet, SwView* _pView )
+{
+ GetDoc()->set(IDocumentSettingAccess::BROWSE_MODE, bSet );
+ UpdateFontList();
+ SwView* pTempView = _pView ? _pView : (SwView*)GetView();
+ if( pTempView )
+ {
+ pTempView->GetViewFrame()->GetBindings().Invalidate(FN_SHADOWCURSOR);
+ if( !GetDoc()->getPrinter( false ) )
+ pTempView->SetPrinter( GetDoc()->getPrinter( false ), SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP );
+ GetDoc()->CheckDefaultPageFmt();
+ SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, sal_False);
+ do {
+ if( pTmpFrm != pTempView->GetViewFrame() )
+ {
+ pTmpFrm->DoClose();
+ pTmpFrm = SfxViewFrame::GetFirst(this, sal_False);
+ }
+ else
+ pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this, sal_False);
+
+ } while ( pTmpFrm );
+ const SwViewOption& rViewOptions = *pTempView->GetWrtShell().GetViewOptions();
+ pTempView->GetWrtShell().CheckBrowseView( sal_True );
+ pTempView->CheckVisArea();
+ if( bSet )
+ {
+ const SvxZoomType eType = (SvxZoomType)rViewOptions.GetZoomType();
+ if ( SVX_ZOOM_PERCENT != eType)
+ ((SwView*)GetView())->SetZoom( eType );
+ }
+ pTempView->InvalidateBorder();
+ pTempView->SetNewWindowAllowed(!bSet);
+ }
+}
+// End of disabled "multiple layout"
// update text fields on document properties changes
void SwDocShell::DoFlushDocInfo()
@@ -655,7 +693,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
pDocSh = (SwDocShell*)SfxObjectShell::GetNext( *pDocSh, &aType ) )
{
SwDoc* pTmp = pDocSh->GetDoc();
- if ( pTmp->GetRootFrm() )
+ if ( pTmp->GetCurrentViewShell() ) //swmod 071108//swmod 071225
pTmp->InvalidateAutoCompleteFlag();
}
}
@@ -692,11 +730,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
sal_uInt16 nSlotId = 0;
if( bSet && !bFound ) // Nothing found, so create new Preview
- {
- // Don't create new one for BrowseView!
- if( !GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE) )
nSlotId = SID_VIEWSHELL1;
- }
else if( bFound && !bSet )
nSlotId = bOnly ? SID_VIEWSHELL0 : SID_VIEWSHELL1;
@@ -930,6 +964,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
//pSavePrinter must not be deleted again
}
pViewFrm->GetBindings().SetState(SfxBoolItem(SID_SOURCEVIEW, nSlot == SID_VIEWSHELL2));
+ pViewFrm->GetBindings().Invalidate( SID_NEWWINDOW );
pViewFrm->GetBindings().Invalidate( SID_BROWSER_MODE );
pViewFrm->GetBindings().Invalidate( FN_PRINT_LAYOUT );
}
@@ -1096,60 +1131,6 @@ void SwDocShell::Execute(SfxRequest& rReq)
SW_MOD()->CheckSpellChanges(sal_False, sal_True, sal_True, sal_False );
break;
- case SID_BROWSER_MODE:
- case FN_PRINT_LAYOUT: // for Web, inverse to BrowserMode
- {
- int eState = STATE_TOGGLE;
- sal_Bool bSet = sal_True;
- const SfxPoolItem* pAttr=NULL;
- if ( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nWhich , sal_False, &pAttr ))
- {
- bSet = ((SfxBoolItem*)pAttr)->GetValue();
- if ( nWhich == FN_PRINT_LAYOUT )
- bSet = !bSet;
- eState = bSet ? STATE_ON : STATE_OFF;
- }
-
- if ( STATE_TOGGLE == eState )
- bSet = !GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE);
-
- ToggleBrowserMode(bSet, 0);
-
- // OS: mind the numerical order!
- static sal_uInt16 const aInva[] =
- {
- SID_NEWWINDOW,/*5620*/
- SID_BROWSER_MODE, /*6313*/
- SID_RULER_BORDERS, SID_RULER_PAGE_POS,
- SID_ATTR_LONG_LRSPACE,
- SID_HTML_MODE,
- SID_RULER_PROTECT,
- SID_AUTOSPELL_CHECK,
- FN_RULER, /*20211*/
- FN_VIEW_GRAPHIC, /*20213*/
- FN_VIEW_BOUNDS, /**/
- FN_VIEW_FIELDS, /*20215*/
- FN_VLINEAL, /*20216*/
- FN_VSCROLLBAR, /*20217*/
- FN_HSCROLLBAR, /*20218*/
- FN_VIEW_META_CHARS, /**/
- FN_VIEW_MARKS, /**/
- FN_VIEW_FIELDNAME, /**/
- FN_VIEW_TABLEGRID, /*20227*/
- FN_PRINT_LAYOUT, /*20237*/
- FN_QRY_MERGE, /*20364*/
- 0
- };
- // the view must not exist!
- SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst( this );
- if( pTmpFrm )
- pTmpFrm->GetBindings().Invalidate( aInva );
- if ( !pAttr )
- rReq.AppendItem( SfxBoolItem( nWhich, bSet ) );
- rReq.Done();
- }
- break;
-
case SID_MAIL_PREPAREEXPORT:
{
//pWrtShell is not set in page preview
@@ -1162,7 +1143,8 @@ void SwDocShell::Execute(SfxRequest& rReq)
pWrtShell->EndAllAction();
}
break;
- case SID_MAIL_EXPORT_FINISHED:
+
+ case SID_MAIL_EXPORT_FINISHED:
{
if(pWrtShell)
pWrtShell->StartAllAction();
@@ -1697,73 +1679,6 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView
pDoc->ResetModified();
}
-void SwDocShell::ToggleBrowserMode(sal_Bool bSet, SwView* _pView )
-{
- GetDoc()->set(IDocumentSettingAccess::BROWSE_MODE, bSet );
- UpdateFontList();
- SwView* pTempView = _pView ? _pView : (SwView*)GetView();
- if( pTempView )
- {
- SfxBindings& rBind = pTempView->GetViewFrame()->GetBindings();
- rBind.Invalidate(FN_SHADOWCURSOR);
- rBind.Invalidate(SID_BROWSER_MODE);
- rBind.Invalidate(FN_PRINT_LAYOUT);
-
- if( !GetDoc()->getPrinter( false ) )
- {
- pTempView->SetPrinter( GetDoc()->getPrinter( false ),
- SFX_PRINTER_PRINTER | SFX_PRINTER_JOBSETUP );
- }
-
- // #i44963# Good occasion to check if page sizes in
- // page descriptions are still set to (LONG_MAX, LONG_MAX) (html import)
- GetDoc()->CheckDefaultPageFmt();
-
- // Currently there can be only one view (layout) if the document is viewed in Web layout
- // So if there are more views we are in print layout and for toggling to Web layout all other views must be closed
- SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this, sal_False);
- do {
- if( pTmpFrm != pTempView->GetViewFrame() )
- {
- pTmpFrm->DoClose();
- pTmpFrm = SfxViewFrame::GetFirst(this, sal_False);
- }
- else
- pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this, sal_False);
-
- } while ( pTmpFrm );
-
- const SwViewOption& rViewOptions = *pTempView->GetWrtShell().GetViewOptions();
-
- // set view columns before toggling:
- if ( bSet )
- {
- const sal_uInt16 nColumns = rViewOptions.GetViewLayoutColumns();
- const bool bBookMode = rViewOptions.IsViewLayoutBookMode();
- if ( 1 != nColumns || bBookMode )
- {
- ((SwView*)GetView())->SetViewLayout( 1, false );
- }
- }
-
- // Triggeres a formatting:
- pTempView->GetWrtShell().CheckBrowseView( sal_True );
- pTempView->CheckVisArea();
-
- if( GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE) )
- {
- const SvxZoomType eType = (SvxZoomType)rViewOptions.GetZoomType();
-
- if ( SVX_ZOOM_PERCENT != eType)
- {
- ((SwView*)GetView())->SetZoom( eType );
- }
- }
- pTempView->InvalidateBorder();
- pTempView->SetNewWindowAllowed(!bSet);
- }
-}
-
sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL,
SwgReaderOption& rOpt, sal_Bool bUnoCall )
{
diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx
index 5012f2dc45df..a27ecdecfaec 100644
--- a/sw/source/ui/app/docstyle.cxx
+++ b/sw/source/ui/app/docstyle.cxx
@@ -1164,14 +1164,14 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
if( rStyle.Len() &&
0 != ( pFindFmt = lcl_FindParaFmt( rDoc, rStyle, 0, sal_True )))
{
- pFindFmt->Add( &aCond );
+ aCond.RegisterToFormat( *pFindFmt );
((SwConditionTxtFmtColl*)pColl)->InsertCondition( aCond );
}
}
// Update document to new conditions
SwCondCollCondChg aMsg( pColl );
- pColl->Modify( &aMsg, &aMsg );
+ pColl->ModifyNotification( &aMsg, &aMsg );
}
else if( pCondItem && !pColl->GetDepends() )
{
diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx
index aac2ba7df26e..396286caa39b 100644
--- a/sw/source/ui/app/swmodul1.cxx
+++ b/sw/source/ui/app/swmodul1.cxx
@@ -98,7 +98,7 @@ void lcl_SetUIPrefs(const SwViewOption* pPref, SwView* pView, ViewShell* pSh )
}
if(bHScrollChanged)
{
- pView->ShowHScrollbar( pNewPref->IsViewHScrollBar() || pSh->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE));
+ pView->ShowHScrollbar( pNewPref->IsViewHScrollBar() || pNewPref->getBrowseMode() );
}
//if only the position of the vertical ruler has been changed initiate an update
if(bVAlignChanged && !bHScrollChanged && !bVScrollChanged)
@@ -630,7 +630,7 @@ void SwModule::CheckSpellChanges( sal_Bool bOnlineSpelling,
pDocSh = (SwDocShell*)SfxObjectShell::GetNext( *pDocSh, &aType ) )
{
SwDoc* pTmp = pDocSh->GetDoc();
- if ( pTmp->GetRootFrm() )
+ if ( pTmp->GetCurrentViewShell() ) //swmod 071108//swmod 071225
{
pTmp->SpellItAgainSam( bInvalid, bOnlyWrong, bSmartTags );
ViewShell* pViewShell = 0;
diff --git a/sw/source/ui/config/viewopt.cxx b/sw/source/ui/config/viewopt.cxx
index fc8c87827957..646ce33b23c6 100644
--- a/sw/source/ui/config/viewopt.cxx
+++ b/sw/source/ui/config/viewopt.cxx
@@ -99,7 +99,8 @@ sal_Bool SwViewOption::IsEqualFlags( const SwViewOption &rOpt ) const
&& nPagePrevRow == rOpt.GetPagePrevRow()
&& nPagePrevCol == rOpt.GetPagePrevCol()
&& aRetoucheColor == rOpt.GetRetoucheColor()
- && bFormView == rOpt.IsFormView()
+ && mbFormView == rOpt.IsFormView()
+ && mbBrowseMode == rOpt.getBrowseMode()
&& mbViewLayoutBookMode == rOpt.mbViewLayoutBookMode
&& bShowPlaceHolderFields == rOpt.bShowPlaceHolderFields
&& bIdle == rOpt.bIdle
@@ -180,9 +181,9 @@ SwViewOption::SwViewOption() :
bStarOneSetting(sal_False),
bIsPagePreview(sal_False),
bSelectionInReadonly(sal_False),
- // #114856# Formular view
- bFormView(sal_False),
- bBookview(sal_False),
+ mbFormView(sal_False),
+ mbBrowseMode(sal_False),
+ mbBookView(sal_False),
mbViewLayoutBookMode(sal_False),
bShowPlaceHolderFields( sal_True ),
nZoom( 100 ),
@@ -222,7 +223,7 @@ SwViewOption::SwViewOption(const SwViewOption& rVOpt)
bReadonly = sal_False;
bSelectionInReadonly = sal_False;
// #114856# Formular view
- bFormView = rVOpt.bFormView;
+ mbFormView = rVOpt.mbFormView;
nZoom = rVOpt.nZoom ;
aSnapSize = rVOpt.aSnapSize ;
mnViewLayoutColumns = rVOpt.mnViewLayoutColumns ;
@@ -240,7 +241,8 @@ SwViewOption::SwViewOption(const SwViewOption& rVOpt)
sSymbolFont = rVOpt.sSymbolFont;
nShdwCrsrFillMode = rVOpt.nShdwCrsrFillMode;
bStarOneSetting = rVOpt.bStarOneSetting;
- bBookview = rVOpt.bBookview;
+ mbBookView = rVOpt.mbBookView;
+ mbBrowseMode = rVOpt.mbBrowseMode;
mbViewLayoutBookMode = rVOpt.mbViewLayoutBookMode;
bShowPlaceHolderFields = rVOpt.bShowPlaceHolderFields;
bIdle = rVOpt.bIdle;
@@ -262,7 +264,7 @@ SwViewOption::SwViewOption(const SwViewOption& rVOpt)
SwViewOption& SwViewOption::operator=( const SwViewOption &rVOpt )
{
// #114856# Formular view
- bFormView = rVOpt.bFormView ;
+ mbFormView = rVOpt.mbFormView ;
nZoom = rVOpt.nZoom ;
aSnapSize = rVOpt.aSnapSize ;
mnViewLayoutColumns = rVOpt.mnViewLayoutColumns ;
@@ -280,7 +282,8 @@ SwViewOption& SwViewOption::operator=( const SwViewOption &rVOpt )
sSymbolFont = rVOpt.sSymbolFont;
nShdwCrsrFillMode = rVOpt.nShdwCrsrFillMode;
bStarOneSetting = rVOpt.bStarOneSetting;
- bBookview = rVOpt.bBookview;
+ mbBookView = rVOpt.mbBookView;
+ mbBrowseMode = rVOpt.mbBrowseMode;
mbViewLayoutBookMode = rVOpt.mbViewLayoutBookMode;
bShowPlaceHolderFields = rVOpt.bShowPlaceHolderFields;
bIdle = rVOpt.bIdle;
diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
index 5b5372308eb7..421798e570a3 100644
--- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx
@@ -103,7 +103,7 @@ struct SpellState
ESelection m_aESelection;
//iterating over draw text objects
- std::vector<SdrTextObj*> m_aTextObjects;
+ std::list<SdrTextObj*> m_aTextObjects;
bool m_bTextObjectsCollected;
SpellState() :
@@ -759,58 +759,24 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh)
if( pObj && pObj->ISA(SdrTextObj) )
pCurrentTextObj = static_cast<SdrTextObj*>(pObj);
}
- //at first fill the vector of drawing objects
+ //at first fill the list of drawing objects
if(!m_pSpellState->m_bTextObjectsCollected )
{
m_pSpellState->m_bTextObjectsCollected = true;
- sal_uInt16 n = 0;
- //iterate in the 'normal' array of objects
- while( n < pDoc->GetSpzFrmFmts()->Count() )
+ std::list<SdrTextObj*> aTextObjs;
+ SwDrawContact::GetTextObjectsFromFmt( aTextObjs, pDoc );
+ if(pCurrentTextObj)
{
- SwFrmFmt* pFly = (*pDoc->GetSpzFrmFmts())[ n ];
- if( pFly->IsA( TYPE(SwDrawFrmFmt) ) )
- {
- SwClientIter aIter( (SwFmt&) *pFly );
- if( aIter.First( TYPE(SwDrawContact) ) )
- {
- SdrObject* pSdrO = ((SwDrawContact*)aIter())->GetMaster();
- if ( pSdrO )
- {
- if ( pSdrO->IsA( TYPE(SdrObjGroup) ) )
- {
- SdrObjListIter aListIter( *pSdrO, IM_DEEPNOGROUPS );
- //iterate inside of a grouped object
- while( aListIter.IsMore() )
- {
- SdrObject* pSdrOElement = aListIter.Next();
- if( pSdrOElement && pSdrOElement->IsA( TYPE(SdrTextObj) ) &&
- static_cast<SdrTextObj*>( pSdrOElement)->HasText() &&
- pCurrentTextObj != pSdrOElement)
- {
- m_pSpellState->m_aTextObjects.push_back((SdrTextObj*) pSdrOElement);
+ m_pSpellState->m_aTextObjects.remove(pCurrentTextObj);
+ m_pSpellState->m_aTextObjects.push_back(pCurrentTextObj);
}
}
- }
- else if( pSdrO->IsA( TYPE(SdrTextObj) ) &&
- static_cast<SdrTextObj*>( pSdrO )->HasText() &&
- pCurrentTextObj != pSdrO)
- {
- m_pSpellState->m_aTextObjects.push_back((SdrTextObj*) pSdrO);
- }
- }
- }
- }
- ++n;
- }
- if(pCurrentTextObj)
- m_pSpellState->m_aTextObjects.push_back(pCurrentTextObj);
- }
if(m_pSpellState->m_aTextObjects.size())
{
Reference< XSpellChecker1 > xSpell( GetSpellChecker() );
while(!bNextDoc && m_pSpellState->m_aTextObjects.size())
{
- std::vector<SdrTextObj*>::iterator aStart = m_pSpellState->m_aTextObjects.begin();
+ std::list<SdrTextObj*>::iterator aStart = m_pSpellState->m_aTextObjects.begin();
SdrTextObj* pTextObj = *aStart;
if(m_pSpellState->m_pStartDrawing == pTextObj)
m_pSpellState->m_bRestartDrawing = true;
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index e10f4b61751b..7ed7cea213b3 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -117,27 +117,18 @@
#include <dochdl.hrc>
#include <comcore.hrc> // #111827#
#include <sot/stg.hxx>
-
-// #108584#
#include <svx/svditer.hxx>
-
-// #108584#
#include <editeng/eeitem.hxx>
-
-// #108584#
#include <editeng/fhgtitem.hxx>
-
-// #108584#
#include <svx/svdpage.hxx>
#include <avmedia/mediawindow.hxx>
-
-// #109590#
#include <swcrsr.hxx>
#include <SwRewriter.hxx>
#include <globals.hrc>
#include <osl/mutex.hxx>
#include <vcl/svapp.hxx>
#include <swserv.hxx>
+#include <switerator.hxx>
extern sal_Bool bFrmDrag;
extern sal_Bool bDDINetAttr;
@@ -358,10 +349,8 @@ uno::Reference < embed::XEmbeddedObject > SwTransferable::FindOLEObj( sal_Int64&
uno::Reference < embed::XEmbeddedObject > xObj;
if( pClpDocFac )
{
- SwClientIter aIter( *(SwModify*)pClpDocFac->GetDoc()->
- GetDfltGrfFmtColl() );
- for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) );
- pNd; pNd = (SwCntntNode*)aIter.Next() )
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *pClpDocFac->GetDoc()->GetDfltGrfFmtColl() );
+ for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
if( ND_OLENODE == pNd->GetNodeType() )
{
xObj = ((SwOLENode*)pNd)->GetOLEObj().GetOleRef();
@@ -376,10 +365,8 @@ Graphic* SwTransferable::FindOLEReplacementGraphic() const
{
if( pClpDocFac )
{
- SwClientIter aIter( *(SwModify*)pClpDocFac->GetDoc()->
- GetDfltGrfFmtColl() );
- for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) );
- pNd; pNd = (SwCntntNode*)aIter.Next() )
+ SwIterator<SwCntntNode,SwFmtColl> aIter( *pClpDocFac->GetDoc()->GetDfltGrfFmtColl() );
+ for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
if( ND_OLENODE == pNd->GetNodeType() )
{
return ((SwOLENode*)pNd)->GetGraphic();
diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx
index 1c014de82f5e..a369922179d9 100644
--- a/sw/source/ui/docvw/PostItMgr.cxx
+++ b/sw/source/ui/docvw/PostItMgr.cxx
@@ -84,6 +84,7 @@
#include <i18npool/lang.h>
#include "swevent.hxx"
+#include "switerator.hxx"
// distance between Anchor Y and initial note position
#define POSTIT_INITIAL_ANCHOR_DISTANCE 20
@@ -1099,17 +1100,16 @@ void SwPostItMgr::AddPostIts(bool bCheckExistance, bool bFocus)
{
bool bEmpty = mvPostItFlds.empty();
SwFieldType* pType = mpView->GetDocShell()->GetDoc()->GetFldType(RES_POSTITFLD, aEmptyStr,false);
- SwClientIter aIter( *pType );
- SwClient * pFirst = aIter.GoStart();
- while(pFirst)
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ SwFmtFld* pSwFmtFld = aIter.First();
+ while(pSwFmtFld)
{
- SwFmtFld* pSwFmtFld = static_cast<SwFmtFld*>(pFirst);
if ( pSwFmtFld->GetTxtFld())
{
if ( pSwFmtFld->IsFldInDoc() )
InsertItem(pSwFmtFld,bCheckExistance,bFocus);
}
- pFirst = aIter++;
+ pSwFmtFld = aIter.Next();
}
// if we just added the first one we have to update the view for centering
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 2a6124aba578..818aec6e04a3 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -3774,7 +3774,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt)
if( bTstShdwCrsr && bInsWin && !bIsDocReadOnly &&
!bInsFrm &&
- !rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ !rSh.GetViewOptions()->getBrowseMode() &&
rSh.GetViewOptions()->IsShadowCursor() &&
!(rMEvt.GetModifier() + rMEvt.GetButtons()) &&
!rSh.HasSelection() && !GetConnectMetaFile() )
diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx
index 314e12498093..ae82af0b772f 100644
--- a/sw/source/ui/fldui/fldmgr.cxx
+++ b/sw/source/ui/fldui/fldmgr.cxx
@@ -1028,8 +1028,8 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
sal_uInt16 nTmpPos = sCmd.SearchAndReplace( ' ', sfx2::cTokenSeperator );
sCmd.SearchAndReplace( ' ', sfx2::cTokenSeperator, nTmpPos );
- SwDDEFieldType* pTyp = (SwDDEFieldType*)pCurShell->InsertFldType(
- SwDDEFieldType( rData.sPar1, sCmd, (sal_uInt16)nFormatId ));
+ SwDDEFieldType aType( rData.sPar1, sCmd, (sal_uInt16) nFormatId );
+ SwDDEFieldType* pTyp = (SwDDEFieldType*) pCurShell->InsertFldType( aType );
pFld = new SwDDEField( pTyp );
break;
}
@@ -1393,7 +1393,7 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
else if( bPageVar )
((SwRefPageGetFieldType*)pCurShell->GetFldType( 0, RES_REFPAGEGETFLD ))->UpdateFlds();
else if( TYP_GETREFFLD == rData.nTypeId )
- pFld->GetTyp()->Modify( 0, 0 );
+ pFld->GetTyp()->ModifyNotification( 0, 0 );
// delete temporary field
delete pFld;
diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx
index 1f1594c0f9d7..fae0ba371ec5 100644
--- a/sw/source/ui/fldui/fldpage.cxx
+++ b/sw/source/ui/fldui/fldpage.cxx
@@ -54,6 +54,7 @@
#include <cmdid.h>
#include <globals.hrc>
#include <sfx2/bindings.hxx>
+#include <switerator.hxx>
using namespace ::com::sun::star;
@@ -240,14 +241,13 @@ sal_Bool SwFldPage::InsertFld(sal_uInt16 nTypeId, sal_uInt16 nSubType, const Str
SwDBFieldType* pTyp = (SwDBFieldType*)pSh->InsertFldType(
SwDBFieldType(pSh->GetDoc(), sColumn, aData));
- SwClientIter aIter( *pOldTyp );
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pOldTyp );
- for( SwFmtFld* pFmtFld = (SwFmtFld*)aIter.First( TYPE(SwFmtFld) );
- pFmtFld; pFmtFld = (SwFmtFld*)aIter.Next() )
+ for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() )
{
if( pFmtFld->GetFld() == m_pCurFld)
{
- pTyp->Add(pFmtFld); // put field on new type
+ pFmtFld->RegisterToFieldType(*pTyp);
pTmpFld->ChgTyp(pTyp);
break;
}
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index be483c12545e..02e1013705b0 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -1271,7 +1271,7 @@ void SwFrmPage::InitPos(RndStdIds eId,
aAtHorzPosFT.Enable( bEnable );
aAtHorzPosED.Enable( bEnable );
- bEnable = nV == text::VertOrientation::NONE && !bFormat;
+ bEnable = nV == text::VertOrientation::NONE;
if ( !bEnable )
{
aAtVertPosED.SetValue( 0, FUNIT_TWIP );
diff --git a/sw/source/ui/inc/view.hxx b/sw/source/ui/inc/view.hxx
index 56285b11d52a..080bd8bcb316 100644
--- a/sw/source/ui/inc/view.hxx
+++ b/sw/source/ui/inc/view.hxx
@@ -499,6 +499,7 @@ public:
void SetVisArea( const Point&, sal_Bool bUpdateScrollbar = sal_True);
void CheckVisArea();
+ void RecheckBrowseMode();
static LAYOUT_NS Dialog* GetSearchDialog();
static sal_uInt16 GetMoveType();
diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx
index db1f651b099f..9311c2ca8e1f 100644
--- a/sw/source/ui/inc/wrtsh.hxx
+++ b/sw/source/ui/inc/wrtsh.hxx
@@ -454,6 +454,8 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)();
// die Core erzeugt eine Selektion, das SttSelect muss gerufen werden
virtual void NewCoreSelection();
+ virtual void ApplyViewOptions( const SwViewOption &rOpt );
+
// autom. Update von Vorlagen
void AutoUpdateFrame(SwFrmFmt* pFmt, const SfxItemSet& rStyleSet);
void AutoUpdatePara(SwTxtFmtColl* pColl, const SfxItemSet& rStyleSet);
diff --git a/sw/source/ui/index/cnttab.src b/sw/source/ui/index/cnttab.src
index 9559aee6fab5..821a2c7d4505 100644..100755
--- a/sw/source/ui/index/cnttab.src
+++ b/sw/source/ui/index/cnttab.src
@@ -575,8 +575,8 @@ TabPage TP_TOX_ENTRY
};
Window WIN_TOKEN
{
- Pos = MAP_APPFONT ( 70, 16 ) ;
- Size = MAP_APPFONT ( 136, 12 ) ;
+ Pos = MAP_APPFONT ( 70, 15 ) ;
+ Size = MAP_APPFONT ( 136, 14 ) ;
ImageButton WIN_LEFT_SCROLL
{
HelpID = "sw:ImageButton:TP_TOX_ENTRY:WIN_LEFT_SCROLL";
diff --git a/sw/source/ui/lingu/hhcwrp.cxx b/sw/source/ui/lingu/hhcwrp.cxx
index f81cad15b7c7..715d7c2f1851 100644..100755
--- a/sw/source/ui/lingu/hhcwrp.cxx
+++ b/sw/source/ui/lingu/hhcwrp.cxx
@@ -543,11 +543,11 @@ void SwHHCWrapper::ReplaceUnit(
if (pTargetFont && pNewUnitLanguage)
{
SvxFontItem aFontItem = (SvxFontItem&) aSet.Get( RES_CHRATR_CJK_FONT );
- aFontItem.GetFamilyName() = pTargetFont->GetName();
- aFontItem.GetFamily() = pTargetFont->GetFamily();
- aFontItem.GetStyleName() = pTargetFont->GetStyleName();
- aFontItem.GetPitch() = pTargetFont->GetPitch();
- aFontItem.GetCharSet() = pTargetFont->GetCharSet();
+ aFontItem.SetFamilyName( pTargetFont->GetName());
+ aFontItem.SetFamily( pTargetFont->GetFamily());
+ aFontItem.SetStyleName( pTargetFont->GetStyleName());
+ aFontItem.SetPitch( pTargetFont->GetPitch());
+ aFontItem.SetCharSet( pTargetFont->GetCharSet() );
aSet.Put( aFontItem );
}
diff --git a/sw/source/ui/lingu/sdrhhcwrap.cxx b/sw/source/ui/lingu/sdrhhcwrap.cxx
index 2e910d09e329..8732200dbe71 100644
--- a/sw/source/ui/lingu/sdrhhcwrap.cxx
+++ b/sw/source/ui/lingu/sdrhhcwrap.cxx
@@ -69,7 +69,6 @@ SdrHHCWrapper::SdrHHCWrapper( SwView* pVw,
pView( pVw ),
pTextObj( NULL ),
pOutlView( NULL ),
- pListIter( NULL ),
nOptions( nConvOptions ),
nDocIndex( 0 ),
nSourceLang( nSourceLanguage ),
@@ -140,51 +139,14 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument()
sal_uInt16 n = nDocIndex;
- while( !bNextDoc && ( pListIter ||
- n < pView->GetDocShell()->GetDoc()->GetSpzFrmFmts()->Count() ) )
+ std::list<SdrTextObj*> aTextObjs;
+ SwDrawContact::GetTextObjectsFromFmt( aTextObjs, pView->GetDocShell()->GetDoc() );
+ for ( std::list<SdrTextObj*>::iterator aIt = aTextObjs.begin(); aIt != aTextObjs.end(); aIt++ )
{
- while( !pTextObj && pListIter )
- {
- if( pListIter->IsMore() )
- {
- SdrObject* pSdrO = pListIter->Next();
- if( pSdrO && pSdrO->IsA( TYPE(SdrTextObj) ) &&
- ( (SdrTextObj*) pSdrO )->HasText() )
- pTextObj = (SdrTextObj*) pSdrO;
- }
- else
- {
- delete pListIter;
- pListIter = NULL;
- }
- }
-
- if ( !pTextObj &&
- n < pView->GetDocShell()->GetDoc()->GetSpzFrmFmts()->Count() )
- {
- SwFrmFmt* pFly = (*pView->GetDocShell()->GetDoc()->GetSpzFrmFmts())[ n ];
- if( pFly->IsA( TYPE(SwDrawFrmFmt) ) )
- {
- SwClientIter aIter( (SwFmt&) *pFly );
- if( aIter.First( TYPE(SwDrawContact) ) )
- {
- SdrObject* pSdrO = ((SwDrawContact*)aIter())->GetMaster();
- if ( pSdrO )
- {
- if ( pSdrO->IsA( TYPE(SdrObjGroup) ) )
- pListIter = new SdrObjListIter( *pSdrO, IM_DEEPNOGROUPS );
- else if( pSdrO->IsA( TYPE(SdrTextObj) ) &&
- ( (SdrTextObj*) pSdrO )->HasText() )
- pTextObj = (SdrTextObj*) pSdrO;
- }
- }
- }
- ++n;
- }
+ pTextObj = (*aIt);
if ( pTextObj )
{
OutlinerParaObject* pParaObj = pTextObj->GetOutlinerParaObject();
-
if ( pParaObj )
{
SetPaperSize( pTextObj->GetLogicRect().GetSize() );
@@ -215,8 +177,11 @@ sal_Bool SdrHHCWrapper::ConvertNextDocument()
else
SetUpdateMode(sal_False);
}
+
if ( !bNextDoc )
pTextObj = NULL;
+ else
+ break;
}
}
diff --git a/sw/source/ui/lingu/sdrhhcwrap.hxx b/sw/source/ui/lingu/sdrhhcwrap.hxx
index c9e202dcfc56..567b27b68ec9 100644
--- a/sw/source/ui/lingu/sdrhhcwrap.hxx
+++ b/sw/source/ui/lingu/sdrhhcwrap.hxx
@@ -44,7 +44,6 @@ class SdrHHCWrapper : public SdrOutliner
SwView* pView;
SdrTextObj* pTextObj;
OutlinerView* pOutlView;
- SdrObjListIter* pListIter;
sal_Int32 nOptions;
sal_uInt16 nDocIndex;
LanguageType nSourceLang;
diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx
index 6cce094bdb77..6ca3e8be76bf 100644
--- a/sw/source/ui/shells/textfld.cxx
+++ b/sw/source/ui/shells/textfld.cxx
@@ -80,6 +80,7 @@
#include <app.hrc>
#include <PostItMgr.hxx>
+#include <switerator.hxx>
using namespace nsSwDocInfoSubType;
@@ -374,17 +375,16 @@ void SwTextShell::ExecField(SfxRequest &rReq)
if (pPostIt)
{
SwFieldType* pType = rSh.GetDoc()->GetFldType(RES_POSTITFLD, aEmptyStr,false);
- SwClientIter aIter( *pType );
- SwClient* pFirst = aIter.GoStart();
- while( pFirst )
+ SwIterator<SwFmtFld,SwFieldType> aIter( *pType );
+ SwFmtFld* pSwFmtFld = aIter.First();
+ while( pSwFmtFld )
{
- SwFmtFld* pSwFmtFld = static_cast<SwFmtFld*>(pFirst);
if ( pSwFmtFld->GetFld() == pPostIt )
{
pSwFmtFld->Broadcast( SwFmtFldHint( 0, SWFMTFLD_FOCUS, &GetView() ) );
break;
}
- pFirst = aIter++;
+ pSwFmtFld = aIter.Next();
}
}
}
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index d7a291ceae4f..d17fd52b8e28 100644..100755
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -1151,10 +1151,10 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
if( aNewFont.GetName().Len() )
{
SvxFontItem aNewFontItem( aFont );
- aNewFontItem.GetFamilyName() = aNewFont.GetName();
- aNewFontItem.GetFamily() = aNewFont.GetFamily();
- aNewFontItem.GetPitch() = aNewFont.GetPitch();
- aNewFontItem.GetCharSet() = aNewFont.GetCharSet();
+ aNewFontItem.SetFamilyName( aNewFont.GetName());
+ aNewFontItem.SetFamily( aNewFont.GetFamily());
+ aNewFontItem.SetPitch( aNewFont.GetPitch());
+ aNewFontItem.SetCharSet( aNewFont.GetCharSet() );
SfxItemSet aRestoreSet( GetPool(), RES_CHRATR_FONT, RES_CHRATR_FONT,
RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONT,
diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx
index 2ae69c47de82..006c78003975 100644
--- a/sw/source/ui/table/tabledlg.cxx
+++ b/sw/source/ui/table/tabledlg.cxx
@@ -1036,12 +1036,18 @@ void SwTableColumnPage::UpdateCols( sal_uInt16 nAktPos )
if(!bModifyTable && !bProp )
{
-// Tabellenbreite bleibt, Differenz wird mit der/den
-// naechsten Zellen ausgeglichen
+// the table width is constant, the difference is balanced with the other columns
+ sal_uInt16 nLoopCount = 0;
while( nDiff )
{
if( ++nAktPos == nNoOfVisibleCols)
+ {
nAktPos = 0;
+ ++nLoopCount;
+ //#i101353# in small tables it might not be possible to balance column width
+ if( nLoopCount > 1 )
+ break;
+ }
if( nDiff < 0 )
{
SetVisibleWidth(nAktPos, GetVisibleWidth(nAktPos) -nDiff);
diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx
index 490b93b03f2a..790cfb62c123 100644
--- a/sw/source/ui/uiview/pview.cxx
+++ b/sw/source/ui/uiview/pview.cxx
@@ -1173,6 +1173,7 @@ void SwPagePreView::Init(const SwViewOption * pPrefs)
aOpt.SetTable( sal_True );
aOpt.SetSnap( sal_False );
aOpt.SetGridVisible( sal_False );
+
GetViewShell()->ApplyViewOptions( aOpt );
GetViewShell()->ApplyAccessiblityOptions(SW_MOD()->GetAccessibilityOptions());
@@ -1180,13 +1181,6 @@ void SwPagePreView::Init(const SwViewOption * pPrefs)
SwPrintData const aPrintOptions = *SW_MOD()->GetPrtOptions(false);
GetViewShell()->AdjustOptionsForPagePreview( aPrintOptions );
- IDocumentSettingAccess* pIDSA = pESh->getIDocumentSettingAccess();
- if( pIDSA->get(IDocumentSettingAccess::BROWSE_MODE))
- {
- pIDSA->set(IDocumentSettingAccess::BROWSE_MODE, false);
- pESh->CheckBrowseView( sal_True );
- }
-
GetViewShell()->CalcLayout();
DocSzChgd( GetViewShell()->GetDocSize() );
diff --git a/sw/source/ui/uiview/srcview.cxx b/sw/source/ui/uiview/srcview.cxx
index abaf5aefd615..07342b1c942c 100644
--- a/sw/source/ui/uiview/srcview.cxx
+++ b/sw/source/ui/uiview/srcview.cxx
@@ -278,6 +278,7 @@ void SwSrcView::Init()
aEditWin.SetReadonly(sal_True);
}
+ SetNewWindowAllowed( sal_False );
StartListening(*pDocShell,sal_True);
}
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index e892760914d3..a5089d532453 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -204,6 +204,13 @@ void SwView::GotFocus() const
const_cast< SwView* >( this )->AttrChangedNotify( pWrtShell );
}
}
+ if( GetWrtShellPtr() )
+ {
+ SwWrtShell& rWrtShell = GetWrtShell();
+ rWrtShell.GetDoc()->SetCurrentViewShell( GetWrtShellPtr() );
+ rWrtShell.GetDoc()->set( IDocumentSettingAccess::BROWSE_MODE,
+ rWrtShell.GetViewOptions()->getBrowseMode() );
+ }
}
/*--------------------------------------------------------------------
@@ -708,7 +715,6 @@ void SwView::_CheckReadonlySelection()
SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
: SfxViewShell( _pFrame, SWVIEWFLAGS ),
-
aPageStr( SW_RES( STR_PAGE )),
nNewPage(USHRT_MAX),
pNumRuleNodeFromDoc(0),
@@ -789,9 +795,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
//! get lingu options without loading lingu DLL
SvtLinguOptions aLinguOpt;
-
SvtLinguConfig().GetOptions( aLinguOpt );
-
aUsrPref.SetOnlineSpell( aLinguOpt.bIsSpellAuto );
sal_Bool bOldShellWasSrcView = sal_False;
@@ -800,46 +804,42 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
// document
SfxViewShell* pExistingSh = 0;
if ( pOldSh )
- pExistingSh = pOldSh;
- else
- {
- SfxViewFrame *pF = SfxViewFrame::GetFirst( pDocSh );
- if( pF == _pFrame )
- pF = SfxViewFrame::GetNext( *pF, pDocSh );
- if( pF )
- pExistingSh = pF->GetViewShell();
- }
-
- // determine type of existing view
- if( pExistingSh &&
- pExistingSh->IsA( TYPE( SwPagePreView ) ) )
{
- sSwViewData = ((SwPagePreView*)pExistingSh)->GetPrevSwViewData();
- sNewCrsrPos = ((SwPagePreView*)pExistingSh)->GetNewCrsrPos();
- nNewPage = ((SwPagePreView*)pExistingSh)->GetNewPage();
- bOldShellWasPagePreView = sal_True;
+ pExistingSh = pOldSh;
+ // determine type of existing view
+ if( pExistingSh->IsA( TYPE( SwPagePreView ) ) )
+ {
+ sSwViewData = ((SwPagePreView*)pExistingSh)->GetPrevSwViewData();
+ sNewCrsrPos = ((SwPagePreView*)pExistingSh)->GetNewCrsrPos();
+ nNewPage = ((SwPagePreView*)pExistingSh)->GetNewPage();
+ bOldShellWasPagePreView = sal_True;
+ }
+ else if( pExistingSh->IsA( TYPE( SwSrcView ) ) )
+ bOldShellWasSrcView = sal_True;
}
- else if( pExistingSh &&
- pExistingSh->IsA( TYPE( SwSrcView ) ) )
- bOldShellWasSrcView = sal_True;
RTL_LOGFILE_CONTEXT_TRACE( aLog, "before create WrtShell" );
if(PTR_CAST( SwView, pExistingSh))
{
pWrtShell = new SwWrtShell( *((SwView*)pExistingSh)->pWrtShell,
pEditWin, *this);
-//MA: Das kann doch nur zu einem GPF fuehren!
-// nSelectionType = ((SwView*)pOldSh)->nSelectionType;
+ }
+ else if( dynamic_cast<SwWrtShell*>( pDocSh->GetDoc()->GetCurrentViewShell() ) )
+ {
+ pWrtShell = new SwWrtShell( *(SwWrtShell*)pDocSh->GetDoc()->GetCurrentViewShell(),
+ pEditWin, *this);
}
else
{
SwDoc& rDoc = *((SwDocShell*)pDocSh)->GetDoc();
if( !bOldShellWasSrcView && pWebDShell && !bOldShellWasPagePreView )
- rDoc.set(IDocumentSettingAccess::BROWSE_MODE, true);
+ aUsrPref.setBrowseMode( sal_True );
+ else if( rDoc.IsLoaded() )
+ aUsrPref.setBrowseMode( rDoc.get(IDocumentSettingAccess::BROWSE_MODE) );
//Fuer den BrowseMode wollen wir keinen Factor uebernehmen.
- if( rDoc.get(IDocumentSettingAccess::BROWSE_MODE) && aUsrPref.GetZoomType() != SVX_ZOOM_PERCENT )
+ if( aUsrPref.getBrowseMode() && aUsrPref.GetZoomType() != SVX_ZOOM_PERCENT )
{
aUsrPref.SetZoomType( SVX_ZOOM_PERCENT );
aUsrPref.SetZoom( 100 );
@@ -947,8 +947,10 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh )
pWrtShell->DoUndo( 0 != SW_MOD()->GetUndoOptions().GetUndoCount() );
- const sal_Bool bBrowse = pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const sal_Bool bBrowse = pWrtShell->GetViewOptions()->getBrowseMode();
+ // Disable "multiple window"
SetNewWindowAllowed(!bBrowse);
+ // End of disabled multiple window
ShowVScrollbar(aUsrPref.IsViewVScrollBar());
ShowHScrollbar(aUsrPref.IsViewHScrollBar());
@@ -1085,9 +1087,6 @@ SwView::~SwView()
delete pFormatClipboard;
}
-/*--------------------------------------------------------------------
- Beschreibung: DocShell rausgrabbeln ueber das FrameWindow
- --------------------------------------------------------------------*/
SwDocShell* SwView::GetDocShell()
{
SfxObjectShell* pDocShell = GetViewFrame()->GetObjectShell();
@@ -1148,7 +1147,7 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse )
if ( rUserData.GetTokenCount() > 1 &&
//Fuer Dokumente ohne Layout nur im OnlineLayout oder beim
//Forward/Backward
- (!pWrtShell->IsNewLayout() || pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) || bBrowse) )
+ (!pWrtShell->IsNewLayout() || pWrtShell->GetViewOptions()->getBrowseMode() || bBrowse) )
{
bool bIsOwnDocument = lcl_IsOwnDocument( *this );
@@ -1170,7 +1169,7 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse )
nRight = rUserData.GetToken(0, ';', nPos ).ToInt32(),
nBottom= rUserData.GetToken(0, ';', nPos ).ToInt32();
- const long nAdd = pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ? DOCUMENTBORDER : DOCUMENTBORDER*2;
+ const long nAdd = pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
if ( nBottom <= (pWrtShell->GetDocSize().Height()+nAdd) )
{
pWrtShell->EnableSmooth( sal_False );
@@ -1179,7 +1178,7 @@ void SwView::ReadUserData( const String &rUserData, sal_Bool bBrowse )
sal_uInt16 nOff = 0;
SvxZoomType eZoom;
- if( !pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if( !pWrtShell->GetViewOptions()->getBrowseMode() )
eZoom = (SvxZoomType) (sal_uInt16)rUserData.GetToken(nOff, ';', nPos ).ToInt32();
else
{
@@ -1267,7 +1266,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
return;
bool bIsOwnDocument = lcl_IsOwnDocument( *this );
sal_Int32 nLength = rSequence.getLength();
- if (nLength && (!pWrtShell->IsNewLayout() || pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) || bBrowse) )
+ if (nLength && (!pWrtShell->IsNewLayout() || pWrtShell->GetViewOptions()->getBrowseMode() || bBrowse) )
{
SET_CURR_SHELL(pWrtShell);
const beans::PropertyValue *pValue = rSequence.getConstArray();
@@ -1355,7 +1354,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
if (bGotVisibleBottom)
{
Point aCrsrPos( nX, nY );
- const long nAdd = pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ? DOCUMENTBORDER : DOCUMENTBORDER*2;
+ const long nAdd = pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2;
if (nBottom <= (pWrtShell->GetDocSize().Height()+nAdd) )
{
pWrtShell->EnableSmooth( sal_False );
@@ -1363,7 +1362,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue >
sal_uInt16 nOff = 0;
SvxZoomType eZoom;
- if ( !pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if ( !pWrtShell->GetViewOptions()->getBrowseMode() )
eZoom = static_cast < SvxZoomType > ( nZoomType );
else
{
diff --git a/sw/source/ui/uiview/view0.cxx b/sw/source/ui/uiview/view0.cxx
index 84746fd6510e..9b55a8247ebd 100644
--- a/sw/source/ui/uiview/view0.cxx
+++ b/sw/source/ui/uiview/view0.cxx
@@ -48,15 +48,17 @@
#include <sfx2/bindings.hxx>
#include <uivwimp.hxx>
#include <avmedia/mediaplayer.hxx>
+//#include <swlinguconfig.hxx>
#include <swmodule.hxx>
#include <sfx2/objface.hxx>
#include <navipi.hxx>
#include <wrtsh.hxx>
-#include "doc.hxx"
+#include <edtwin.hxx>
#include "view.hxx"
#include "basesh.hxx"
#include "docsh.hxx"
+#include "doc.hxx"
#include "globals.hrc"
#include "cmdid.h" // FN_ ...
#include "globdoc.hxx"
@@ -198,6 +200,46 @@ void lcl_SetViewMetaChars( SwViewOption& rVOpt, sal_Bool bOn)
}
}
+void SwView::RecheckBrowseMode()
+{
+ // OS: numerische Reihenfolge beachten!
+ static sal_uInt16 const aInva[] =
+ {
+ //SID_NEWWINDOW,/*5620*/
+ SID_BROWSER_MODE, /*6313*/
+ SID_RULER_BORDERS, SID_RULER_PAGE_POS,
+ //SID_ATTR_LONG_LRSPACE,
+ SID_HTML_MODE,
+ SID_RULER_PROTECT,
+ //SID_AUTOSPELL_CHECK,
+ //SID_AUTOSPELL_MARKOFF,
+ FN_RULER, /*20211*/
+ FN_VIEW_GRAPHIC, /*20213*/
+ FN_VIEW_BOUNDS, /**/
+ FN_VIEW_FIELDS, /*20215*/
+ FN_VLINEAL, /*20216*/
+ FN_VSCROLLBAR, /*20217*/
+ FN_HSCROLLBAR, /*20218*/
+ FN_VIEW_META_CHARS, /**/
+ FN_VIEW_MARKS, /**/
+ //FN_VIEW_FIELDNAME, /**/
+ FN_VIEW_TABLEGRID, /*20227*/
+ FN_PRINT_LAYOUT, /*20237*/
+ FN_QRY_MERGE, /*20364*/
+ FN_SHADOWCURSOR, /**/
+ 0
+ };
+ // the view must not exist!
+ GetViewFrame()->GetBindings().Invalidate(aInva);
+ CheckVisArea();
+
+ SvxZoomType eType;
+ if( GetWrtShell().GetViewOptions()->getBrowseMode() && SVX_ZOOM_PERCENT != (eType = (SvxZoomType)
+ GetWrtShell().GetViewOptions()->GetZoomType()) )
+ SetZoom( eType );
+ InvalidateBorder();
+}
+
/*--------------------------------------------------------------------
State of view options
--------------------------------------------------------------------*/
@@ -212,7 +254,6 @@ void SwView::StateViewOptions(SfxItemSet &rSet)
while(nWhich)
{
sal_Bool bReadonly = GetDocShell()->IsReadOnly();
- sal_Bool bBrowse = pIDSA ? pIDSA->get( IDocumentSettingAccess::BROWSE_MODE ) : sal_False;
if ( bReadonly && nWhich != FN_VIEW_GRAPHIC )
{
rSet.DisableItem(nWhich);
@@ -231,6 +272,15 @@ void SwView::StateViewOptions(SfxItemSet &rSet)
aBool.SetValue( pOpt->IsViewAnyRuler());
}
break;
+ case SID_BROWSER_MODE:
+ case FN_PRINT_LAYOUT:
+ {
+ sal_Bool bState = pOpt->getBrowseMode();
+ if(FN_PRINT_LAYOUT == nWhich)
+ bState = !bState;
+ aBool.SetValue( bState );
+ }
+ break;
case FN_VIEW_BOUNDS:
aBool.SetValue( SwViewOption::IsDocBoundaries()); break;
case FN_VIEW_GRAPHIC:
@@ -270,7 +320,7 @@ void SwView::StateViewOptions(SfxItemSet &rSet)
case FN_VLINEAL:
aBool.SetValue( 0 != StatVLineal() ); break;
case FN_HSCROLLBAR:
- if(bBrowse)
+ if( pOpt->getBrowseMode() )
{
rSet.DisableItem(nWhich);
nWhich = 0;
@@ -283,7 +333,7 @@ void SwView::StateViewOptions(SfxItemSet &rSet)
aBool.SetValue( pOpt->IsOnlineSpell() );
break;
case FN_SHADOWCURSOR:
- if (pIDSA == 0 || pIDSA->get( IDocumentSettingAccess::BROWSE_MODE ))
+ if (pIDSA == 0 || pOpt->getBrowseMode() )
{
rSet.DisableItem( nWhich );
nWhich = 0;
@@ -313,6 +363,7 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
int eState = STATE_TOGGLE;
sal_Bool bSet = sal_False;
+ bool bBrowseModeChanged = false;
const SfxItemSet *pArgs = rReq.GetArgs();
sal_uInt16 nSlot = rReq.GetSlot();
@@ -369,6 +420,19 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
pOpt->SetCrossHair( bFlag );
break;
+ case SID_BROWSER_MODE:
+ case FN_PRINT_LAYOUT:
+ if( STATE_TOGGLE == eState )
+ bFlag = !pOpt->getBrowseMode();
+ else if( nSlot == FN_PRINT_LAYOUT )
+ bFlag = !bFlag;
+ bBrowseModeChanged = bFlag != pOpt->getBrowseMode();
+ // Disable "multiple layout"
+ GetDocShell()->ToggleBrowserMode( bFlag, this );
+
+ pOpt->setBrowseMode( bFlag );
+ break;
+
case FN_VIEW_NOTES:
if ( STATE_TOGGLE == eState )
bFlag = !pOpt->IsPostIts();
@@ -497,6 +561,11 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
if( !(*rSh.GetViewOptions() == *pOpt ))
{
rSh.ApplyViewOptions( *pOpt );
+ if( bBrowseModeChanged )
+ {
+ RecheckBrowseMode();
+ CheckVisArea();
+ }
//Die UsrPref muessen als Modified gekennzeichnet werden.
//call for initialization
@@ -517,6 +586,8 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
const sal_Bool bLockedView = rSh.IsViewLocked();
rSh.LockView( sal_True ); //lock visible section
GetWrtShell().EndAction();
+ if( bBrowseModeChanged && !bFlag )
+ CalcVisArea( GetEditWin().GetOutputSizePixel() );
rSh.LockView( bLockedView );
delete pOpt;
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index 400d878df6af..358233107f5f 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -1216,8 +1216,9 @@ void SwView::StateStatusLine(SfxItemSet &rSet)
{
const SwViewOption* pVOpt = rShell.GetViewOptions();
SvxZoomType eZoom = (SvxZoomType) pVOpt->GetZoomType();
- SvxZoomItem aZoom(eZoom, pVOpt->GetZoom());
- if(pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE))
+ SvxZoomItem aZoom(eZoom,
+ pVOpt->GetZoom());
+ if( pVOpt->getBrowseMode() )
{
aZoom.SetValueSet(
SVX_ZOOM_ENABLE_50|
@@ -1516,7 +1517,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq)
SfxItemSet aCoreSet(pShell->GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM, SID_ATTR_VIEWLAYOUT, SID_ATTR_VIEWLAYOUT, 0 );
SvxZoomItem aZoom( (SvxZoomType)rViewOptions.GetZoomType(), rViewOptions.GetZoom() );
- const bool bBrowseMode = rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const bool bBrowseMode = rSh.GetViewOptions()->getBrowseMode();
if( bBrowseMode )
{
aZoom.SetValueSet(
diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx
index edbb2ef5f4dc..656fe9121487 100644
--- a/sw/source/ui/uiview/viewport.cxx
+++ b/sw/source/ui/uiview/viewport.cxx
@@ -67,7 +67,7 @@ static sal_uInt16 nPgNum = 0;
sal_Bool SwView::IsDocumentBorder()
{
return GetDocShell()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ||
- pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) ||
+ pWrtShell->GetViewOptions()->getBrowseMode() ||
SVX_ZOOM_PAGEWIDTH_NOBORDER == (SvxZoomType)pWrtShell->GetViewOptions()->GetZoomType();
}
@@ -181,7 +181,7 @@ aDocSz = rSz;
//Wenn Text geloescht worden ist, kann es sein, dass die VisArea hinter
//den sichtbaren Bereich verweist
Rectangle aNewVisArea( aVisArea );
- sal_Bool bModified = false;
+ bool bModified = false;
SwTwips lGreenOffset = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER * 2;
SwTwips lTmp = aDocSz.Width() + lGreenOffset;
@@ -190,7 +190,7 @@ aDocSz = rSz;
lTmp = aNewVisArea.Right() - lTmp;
aNewVisArea.Right() -= lTmp;
aNewVisArea.Left() -= lTmp;
- bModified = sal_True;
+ bModified = true;
}
lTmp = aDocSz.Height() + lGreenOffset;
@@ -199,7 +199,7 @@ aDocSz = rSz;
lTmp = aNewVisArea.Bottom() - lTmp;
aNewVisArea.Bottom() -= lTmp;
aNewVisArea.Top() -= lTmp;
- bModified = sal_True;
+ bModified = true;
}
if ( bModified )
@@ -336,7 +336,7 @@ void SwView::SetVisArea( const Point &rPt, sal_Bool bUpdateScrollbar )
void SwView::CheckVisArea()
{
- pHScrollbar->SetAuto( pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ pHScrollbar->SetAuto( pWrtShell->GetViewOptions()->getBrowseMode() &&
!GetViewFrame()->GetFrame().IsInPlace() );
if ( IsDocumentBorder() )
{
@@ -683,7 +683,7 @@ IMPL_LINK( SwView, ScrollHdl, SwScrollbar *, pScrollbar )
if ( pScrollbar->GetType() == SCROLL_DRAG )
pWrtShell->EnableSmooth( sal_False );
- if(!pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) &&
+ if(!pWrtShell->GetViewOptions()->getBrowseMode() &&
pScrollbar->GetType() == SCROLL_DRAG)
{
//Hier wieder auskommentieren wenn das mitscrollen nicht gewuenscht ist.
@@ -842,7 +842,7 @@ void SwView::CalcAndSetBorderPixel( SvBorder &rToFill, sal_Bool /*bInner*/ )
}
//#i32913# in browse mode the visibility of the horizontal scrollbar
// depends on the content (fixed width tables may require a scrollbar)
- if ( pHScrollbar->IsVisible(pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE)) )
+ if ( pHScrollbar->IsVisible(pWrtShell->GetViewOptions()->getBrowseMode()) )
rToFill.Bottom() = nTmp;
SetBorderPixel( rToFill );
@@ -1078,7 +1078,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize )
bInOuterResizePixel = sal_True;
// feststellen, ob Scrollbars angezeigt werden duerfen
- sal_Bool bBrowse = pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ sal_Bool bBrowse = pWrtShell->GetViewOptions()->getBrowseMode();
sal_Bool bShowH = sal_False,
bShowV = sal_False,
bAuto = sal_False,
@@ -1172,7 +1172,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize )
pDocSh->SetVisArea(
pDocSh->SfxInPlaceObject::GetVisArea() );*/
if ( pWrtShell->GetViewOptions()->GetZoomType() != SVX_ZOOM_PERCENT &&
- !pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ !pWrtShell->GetViewOptions()->getBrowseMode() )
_SetZoom( aEditSz, (SvxZoomType)pWrtShell->GetViewOptions()->GetZoomType(), 100, sal_True );
pWrtShell->EndAction();
@@ -1230,7 +1230,7 @@ void SwView::SetZoomFactor( const Fraction &rX, const Fraction &rY )
Size SwView::GetOptimalSizePixel() const
{
Size aPgSize;
- if ( pWrtShell->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
+ if ( pWrtShell->GetViewOptions()->getBrowseMode() )
aPgSize = SvxPaperInfo::GetPaperSize(PAPER_A4);
else
{
diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx
index 2636015dc9c1..a99fa09c968d 100644
--- a/sw/source/ui/uiview/viewtab.cxx
+++ b/sw/source/ui/uiview/viewtab.cxx
@@ -260,9 +260,8 @@ void SwView::ExecTabWin( SfxRequest& rReq )
const sal_uInt16 nFrmType = rSh.IsObjSelected() ?
FRMTYPE_DRAWOBJ :
rSh.GetFrmType(0,sal_True);
- const sal_Bool bFrmSelection = rSh.IsFrmSelected();
- const sal_Bool bBrowse = rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
-
+ const sal_Bool bFrmSelection = rSh.IsFrmSelected();
+ const sal_Bool bBrowse = rSh.GetViewOptions()->getBrowseMode();
const sal_uInt16 nSlot = rReq.GetSlot();
const sal_uInt16 nDescId = rSh.GetCurPageDesc();
@@ -882,8 +881,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
: rSh.GetFrmType( pPt, sal_True );
const sal_Bool bFrmSelection = rSh.IsFrmSelected();
-
- const sal_Bool bBrowse = rSh.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ const sal_Bool bBrowse = rSh.GetViewOptions()->getBrowseMode();
// PageOffset/Begrenzer
const SwRect& rPageRect = rSh.GetAnyCurRect( RECT_PAGE, pPt );
const SwRect& rPagePrtRect = rSh.GetAnyCurRect( RECT_PAGE_PRT, pPt );
diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx
index af6a9ebe0013..6e967708db28 100644
--- a/sw/source/ui/uno/unomod.cxx
+++ b/sw/source/ui/uno/unomod.cxx
@@ -742,8 +742,13 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c
break;
case HANDLE_VIEWSET_ONLINE_LAYOUT :
{
- if( pView && !bVal != !pView->GetWrtShell().getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE) )
- pView->GetDocShell()->ToggleBrowserMode(bVal, pView );
+ if( pView && !bVal != !pView->GetWrtShell().GetViewOptions()->getBrowseMode() )
+ {
+ SwViewOption aOpt( *pView->GetWrtShell().GetViewOptions() );
+ aOpt.setBrowseMode( bVal );
+ pView->GetWrtShell().ApplyViewOptions( aOpt );
+ pView->RecheckBrowseMode();
+ }
}
break;
case HANDLE_VIEWSET_HELP_URL :
@@ -930,7 +935,7 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u
break;
case HANDLE_VIEWSET_ONLINE_LAYOUT:
if(pView)
- bBoolVal = pView->GetWrtShell().getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
+ bBoolVal = pView->GetWrtShell().GetViewOptions()->getBrowseMode();
break;
case HANDLE_VIEWSET_HELP_URL :
{
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index 6a81a4119d0b..d1f8c5eba6cb 100644..100755
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -2209,10 +2209,10 @@ void SwXTextDocument::refresh(void) throw( RuntimeException )
SolarMutexGuard aGuard;
if(!IsValid())
throw RuntimeException();
- SwWrtShell *pWrtShell = pDocShell->GetWrtShell();
+ ViewShell *pViewShell = pDocShell->GetWrtShell();
notifyRefreshListeners();
- if(pWrtShell)
- pWrtShell->CalcLayout();
+ if(pViewShell)
+ pViewShell->CalcLayout();
}
void SwXTextDocument::addRefreshListener(const Reference< util::XRefreshListener > & l)
@@ -2502,42 +2502,59 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
else
{
SwDocShell *pRenderDocShell = pDoc->GetDocShell();
- SwWrtShell *pWrtShell = pRenderDocShell->GetWrtShell();
- if (bFormat)
+
+ // TODO/mba: we really need a generic way to get the ViewShell!
+ ViewShell* pViewShell = 0;
+ SwView* pSwView = PTR_CAST(SwView, pView);
+ if ( pSwView )
{
- // #i38289
- if(pDoc->get(IDocumentSettingAccess::BROWSE_MODE))
+ pViewShell = pSwView->GetWrtShellPtr();
+ }
+ else
+ {
+ if ( bIsPDFExport && bFormat )
{
- pRenderDocShell->ToggleBrowserMode(false,NULL);
+ //create a hidden view to be able to export as PDF also in print preview
+ //pView and pSwView are not changed intentionally!
+ m_pHiddenViewFrame = SfxViewFrame::LoadHiddenDocument( *pRenderDocShell, 2 );
+ pViewShell = ((SwView*)m_pHiddenViewFrame->GetViewShell())->GetWrtShellPtr();
}
+ else
+ pViewShell = ((SwPagePreView*)pView)->GetViewShell();
+ }
+
+ if (!pViewShell || !pViewShell->GetLayout())
+ return 0;
- if (!pWrtShell)
+ if (bFormat)
+ {
+ // #i38289
+ if( pViewShell->GetViewOptions()->getBrowseMode() )
{
- //create a hidden view to be able to export as PDF also in print preview
- m_pHiddenViewFrame = SfxViewFrame::LoadHiddenDocument( *pRenderDocShell, 2 );
- SwView* pSwView = (SwView*) m_pHiddenViewFrame->GetViewShell();
- pWrtShell = pSwView->GetWrtShellPtr();
+ SwViewOption aOpt( *pViewShell->GetViewOptions() );
+ aOpt.setBrowseMode( false );
+ pViewShell->ApplyViewOptions( aOpt );
+ pSwView->RecheckBrowseMode();
}
// reformating the document for printing will show the changes in the view
// which is likely to produce many unwanted and not nice to view actions.
// We don't want that! Thus we disable updating of the view.
- pWrtShell->StartAction();
+ pViewShell->StartAction();
- const TypeId aSwViewTypeId = TYPE(SwView);
- if (pView->IsA(aSwViewTypeId))
+ if (pSwView)
{
- if (m_pRenderData && m_pRenderData->NeedNewViewOptionAdjust( *pWrtShell ) )
+ if (m_pRenderData && m_pRenderData->NeedNewViewOptionAdjust( *pViewShell ) )
m_pRenderData->ViewOptionAdjustStop();
if (m_pRenderData && !m_pRenderData->IsViewOptionAdjust())
- m_pRenderData->ViewOptionAdjustStart( *pWrtShell, *pWrtShell->GetViewOptions() );
+ m_pRenderData->ViewOptionAdjustStart( *pViewShell, *pViewShell->GetViewOptions() );
}
m_pRenderData->SetSwPrtOptions( new SwPrintData );
m_pRenderData->MakeSwPrtOptions( m_pRenderData->GetSwPrtOptionsRef(), pRenderDocShell,
m_pPrintUIOptions, m_pRenderData, bIsPDFExport );
- if (pView->IsA(aSwViewTypeId))
+ if (pSwView)
{
// PDF export should not make use of the SwPrtOptions
const SwPrintData *pPrtOptions = (bIsPDFExport)
@@ -2547,7 +2564,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
// since printing now also use the API for PDF export this option
// should be set for printing as well ...
- pWrtShell->SetPDFExportOption( sal_True );
+ pViewShell->SetPDFExportOption( sal_True );
bool bOrigStatus = pRenderDocShell->IsEnableSetModified();
// check configuration: shall update of printing information in DocInfo set the document to "modified"?
bool bStateChanged = false;
@@ -2557,9 +2574,8 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
bStateChanged = true;
}
-
// --> FME 2005-05-23 #122919# Force field update before PDF export:
- pWrtShell->ViewShell::UpdateFlds(sal_True);
+ pViewShell->ViewShell::UpdateFlds(sal_True);
// <--
if( bStateChanged )
pRenderDocShell->EnableSetModified( sal_True );
@@ -2567,17 +2583,16 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
// there is some redundancy between those two function calls, but right now
// there is no time to sort this out.
//TODO: check what exatly needs to be done and make just one function for that
- pWrtShell->CalcLayout();
- pWrtShell->CalcPagesForPrint( pDoc->GetPageCount() );
-
- pWrtShell->SetPDFExportOption( sal_False );
+ pViewShell->CalcLayout();
+ pViewShell->CalcPagesForPrint( pViewShell->GetPageCount() );
+ pViewShell->SetPDFExportOption( sal_False );
// enable view again
- pWrtShell->EndAction();
+ pViewShell->EndAction();
}
- const sal_Int32 nPageCount = pDoc->GetPageCount();
+ const sal_Int32 nPageCount = pViewShell->GetPageCount();
//
// get number of pages to be rendered
@@ -2585,7 +2600,7 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
const bool bPrintProspect = m_pPrintUIOptions->getBoolValue( "PrintProspect", false );
if (bPrintProspect)
{
- pDoc->CalculatePagePairsForProspectPrinting( *m_pRenderData, *m_pPrintUIOptions, nPageCount );
+ pDoc->CalculatePagePairsForProspectPrinting( *pViewShell->GetLayout(), *m_pRenderData, *m_pPrintUIOptions, nPageCount );
nRet = m_pRenderData->GetPagePairsForProspectPrinting().size();
}
else
@@ -2594,12 +2609,12 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
if (nPostItMode != POSTITS_NONE)
{
OutputDevice *pOutDev = lcl_GetOutputDevice( *m_pPrintUIOptions );
- m_pRenderData->CreatePostItData( pDoc, pWrtShell->GetViewOptions(), pOutDev );
+ m_pRenderData->CreatePostItData( pDoc, pViewShell->GetViewOptions(), pOutDev );
}
// get set of valid document pages (according to the current settings)
// and their start frames
- pDoc->CalculatePagesForPrinting( *m_pRenderData, *m_pPrintUIOptions, bIsPDFExport, nPageCount );
+ pDoc->CalculatePagesForPrinting( *pViewShell->GetLayout(), *m_pRenderData, *m_pPrintUIOptions, bIsPDFExport, nPageCount );
if (nPostItMode != POSTITS_NONE)
{
@@ -2653,6 +2668,15 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
// Thus instead of throwing the exception we silently return.
if (0 > nRenderer)
throw IllegalArgumentException();
+
+ // TODO/mba: we really need a generic way to get the ViewShell!
+ ViewShell* pVwSh = 0;
+ SwView* pSwView = PTR_CAST(SwView, pView);
+ if ( pSwView )
+ pVwSh = pSwView->GetWrtShellPtr();
+ else
+ pVwSh = ((SwPagePreView*)pView)->GetViewShell();
+
sal_Int32 nMaxRenderer = 0;
if (!bIsSwSrcView && m_pRenderData)
{
@@ -2721,7 +2745,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
// we just state what output size we would need
// which may cause vcl to set that page size on the printer
// (if available and not overriden by the user)
- aTmpSize = pDoc->GetPageSize( nPage, bIsSkipEmptyPages );
+ aTmpSize = pVwSh->GetPageSize( nPage, bIsSkipEmptyPages );
aPreferredPageSize = awt::Size ( TWIP_TO_MM100( 2 * aTmpSize.Width() ),
TWIP_TO_MM100( aTmpSize.Height() ));
}
@@ -2743,7 +2767,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextDocument::getRenderer(
}
else
{
- aTmpSize = pDoc->GetPageSize( nPage, bIsSkipEmptyPages );
+ aTmpSize = pVwSh->GetPageSize( nPage, bIsSkipEmptyPages );
aPageSize = awt::Size ( TWIP_TO_MM100( aTmpSize.Width() ),
TWIP_TO_MM100( aTmpSize.Height() ));
}
@@ -2876,9 +2900,12 @@ void SAL_CALL SwXTextDocument::render(
ViewShell* pVwSh = 0;
if (pView)
{
- pVwSh = pView->IsA(aSwViewTypeId) ?
- ((SwView*)pView)->GetWrtShellPtr() :
- ((SwPagePreView*)pView)->GetViewShell();
+ // TODO/mba: we really need a generic way to get the ViewShell!
+ SwView* pSwView = PTR_CAST(SwView, pView);
+ if ( pSwView )
+ pVwSh = pSwView->GetWrtShellPtr();
+ else
+ pVwSh = ((SwPagePreView*)pView)->GetViewShell();
}
// get output device to use
@@ -3136,7 +3163,7 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages(
}
}
- //get languages from "drawobject"
+ //TODO/mba: it's a strange concept that a view is needed to retrieve core data
SwWrtShell *pWrtSh = pDocShell->GetWrtShell();
SdrView *pSdrView = pWrtSh->GetDrawView();
@@ -3807,7 +3834,7 @@ void SwXDocumentPropertyHelper::onChange()
m_pDoc->SetModified();
}
-SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( SwWrtShell& rSh, const SwViewOption &rViewOptions ) :
+SwViewOptionAdjust_Impl::SwViewOptionAdjust_Impl( ViewShell& rSh, const SwViewOption &rViewOptions ) :
m_rShell( rSh ),
m_aOldViewOptions( rViewOptions )
{
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx
index 3340bc98c971..c80ff0e15fdd 100644..100755
--- a/sw/source/ui/uno/unotxvw.cxx
+++ b/sw/source/ui/uno/unotxvw.cxx
@@ -82,7 +82,7 @@
#include <unocrsrhelper.hxx>
#include <unotextrange.hxx>
#include <sfx2/docfile.hxx>
-
+#include <switerator.hxx>
#include "swdtflvr.hxx"
#include <vcl/svapp.hxx>
@@ -399,8 +399,8 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg
{
rSh.EnterStdMode();
rSh.GotoMark(pMark);
+ return sal_True;
}
- return sal_True;
}
// IndexMark, Index, TextField, Draw, Section, Footnote, Paragraph
//
@@ -549,9 +549,7 @@ uno::Any SwXTextView::getSelection(void) throw( uno::RuntimeException )
const SwFrmFmt* pFmt = rSh.GetFlyFrmFmt();
if (pFmt)
{
- SwXFrame* pxFrame = (SwXFrame*)SwClientIter((SwFrmFmt&)*pFmt).
- First(TYPE(SwXFrame));
-
+ SwXFrame* pxFrame = SwIterator<SwXFrame,SwFmt>::FirstElement(*pFmt);
if(pxFrame) //das einzige gemeinsame interface fuer alle Frames
{
aRef = uno::Reference< uno::XInterface >((cppu::OWeakObject*)pxFrame, uno::UNO_QUERY);
@@ -991,7 +989,7 @@ uno::Any SAL_CALL SwXTextView::getPropertyValue(
sal_Int32 nCount = -1;
if (nWID == WID_PAGE_COUNT)
- nCount = m_pView->GetDocShell()->GetDoc()->GetPageCount();
+ nCount = m_pView->GetWrtShell().GetPageCount();
else // WID_LINE_COUNT
nCount = m_pView->GetWrtShell().GetLineCount( sal_False /*of whole document*/ );
aRet <<= nCount;
diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx
index 20ef695485bc..1d0e41882528 100644
--- a/sw/source/ui/utlui/navipi.cxx
+++ b/sw/source/ui/utlui/navipi.cxx
@@ -750,8 +750,10 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings,
&aContentToolBox, SW_RES(NF_PAGE ));
pEdit->SetActionHdl(LINK(this, SwNavigationPI, EditAction));
pEdit->SetGetFocusHdl(LINK(this, SwNavigationPI, EditGetFocus));
- pEdit->SetModifyHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
pEdit->SetAccessibleName(pEdit->GetQuickHelpText());
+ pEdit->SetUpHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
+ pEdit->SetDownHdl(LINK(this, SwNavigationPI, PageEditModifyHdl));
+
bPageCtrlsVisible = sal_True;
//doppelte Separatoren sind nicht erlaubt, also muss
diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx
index 81a202107b4b..bef821dff6df 100644
--- a/sw/source/ui/utlui/uitool.cxx
+++ b/sw/source/ui/utlui/uitool.cxx
@@ -524,7 +524,7 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet )
SwPageDesc* pDesc = ((SwWrtShell&)rShell).FindPageDescByName(
rDescName, sal_True );
if( pDesc )
- pDesc->Add( &aPgDesc );
+ aPgDesc.RegisterToPageDesc( *pDesc );
}
rSet.ClearItem( SID_ATTR_PARA_MODEL );
bChanged = sal_True;
@@ -537,7 +537,7 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet )
{
if( ((SwFmtPageDesc*)pItem)->GetPageDesc() )
{
- ((SwFmtPageDesc*)pItem)->GetPageDesc()->Add(&aPgDesc);
+ aPgDesc.RegisterToPageDesc( *((SwFmtPageDesc*)pItem)->GetPageDesc() );
}
}
}
diff --git a/sw/source/ui/vba/vbainformationhelper.cxx b/sw/source/ui/vba/vbainformationhelper.cxx
index e46f62961541..51fb2b7f9f3a 100644
--- a/sw/source/ui/vba/vbainformationhelper.cxx
+++ b/sw/source/ui/vba/vbainformationhelper.cxx
@@ -33,6 +33,7 @@
#include <doc.hxx>
#include <vbahelper/vbahelper.hxx>
#include <swtypes.hxx>
+#include <viewsh.hxx>
using namespace ::ooo::vba;
using namespace ::com::sun::star;
@@ -59,7 +60,9 @@ double SwVbaInformationHelper::handleWdVerticalPositionRelativeToPage( const css
sal_Int32 nCurrentPos = xTVCursor->getPosition().Y;
sal_Int32 nCurrentPage = handleWdActiveEndPageNumber( xTVCursor );
- sal_Int32 nPageHeight = word::getDocShell( xModel )->GetDoc()->GetPageSize( nCurrentPage, sal_False ).Height();
+ SwDoc* pDoc = word::getDocShell( xModel )->GetDoc();
+ ViewShell* pViewSh = pDoc->GetCurrentViewShell();
+ sal_Int32 nPageHeight = pViewSh ? pViewSh->GetPageSize( nCurrentPage, sal_False ).Height() : 0;
// FIXME: handle multipul page style
// it is very strange that the curros position is incorrect when open Word file.
// e.g. if current cursor in the top left of the text body of the first page without header,
diff --git a/sw/source/ui/vba/wordvbahelper.cxx b/sw/source/ui/vba/wordvbahelper.cxx
index aa63b8b21712..fa1f5092c88d 100644
--- a/sw/source/ui/vba/wordvbahelper.cxx
+++ b/sw/source/ui/vba/wordvbahelper.cxx
@@ -40,6 +40,7 @@
#include <unotxdoc.hxx>
#include <doc.hxx>
#include <view.hxx>
+#include <viewsh.hxx>
using namespace ::com::sun::star;
using namespace ::ooo::vba;
@@ -95,7 +96,8 @@ uno::Reference< style::XStyle > getCurrentPageStyle( const uno::Reference< frame
sal_Int32 getPageCount( const uno::Reference< frame::XModel>& xModel ) throw (uno::RuntimeException)
{
SwDocShell* pDocShell = getDocShell( xModel );
- return pDocShell ? pDocShell->GetDoc()->GetPageCount() : 0;
+ ViewShell* pViewSh = pDocShell ? pDocShell->GetDoc()->GetCurrentViewShell() : 0;
+ return pViewSh ? pViewSh->GetPageCount() : 0;
}
uno::Reference< style::XStyle > getDefaultParagraphStyle( const uno::Reference< frame::XModel >& xModel ) throw (uno::RuntimeException)
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index efa944a9e70f..b1786c42108f 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -97,6 +97,7 @@
#include <ndtxt.hxx>
#include <editeng/acorrcfg.hxx>
#include <IMark.hxx>
+#include <sfx2/bindings.hxx>
// -> #111827#
#include <SwRewriter.hxx>
@@ -1247,6 +1248,9 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
}
aFmt.SetBulletChar( numfunc::GetBulletChar(static_cast<sal_uInt8>(nLevel)));
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
+ // #i93908# clear suffix for bullet lists
+ aFmt.SetPrefix(::rtl::OUString());
+ aFmt.SetSuffix(::rtl::OUString());
}
aNumRule.Set(static_cast<sal_uInt16>(nLevel), aFmt);
}
@@ -1304,6 +1308,9 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
}
aFmt.SetBulletChar( numfunc::GetBulletChar(nLvl) );
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
+ // #i93908# clear suffix for bullet lists
+ aFmt.SetPrefix(::rtl::OUString());
+ aFmt.SetSuffix(::rtl::OUString());
}
// --> OD 2009-08-26 #i95907#
@@ -1819,4 +1826,12 @@ String SwWrtShell::GetSelDescr() const
return aResult;
}
+void SwWrtShell::ApplyViewOptions( const SwViewOption &rOpt )
+{
+ SwFEShell::ApplyViewOptions( rOpt );
+ //#i115062# invalidate meta character slot
+ GetView().GetViewFrame()->GetBindings().Invalidate( FN_VIEW_META_CHARS );
+}
+
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */