Update ooo320-m1
[ooovba.git] / applied_patches / 0165-calc-jump-on-formula-ref-sfx2.diff
blob395b0ee57136d9f0a7c1e133b1d8a53e6a7b570d
1 diff --git sfx2/source/appl/appopen.cxx sfx2/source/appl/appopen.cxx
2 index b8b5222..ce90cf7 100644
3 --- sfx2/source/appl/appopen.cxx
4 +++ sfx2/source/appl/appopen.cxx
5 @@ -841,6 +841,29 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq )
7 //---------------------------------------------------------------------------
9 +namespace {
11 +/**
12 + * Check if a given filter type should open the hyperlinked document
13 + * natively.
14 + *
15 + * @param rFilter filter object
16 + */
17 +bool lcl_isFilterNativelySupported(const SfxFilter& rFilter)
19 + if (rFilter.IsOwnFormat())
20 + return true;
22 + ::rtl::OUString aName = rFilter.GetFilterName();
23 + if (aName.indexOf(::rtl::OUString::createFromAscii("MS Excel")) == 0)
24 + // We can handle all Excel variants natively.
25 + return true;
27 + return false;
32 void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
34 DBG_MEMTEST();
35 @@ -1150,7 +1150,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
36 aTypeName = xTypeDetection->queryTypeByURL( aURL.Main );
37 SfxFilterMatcher& rMatcher = SFX_APP()->GetFilterMatcher();
38 const SfxFilter* pFilter = rMatcher.GetFilter4EA( aTypeName );
39 - if ( !pFilter || !( pFilter->IsOwnFormat() ))
40 + if (!pFilter || !lcl_isFilterNativelySupported(*pFilter))
42 // hyperlink does not link to own type => special handling (http, ftp) browser and (other external protocols) OS
43 Reference< XSystemShellExecute > xSystemShellExecute( ::comphelper::getProcessServiceFactory()->createInstance(
44 diff --git sfx2/source/view/topfrm.cxx sfx2/source/view/topfrm.cxx
45 index db1b3a2..921696e 100644
46 --- sfx2/source/view/topfrm.cxx
47 +++ sfx2/source/view/topfrm.cxx
48 @@ -913,26 +913,6 @@ sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc )
49 if ( pMarkItem )
50 aMark = pMarkItem->GetValue();
52 - if ( pDoc->Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT )
53 - {
54 - if ( pViewDataItem )
55 - pFrame->GetViewShell()->ReadUserData( pViewDataItem->GetValue(), sal_True );
56 - else if( aMark.Len() )
57 - GetCurrentViewFrame()->GetViewShell()->JumpToMark( aMark );
58 - }
59 - else
60 - {
61 - // Daten setzen, die in FinishedLoading ausgewertet werden
62 - MarkData_Impl*& rpMark = pDoc->Get_Impl()->pMarkData;
63 - if (!rpMark)
64 - rpMark = new MarkData_Impl;
65 - rpMark->pFrame = GetCurrentViewFrame();
66 - if ( pViewDataItem )
67 - rpMark->aUserData = pViewDataItem->GetValue();
68 - else
69 - rpMark->aMark = aMark;
70 - }
72 // Position und Groesse setzen
73 //sal_uInt16 nWinMode = pModeItem ? pModeItem->GetValue() : 1;
74 if ( pAreaItem && !pOld )
75 @@ -1000,6 +980,26 @@ sal_Bool SfxTopFrame::InsertDocument( SfxObjectShell* pDoc )
76 GetWindow().Show();
79 + if ( pDoc->Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT )
80 + {
81 + if ( pViewDataItem )
82 + pFrame->GetViewShell()->ReadUserData( pViewDataItem->GetValue(), sal_True );
83 + else if( aMark.Len() )
84 + GetCurrentViewFrame()->GetViewShell()->JumpToMark( aMark );
85 + }
86 + else
87 + {
88 + // Daten setzen, die in FinishedLoading ausgewertet werden
89 + MarkData_Impl*& rpMark = pDoc->Get_Impl()->pMarkData;
90 + if (!rpMark)
91 + rpMark = new MarkData_Impl;
92 + rpMark->pFrame = GetCurrentViewFrame();
93 + if ( pViewDataItem )
94 + rpMark->aUserData = pViewDataItem->GetValue();
95 + else
96 + rpMark->aMark = aMark;
97 + }
99 // Jetzt UpdateTitle, hidden TopFrames haben sonst keinen Namen!
100 pFrame->UpdateTitle();