Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
0ab6b1fc
Kaydet (Commit)
0ab6b1fc
authored
Kas 12, 2015
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw: shove 2 global variables into SwHyphIter
Change-Id: I0cb6112b0353a5fd0b4dd571d65f2d656e39ba74
üst
655248f1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
16 deletions
+41
-16
splargs.hxx
sw/inc/splargs.hxx
+12
-1
edlingu.cxx
sw/source/core/edit/edlingu.cxx
+23
-9
txtedt.cxx
sw/source/core/txtnode/txtedt.cxx
+6
-6
No files found.
sw/inc/splargs.hxx
Dosyayı görüntüle @
0ab6b1fc
...
@@ -22,12 +22,15 @@
...
@@ -22,12 +22,15 @@
#include <i18nlangtag/lang.h>
#include <i18nlangtag/lang.h>
#include <tools/solar.h>
#include <tools/solar.h>
#include <tools/gen.hxx>
#include <tools/gen.hxx>
#include <limits.h>
#include <com/sun/star/linguistic2/XSpellAlternatives.hpp>
#include <com/sun/star/linguistic2/XSpellAlternatives.hpp>
#include <com/sun/star/linguistic2/XSpellChecker1.hpp>
#include <com/sun/star/linguistic2/XSpellChecker1.hpp>
#include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
#include <com/sun/star/linguistic2/XHyphenatedWord.hpp>
#include <functional>
#include <limits.h>
class
SwTextFrm
;
class
SwTextNode
;
class
SwTextNode
;
class
SwIndex
;
class
SwIndex
;
namespace
vcl
{
class
Font
;
}
namespace
vcl
{
class
Font
;
}
...
@@ -152,6 +155,14 @@ public:
...
@@ -152,6 +155,14 @@ public:
}
}
};
};
namespace
sw
{
SwTextFrm
*
SwHyphIterCacheLastTxtFrm
(
SwTextNode
*
,
std
::
function
<
SwTextFrm
*
()
>
);
}
#endif
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sw/source/core/edit/edlingu.cxx
Dosyayı görüntüle @
0ab6b1fc
...
@@ -155,11 +155,16 @@ public:
...
@@ -155,11 +155,16 @@ public:
class
SwHyphIter
:
public
SwLinguIter
class
SwHyphIter
:
public
SwLinguIter
{
{
// With that we save a GetFrm() in Hyphenate //TODO: does it actually matter?
const
SwTextNode
*
m_pLastNode
;
SwTextFrm
*
m_pLastFrm
;
friend
SwTextFrm
*
sw
::
SwHyphIterCacheLastTxtFrm
(
SwTextNode
*
,
std
::
function
<
SwTextFrm
*
()
>
);
bool
bOldIdle
;
bool
bOldIdle
;
static
void
DelSoftHyph
(
SwPaM
&
rPam
);
static
void
DelSoftHyph
(
SwPaM
&
rPam
);
public
:
public
:
SwHyphIter
()
:
bOldIdle
(
false
)
{}
SwHyphIter
()
:
m_pLastNode
(
nullptr
),
m_pLastFrm
(
nullptr
),
bOldIdle
(
false
)
{}
void
Start
(
SwEditShell
*
pSh
,
SwDocPositions
eStart
,
SwDocPositions
eEnd
);
void
Start
(
SwEditShell
*
pSh
,
SwDocPositions
eStart
,
SwDocPositions
eEnd
);
void
End
();
void
End
();
...
@@ -177,11 +182,6 @@ static SwSpellIter* g_pSpellIter = nullptr;
...
@@ -177,11 +182,6 @@ static SwSpellIter* g_pSpellIter = nullptr;
static
SwConvIter
*
g_pConvIter
=
nullptr
;
static
SwConvIter
*
g_pConvIter
=
nullptr
;
static
SwHyphIter
*
g_pHyphIter
=
nullptr
;
static
SwHyphIter
*
g_pHyphIter
=
nullptr
;
// With that we save a GetFrm() in Hyphenate.
// Caution: There are external declaration to these pointers in txtedt.cxx!
const
SwTextNode
*
pLinguNode
;
SwTextFrm
*
pLinguFrm
;
SwLinguIter
::
SwLinguIter
()
SwLinguIter
::
SwLinguIter
()
:
pSh
(
nullptr
)
:
pSh
(
nullptr
)
,
pStart
(
nullptr
)
,
pStart
(
nullptr
)
...
@@ -249,9 +249,6 @@ void SwLinguIter::_Start( SwEditShell *pShell, SwDocPositions eStart,
...
@@ -249,9 +249,6 @@ void SwLinguIter::_Start( SwEditShell *pShell, SwDocPositions eStart,
}
}
pCrsr
->
SetMark
();
pCrsr
->
SetMark
();
pLinguFrm
=
nullptr
;
pLinguNode
=
nullptr
;
}
}
void
SwLinguIter
::
_End
(
bool
bRestoreSelection
)
void
SwLinguIter
::
_End
(
bool
bRestoreSelection
)
...
@@ -572,6 +569,23 @@ void SwHyphIter::InsertSoftHyph( const sal_Int32 nHyphPos )
...
@@ -572,6 +569,23 @@ void SwHyphIter::InsertSoftHyph( const sal_Int32 nHyphPos )
pCrsr
->
SetMark
();
pCrsr
->
SetMark
();
}
}
namespace
sw
{
SwTextFrm
*
SwHyphIterCacheLastTxtFrm
(
SwTextNode
*
const
pNode
,
std
::
function
<
SwTextFrm
*
()
>
const
create
)
{
assert
(
g_pHyphIter
);
if
(
pNode
!=
g_pHyphIter
->
m_pLastNode
||
!
g_pHyphIter
->
m_pLastFrm
)
{
g_pHyphIter
->
m_pLastNode
=
pNode
;
g_pHyphIter
->
m_pLastFrm
=
create
();
}
return
g_pHyphIter
->
m_pLastFrm
;
}
}
bool
SwEditShell
::
HasLastSentenceGotGrammarChecked
()
bool
SwEditShell
::
HasLastSentenceGotGrammarChecked
()
{
{
bool
bTextWasGrammarChecked
=
false
;
bool
bTextWasGrammarChecked
=
false
;
...
...
sw/source/core/txtnode/txtedt.cxx
Dosyayı görüntüle @
0ab6b1fc
...
@@ -1618,12 +1618,12 @@ bool SwTextNode::Hyphenate( SwInterHyphInfo &rHyphInf )
...
@@ -1618,12 +1618,12 @@ bool SwTextNode::Hyphenate( SwInterHyphInfo &rHyphInf )
return
false
;
return
false
;
}
}
if
(
pLinguNode
!=
this
)
SwTextFrm
*
pFrm
=
::
sw
::
SwHyphIterCacheLastTxtFrm
(
this
,
{
[
&
rHyphInf
,
this
]()
{
pLinguNode
=
this
;
return
static_cast
<
SwTextFrm
*>
(
this
->
getLayoutFrm
(
pLinguFrm
=
static_cast
<
SwTextFrm
*>
(
getLayoutFrm
(
GetDoc
()
->
getIDocumentLayoutAccess
().
GetCurrentLayout
(),
rHyphInf
.
GetCrsrPos
()
));
this
->
GetDoc
()
->
getIDocumentLayoutAccess
().
GetCurrentLayout
(),
}
rHyphInf
.
GetCrsrPos
()));
SwTextFrm
*
pFrm
=
pLinguFrm
;
})
;
if
(
pFrm
)
if
(
pFrm
)
pFrm
=
&
(
pFrm
->
GetFrmAtOfst
(
rHyphInf
.
nStart
));
pFrm
=
&
(
pFrm
->
GetFrmAtOfst
(
rHyphInf
.
nStart
));
else
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment