LibreOffice Module sw (master)  1
srcedtw.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <sal/config.h>
21 
22 #include <hintids.hxx>
23 #include <cmdid.h>
24 
25 #include <com/sun/star/beans/XMultiPropertySet.hpp>
26 #include <com/sun/star/beans/XPropertiesChangeListener.hpp>
27 #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
28 #include <cppuhelper/implbase.hxx>
29 #include <officecfg/Office/Common.hxx>
30 #include <rtl/ustring.hxx>
31 #include <sal/log.hxx>
32 #include <vcl/commandevent.hxx>
33 #include <vcl/event.hxx>
34 #include <vcl/svapp.hxx>
35 #include <vcl/textview.hxx>
36 #include <vcl/scrbar.hxx>
37 #include <vcl/ptrstyle.hxx>
38 #include <sfx2/dispatch.hxx>
39 #include <sfx2/viewfrm.hxx>
40 #include <svtools/htmltokn.h>
41 #include <vcl/txtattr.hxx>
42 #include <vcl/settings.hxx>
43 #include <svtools/colorcfg.hxx>
44 #include <editeng/flstitem.hxx>
45 #include <vcl/metric.hxx>
46 #include <svtools/ctrltool.hxx>
47 #include <tools/time.hxx>
48 #include <swmodule.hxx>
49 #include <docsh.hxx>
50 #include <srcview.hxx>
51 #include <helpids.h>
52 #include <vector>
53 
54 namespace
55 {
56 
57 struct TextPortion
58 {
59  sal_uInt16 nStart, nEnd;
61 };
62 
63 }
64 
65 #define MAX_SYNTAX_HIGHLIGHT 20
66 #define MAX_HIGHLIGHTTIME 200
67 
68 typedef std::vector<TextPortion> TextPortions;
69 
70 static void lcl_Highlight(const OUString& rSource, TextPortions& aPortionList)
71 {
72  const sal_Unicode cOpenBracket = '<';
73  const sal_Unicode cCloseBracket= '>';
74  const sal_Unicode cSlash = '/';
75  const sal_Unicode cExclamation = '!';
76  const sal_Unicode cMinus = '-';
77  const sal_Unicode cSpace = ' ';
78  const sal_Unicode cTab = 0x09;
79  const sal_Unicode cLF = 0x0a;
80  const sal_Unicode cCR = 0x0d;
81 
82  const sal_uInt16 nStrLen = rSource.getLength();
83  sal_uInt16 nInsert = 0; // number of inserted portions
84  sal_uInt16 nActPos = 0; // position, where '<' was found
85  sal_uInt16 nPortStart = USHRT_MAX; // for the TextPortion
86  sal_uInt16 nPortEnd = 0;
87  TextPortion aText;
88  while(nActPos < nStrLen)
89  {
90  if((nActPos < nStrLen - 2) && (rSource[nActPos] == cOpenBracket))
91  {
93  // insert 'empty' portion
94  if(nPortEnd < nActPos - 1 )
95  {
96  // don't move at the beginning
97  aText.nStart = nPortEnd;
98  if(nInsert)
99  aText.nStart += 1;
100  aText.nEnd = nActPos - 1;
101  aText.eType = svtools::HTMLUNKNOWN;
102  aPortionList.push_back( aText );
103  nInsert++;
104  }
105  sal_Unicode cFollowFirst = rSource[nActPos + 1];
106  sal_Unicode cFollowNext = rSource[nActPos + 2];
107  if(cExclamation == cFollowFirst)
108  {
109  // "<!" SGML or comment
110  if(cMinus == cFollowNext &&
111  nActPos < nStrLen - 3 && cMinus == rSource[nActPos + 3])
112  {
113  eFoundType = svtools::HTMLCOMMENT;
114  }
115  else
116  eFoundType = svtools::HTMLSGML;
117  nPortStart = nActPos;
118  nPortEnd = nActPos + 1;
119  }
120  else if(cSlash == cFollowFirst)
121  {
122  // "</" ignore slash
123  nPortStart = nActPos;
124  nActPos++;
125  }
126  if(svtools::HTMLUNKNOWN == eFoundType)
127  {
128  // now here a keyword could follow
129  sal_uInt16 nSrchPos = nActPos;
130  while(++nSrchPos < nStrLen - 1)
131  {
132  sal_Unicode cNext = rSource[nSrchPos];
133  if( cNext == cSpace ||
134  cNext == cTab ||
135  cNext == cLF ||
136  cNext == cCR)
137  break;
138  else if(cNext == cCloseBracket)
139  {
140  break;
141  }
142  }
143  if(nSrchPos > nActPos + 1)
144  {
145  // some string was found
146  OUString sToken = rSource.copy(nActPos + 1, nSrchPos - nActPos - 1 );
147  sToken = sToken.toAsciiUpperCase();
148  HtmlTokenId nToken = ::GetHTMLToken(sToken);
149  if(nToken != HtmlTokenId::NONE)
150  {
151  eFoundType = svtools::HTMLKEYWORD;
152  nPortEnd = nSrchPos;
153  nPortStart = nActPos;
154  }
155  else
156  SAL_WARN("sw", "HTML token " << sToken << " not recognised!");
157  }
158  }
159  // now we still have to look for '>'
160  if(svtools::HTMLUNKNOWN != eFoundType)
161  {
162  bool bFound = false;
163  for(sal_uInt16 i = nPortEnd; i < nStrLen; i++)
164  if(cCloseBracket == rSource[i])
165  {
166  bFound = true;
167  nPortEnd = i;
168  break;
169  }
170  if(!bFound && (eFoundType == svtools::HTMLCOMMENT))
171  {
172  // comment without ending in this line
173  bFound = true;
174  nPortEnd = nStrLen - 1;
175  }
176 
177  if(bFound ||(eFoundType == svtools::HTMLCOMMENT))
178  {
179  TextPortion aTextPortion;
180  aTextPortion.nStart = nPortStart + 1;
181  aTextPortion.nEnd = nPortEnd;
182  aTextPortion.eType = eFoundType;
183  aPortionList.push_back( aTextPortion );
184  nInsert++;
185  }
186 
187  }
188  }
189  nActPos++;
190  }
191  if(nInsert && nPortEnd < nActPos - 1)
192  {
193  aText.nStart = nPortEnd + 1;
194  aText.nEnd = nActPos - 1;
195  aText.eType = svtools::HTMLUNKNOWN;
196  aPortionList.push_back( aText );
197  nInsert++;
198  }
199 }
200 
202  public cppu::WeakImplHelper< css::beans::XPropertiesChangeListener >
203 {
204 public:
205  explicit ChangesListener(SwSrcEditWindow & editor): m_Editor(editor) {}
206 
207 private:
208  virtual ~ChangesListener() override {}
209 
210  virtual void SAL_CALL disposing(css::lang::EventObject const &) override
211  {
212  std::unique_lock g(m_Editor.mutex_);
213  m_Editor.m_xNotifier.clear();
214  }
215 
216  virtual void SAL_CALL propertiesChange(
217  css::uno::Sequence< css::beans::PropertyChangeEvent > const &) override
218  {
219  SolarMutexGuard g;
220  m_Editor.SetFont();
221  }
222 
224 };
225 
227  Window( pParent, WB_BORDER|WB_CLIPCHILDREN ),
228 
229  m_pOutWin(nullptr),
230  m_pHScrollbar(nullptr),
231  m_pVScrollbar(nullptr),
232 
233  m_pSrcView(pParentView),
234 
235  m_nCurTextWidth(0),
236  m_nStartLine(USHRT_MAX),
237  m_eSourceEncoding(osl_getThreadTextEncoding()),
238  m_bReadonly(false),
239  m_bHighlighting(false),
240  m_aSyntaxIdle("sw uibase SwSrcEditWindow Syntax")
241 {
244 
245  // Using "this" in ctor is a little fishy, but should work here at least as
246  // long as there are no derivations:
247  m_xListener = new ChangesListener(*this);
248  css::uno::Reference< css::beans::XMultiPropertySet > n(
250  css::uno::UNO_QUERY_THROW);
251  {
252  std::unique_lock g(mutex_);
253  m_xNotifier = n;
254  }
255  n->addPropertiesChangeListener({ "FontHeight", "FontName" }, m_xListener);
256 }
257 
259 {
260  disposeOnce();
261 }
262 
264 {
265  css::uno::Reference< css::beans::XMultiPropertySet > n;
266  {
267  std::unique_lock g(mutex_);
268  n = m_xNotifier;
269  }
270  if (n.is()) {
271  n->removePropertiesChangeListener(m_xListener);
272  }
274  if ( m_pOutWin )
275  m_pOutWin->SetTextView( nullptr );
276 
277  if ( m_pTextEngine )
278  {
280  m_pTextEngine->RemoveView( m_pTextView.get() );
281 
282  m_pTextView.reset();
283  m_pTextEngine.reset();
284  }
289 }
290 
292 {
293  Window::DataChanged( rDCEvt );
294 
295  switch ( rDCEvt.GetType() )
296  {
297  case DataChangedEventType::SETTINGS:
298  // newly rearrange ScrollBars or trigger Resize, because
299  // ScrollBar size could have changed. For this, in the
300  // Resize handler the size of ScrollBars has to be queried
301  // from the settings as well.
302  if( rDCEvt.GetFlags() & AllSettingsFlags::STYLE )
303  Resize();
304  break;
305  default: break;
306  }
307 }
308 
310 {
311  // ScrollBars, etc. happens in Adjust...
312  if ( !m_pTextView )
313  return;
314 
315  tools::Long nVisY = m_pTextView->GetStartDocPos().Y();
316  m_pTextView->ShowCursor();
317  Size aOutSz( GetOutputSizePixel() );
318  tools::Long nMaxVisAreaStart = m_pTextView->GetTextEngine()->GetTextHeight() - aOutSz.Height();
319  if ( nMaxVisAreaStart < 0 )
320  nMaxVisAreaStart = 0;
321  if ( m_pTextView->GetStartDocPos().Y() > nMaxVisAreaStart )
322  {
323  Point aStartDocPos( m_pTextView->GetStartDocPos() );
324  aStartDocPos.setY( nMaxVisAreaStart );
325  m_pTextView->SetStartDocPos( aStartDocPos );
326  m_pTextView->ShowCursor();
327  }
329  Size aScrollSz(aOutSz.Width() - nScrollStd, nScrollStd );
330  Point aScrollPos(0, aOutSz.Height() - nScrollStd);
331 
332  m_pHScrollbar->SetPosSizePixel( aScrollPos, aScrollSz);
333 
334  aScrollSz.setWidth( aScrollSz.Height() );
335  aScrollSz.setHeight( aOutSz.Height() );
336  aScrollPos = Point(aOutSz.Width() - nScrollStd, 0);
337 
338  m_pVScrollbar->SetPosSizePixel( aScrollPos, aScrollSz);
339  aOutSz.AdjustWidth( -nScrollStd );
340  aOutSz.AdjustHeight( -nScrollStd );
341  m_pOutWin->SetOutputSizePixel(aOutSz);
342  InitScrollBars();
343 
344  // set line in first Resize
345  if(USHRT_MAX != m_nStartLine)
346  {
347  if(m_nStartLine < m_pTextEngine->GetParagraphCount())
348  {
350  m_pTextView->SetSelection(aSel);
351  m_pTextView->ShowCursor();
352  }
353  m_nStartLine = USHRT_MAX;
354  }
355 
356  if ( nVisY != m_pTextView->GetStartDocPos().Y() )
357  Invalidate();
358 
359 
360 }
361 
363 {
364  Window::DataChanged( rDCEvt );
365 
366  switch( rDCEvt.GetType() )
367  {
368  case DataChangedEventType::SETTINGS:
369  // query settings
370  if( rDCEvt.GetFlags() & AllSettingsFlags::STYLE )
371  {
372  const Color &rCol = GetSettings().GetStyleSettings().GetWindowColor();
373  SetBackground( rCol );
375  aFont.SetFillColor( rCol );
376  m_pTextView->GetTextEngine()->SetFont( aFont );
377  }
378  break;
379  default: break;
380  }
381 }
382 
384 {
385  if ( m_pTextView )
386  m_pTextView->MouseMove( rEvt );
387 }
388 
390 {
391  if ( m_pTextView )
392  {
393  m_pTextView->MouseButtonUp( rEvt );
394  SfxViewFrame *pFrame = static_cast<SwSrcEditWindow*>(GetParent())->GetSrcView()->GetViewFrame();
395  if ( pFrame )
396  {
397  SfxBindings& rBindings = pFrame->GetBindings();
398  rBindings.Invalidate( SID_TABLE_CELL );
399  rBindings.Invalidate( SID_CUT );
400  rBindings.Invalidate( SID_COPY );
401  }
402  }
403 }
404 
406 {
407  GrabFocus();
408  if ( m_pTextView )
409  m_pTextView->MouseButtonDown( rEvt );
410 }
411 
413 {
414  switch(rCEvt.GetCommand())
415  {
416  case CommandEventId::ContextMenu:
418  break;
419  case CommandEventId::Wheel:
420  case CommandEventId::StartAutoScroll:
421  case CommandEventId::AutoScroll:
422  {
423  const CommandWheelData* pWData = rCEvt.GetWheelData();
424  if( !pWData || CommandWheelMode::ZOOM != pWData->GetMode() )
425  {
426  static_cast<SwSrcEditWindow*>(GetParent())->HandleWheelCommand( rCEvt );
427  }
428  }
429  break;
430 
431  default:
432  if ( m_pTextView )
433  m_pTextView->Command( rCEvt );
434  else
435  Window::Command(rCEvt);
436  }
437 }
438 
439 void TextViewOutWin::KeyInput( const KeyEvent& rKEvt )
440 {
441  bool bDone = false;
442  SwSrcEditWindow* pSrcEditWin = static_cast<SwSrcEditWindow*>(GetParent());
443  bool bChange = !pSrcEditWin->IsReadonly() || !TextEngine::DoesKeyChangeText( rKEvt );
444  if(bChange)
445  bDone = m_pTextView->KeyInput( rKEvt );
446 
447  SfxBindings& rBindings = static_cast<SwSrcEditWindow*>(GetParent())->GetSrcView()->GetViewFrame()->GetBindings();
448  if ( !bDone )
449  {
450  if ( !SfxViewShell::Current()->KeyInput( rKEvt ) )
451  Window::KeyInput( rKEvt );
452  }
453  else
454  {
455  rBindings.Invalidate( SID_TABLE_CELL );
456  if ( rKEvt.GetKeyCode().GetGroup() == KEYGROUP_CURSOR )
457  rBindings.Update( SID_BASICIDE_STAT_POS );
458  if (pSrcEditWin->GetTextEngine()->IsModified() )
459  {
460  rBindings.Invalidate( SID_SAVEDOC );
461  rBindings.Invalidate( SID_DOC_MODIFIED );
462  }
463  if( rKEvt.GetKeyCode().GetCode() == KEY_INSERT )
464  rBindings.Invalidate( SID_ATTR_INSERT );
465  }
466 
467  rBindings.Invalidate( SID_CUT );
468  rBindings.Invalidate( SID_COPY );
469 
470  SwDocShell* pDocShell = pSrcEditWin->GetSrcView()->GetDocShell();
471  if(pSrcEditWin->GetTextEngine()->IsModified())
472  {
473  pDocShell->SetModified();
474  }
475 }
476 
477 void TextViewOutWin::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
478 {
479  m_pTextView->Paint(rRenderContext, rRect);
480 }
481 
483 {
484  // FIXME RenderContext
485 
486  const Color &rCol = GetSettings().GetStyleSettings().GetWindowColor();
489  m_pOutWin->SetPointer(PointerStyle::Text);
490  m_pOutWin->Show();
491 
492  // create Scrollbars
494  m_pHScrollbar->EnableRTL( false );
495  m_pHScrollbar->SetScrollHdl(LINK(this, SwSrcEditWindow, ScrollHdl));
496  m_pHScrollbar->Show();
497 
499  m_pVScrollbar->EnableRTL( false );
500  m_pVScrollbar->SetScrollHdl(LINK(this, SwSrcEditWindow, ScrollHdl));
502  m_pVScrollbar->Show();
503 
504  m_pTextEngine.reset(new ExtTextEngine);
505  m_pTextView.reset(new TextView( m_pTextEngine.get(), m_pOutWin ));
506  m_pTextView->SetAutoIndentMode(true);
508 
509  m_pTextEngine->SetUpdateMode( false );
510  m_pTextEngine->InsertView( m_pTextView.get() );
511 
512  vcl::Font aFont;
513  aFont.SetTransparent( false );
514  aFont.SetFillColor( rCol );
515  SetPointFont(*GetOutDev(), aFont);
516  aFont = GetFont();
517  aFont.SetFillColor( rCol );
518  m_pOutWin->SetFont( aFont );
519  m_pTextEngine->SetFont( aFont );
520 
521  m_aSyntaxIdle.SetInvokeHandler( LINK( this, SwSrcEditWindow, SyntaxTimerHdl ) );
522 
523  m_pTextEngine->EnableUndo( true );
524  m_pTextEngine->SetUpdateMode( true );
525 
526  m_pTextView->ShowCursor();
527  InitScrollBars();
529 
531  rBind.Invalidate( SID_TABLE_CELL );
532 }
533 
535 {
536  // Extra method, not InitScrollBars, because also for TextEngine events.
537 
539  m_pVScrollbar->SetRange( Range(0, m_pTextEngine->GetTextHeight()-1) );
540 }
541 
543 {
545 
546  Size aOutSz( m_pOutWin->GetOutputSizePixel() );
547  m_pVScrollbar->SetVisibleSize( aOutSz.Height() );
548  m_pVScrollbar->SetPageSize( aOutSz.Height() * 8 / 10 );
550  m_pVScrollbar->SetThumbPos( m_pTextView->GetStartDocPos().Y() );
551  m_pHScrollbar->SetVisibleSize( aOutSz.Width() );
552  m_pHScrollbar->SetPageSize( aOutSz.Width() * 8 / 10 );
553  m_pHScrollbar->SetLineSize( m_pOutWin->GetTextWidth(OUString('x')) );
554  m_pHScrollbar->SetThumbPos( m_pTextView->GetStartDocPos().X() );
555 
556 }
557 
558 IMPL_LINK(SwSrcEditWindow, ScrollHdl, ScrollBar*, pScroll, void)
559 {
560  if(pScroll == m_pVScrollbar)
561  {
562  tools::Long nDiff = m_pTextView->GetStartDocPos().Y() - pScroll->GetThumbPos();
563  GetTextView()->Scroll( 0, nDiff );
564  m_pTextView->ShowCursor( false );
565  pScroll->SetThumbPos( m_pTextView->GetStartDocPos().Y() );
566  }
567  else
568  {
569  tools::Long nDiff = m_pTextView->GetStartDocPos().X() - pScroll->GetThumbPos();
570  GetTextView()->Scroll( nDiff, 0 );
571  m_pTextView->ShowCursor( false );
572  pScroll->SetThumbPos( m_pTextView->GetStartDocPos().X() );
573  }
574  GetSrcView()->GetViewFrame()->GetBindings().Invalidate( SID_TABLE_CELL );
575 }
576 
577 IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer*, pIdle, void )
578 {
579  tools::Time aSyntaxCheckStart( tools::Time::SYSTEM );
580  SAL_WARN_IF(m_pTextView == nullptr, "sw", "No View yet, but syntax highlighting?!");
581 
582  m_bHighlighting = true;
583  sal_uInt16 nCount = 0;
584  // at first the region around the cursor is processed
585  TextSelection aSel = m_pTextView->GetSelection();
586  sal_uInt16 nCur = o3tl::narrowing<sal_uInt16>(aSel.GetStart().GetPara());
587  if(nCur > 40)
588  nCur -= 40;
589  else
590  nCur = 0;
591  if(!m_aSyntaxLineTable.empty())
592  for(sal_uInt16 i = 0; i < 80 && nCount < 40; i++, nCur++)
593  {
594  if(m_aSyntaxLineTable.find(nCur) != m_aSyntaxLineTable.end())
595  {
596  DoSyntaxHighlight( nCur );
597  m_aSyntaxLineTable.erase( nCur );
598  nCount++;
599  if(m_aSyntaxLineTable.empty())
600  break;
601  if((tools::Time( tools::Time::SYSTEM ).GetTime() - aSyntaxCheckStart.GetTime()) > MAX_HIGHLIGHTTIME )
602  {
603  break;
604  }
605  }
606  }
607 
608  // when there is still anything left by then, go on from the beginning
609  while ( !m_aSyntaxLineTable.empty() && nCount < MAX_SYNTAX_HIGHLIGHT)
610  {
611  sal_uInt16 nLine = *m_aSyntaxLineTable.begin();
612  DoSyntaxHighlight( nLine );
613  m_aSyntaxLineTable.erase(nLine);
614  nCount ++;
615  if(tools::Time( tools::Time::SYSTEM ).GetTime() - aSyntaxCheckStart.GetTime() > MAX_HIGHLIGHTTIME)
616  {
617  break;
618  }
619  }
620 
621  if(!m_aSyntaxLineTable.empty() && !pIdle->IsActive())
622  pIdle->Start();
623  // SyntaxTimerHdl is called when text changed
624  // => good opportunity to determine text width!
625  tools::Long nPrevTextWidth = m_nCurTextWidth;
626  m_nCurTextWidth = m_pTextEngine->CalcTextWidth() + 25; // small tolerance
627  if ( m_nCurTextWidth != nPrevTextWidth )
628  SetScrollBarRanges();
629  m_bHighlighting = false;
630 }
631 
632 void SwSrcEditWindow::DoSyntaxHighlight( sal_uInt16 nPara )
633 {
634  // Because of DelayedSyntaxHighlight it could happen,
635  // that the line doesn't exist anymore!
636  if ( nPara >= m_pTextEngine->GetParagraphCount() )
637  return;
638 
639  bool bTempModified = IsModified();
640  m_pTextEngine->RemoveAttribs( nPara );
641  OUString aSource( m_pTextEngine->GetText( nPara ) );
642  m_pTextEngine->SetUpdateMode( false );
643  ImpDoHighlight( aSource, nPara );
644  TextView* pTmp = m_pTextEngine->GetActiveView();
645  pTmp->SetAutoScroll(false);
646  m_pTextEngine->SetActiveView(nullptr);
647  m_pTextEngine->SetUpdateMode( true );
648  m_pTextEngine->SetActiveView(pTmp);
649  pTmp->SetAutoScroll(true);
650  pTmp->ShowCursor( false/*pTmp->IsAutoScroll()*/ );
651 
652  if(!bTempModified)
653  ClearModifyFlag();
654 
655 }
656 
657 void SwSrcEditWindow::ImpDoHighlight( const OUString& rSource, sal_uInt16 nLineOff )
658 {
659  TextPortions aPortionList;
660  lcl_Highlight(rSource, aPortionList);
661 
662  size_t nCount = aPortionList.size();
663  if ( !nCount )
664  return;
665 
666  TextPortion& rLast = aPortionList[nCount-1];
667  if ( rLast.nStart > rLast.nEnd ) // Only until Bug from MD is resolved
668  {
669  nCount--;
670  aPortionList.pop_back();
671  if ( !nCount )
672  return;
673  }
674 
675  {
676  // Only blanks and tabs have to be attributed along.
677  // When two identical attributes are placed consecutively,
678  // it optimises the TextEngine.
679  sal_uInt16 nLastEnd = 0;
680 
681  for ( size_t i = 0; i < nCount; i++ )
682  {
683  TextPortion& r = aPortionList[i];
684  if ( r.nStart > r.nEnd ) // only until Bug from MD is resolved
685  continue;
686 
687  if ( r.nStart > nLastEnd )
688  {
689  // Can I rely on the fact that all except blank and tab
690  // are being highlighted?!
691  r.nStart = nLastEnd;
692  }
693  nLastEnd = r.nEnd+1;
694  if ( ( i == (nCount-1) ) && ( r.nEnd < rSource.getLength() ) )
695  r.nEnd = rSource.getLength();
696  }
697  }
698 
699  for (TextPortion & r : aPortionList)
700  {
701  if ( r.nStart > r.nEnd ) // only until Bug from MD is resolved
702  continue;
703  if(r.eType != svtools::HTMLSGML &&
704  r.eType != svtools::HTMLCOMMENT &&
705  r.eType != svtools::HTMLKEYWORD &&
706  r.eType != svtools::HTMLUNKNOWN)
707  r.eType = svtools::HTMLUNKNOWN;
708  Color aColor(SW_MOD()->GetColorConfig().GetColorValue(r.eType).nColor);
709  m_pTextEngine->SetAttrib( TextAttribFontColor( aColor ), nLineOff, r.nStart, r.nEnd+1 );
710  }
711 }
712 
713 void SwSrcEditWindow::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
714 {
715  const TextHint* pTextHint = dynamic_cast<const TextHint*>(&rHint);
716  if (!pTextHint)
717  return;
718 
719  switch (pTextHint->GetId())
720  {
721  case SfxHintId::TextViewScrolled:
722  m_pHScrollbar->SetThumbPos( m_pTextView->GetStartDocPos().X() );
723  m_pVScrollbar->SetThumbPos( m_pTextView->GetStartDocPos().Y() );
724  break;
725 
726  case SfxHintId::TextHeightChanged:
727  if ( m_pTextEngine->GetTextHeight() < m_pOutWin->GetOutputSizePixel().Height() )
728  m_pTextView->Scroll( 0, m_pTextView->GetStartDocPos().Y() );
729  m_pVScrollbar->SetThumbPos( m_pTextView->GetStartDocPos().Y() );
731  break;
732 
733  case SfxHintId::TextParaInserted:
734  case SfxHintId::TextParaContentChanged:
735  if ( !m_bHighlighting )
736  {
737  m_aSyntaxLineTable.insert( o3tl::narrowing<sal_uInt16>(pTextHint->GetValue()) );
739  }
740  break;
741  default: break;
742  }
743 }
744 
746 {
748  Window::Invalidate();
749 }
750 
752 {
753  switch(rCEvt.GetCommand())
754  {
755  case CommandEventId::Wheel:
756  case CommandEventId::StartAutoScroll:
757  case CommandEventId::AutoScroll:
758  {
759  const CommandWheelData* pWData = rCEvt.GetWheelData();
760  if( !pWData || CommandWheelMode::ZOOM != pWData->GetMode() )
762  }
763  break;
764  default:
765  Window::Command(rCEvt);
766  }
767 }
768 
770 {
771  m_pTextView->Command(rCEvt);
773 }
774 
776 {
777  if (m_pOutWin)
778  m_pOutWin->GrabFocus();
779 }
780 
781 static bool lcl_GetLanguagesForEncoding(rtl_TextEncoding eEnc, LanguageType aLanguages[])
782 {
783  switch(eEnc)
784  {
785  case RTL_TEXTENCODING_UTF7 :
786  case RTL_TEXTENCODING_UTF8 :
787  // don#t fill - all LANGUAGE_SYSTEM means unicode font has to be used
788  break;
789 
790  case RTL_TEXTENCODING_ISO_8859_3:
791  case RTL_TEXTENCODING_ISO_8859_1 :
792  case RTL_TEXTENCODING_MS_1252 :
793  case RTL_TEXTENCODING_APPLE_ROMAN :
794  case RTL_TEXTENCODING_IBM_850 :
795  case RTL_TEXTENCODING_ISO_8859_14 :
796  case RTL_TEXTENCODING_ISO_8859_15 :
797  //fill with western languages
798  aLanguages[0] = LANGUAGE_GERMAN;
799  aLanguages[1] = LANGUAGE_FRENCH;
800  aLanguages[2] = LANGUAGE_ITALIAN;
801  aLanguages[3] = LANGUAGE_SPANISH;
802  break;
803 
804  case RTL_TEXTENCODING_IBM_865 :
805  //scandinavian
806  aLanguages[0] = LANGUAGE_FINNISH;
807  aLanguages[1] = LANGUAGE_NORWEGIAN;
808  aLanguages[2] = LANGUAGE_SWEDISH;
809  aLanguages[3] = LANGUAGE_DANISH;
810  break;
811 
812  case RTL_TEXTENCODING_ISO_8859_10 :
813  case RTL_TEXTENCODING_ISO_8859_13 :
814  case RTL_TEXTENCODING_ISO_8859_2 :
815  case RTL_TEXTENCODING_IBM_852 :
816  case RTL_TEXTENCODING_MS_1250 :
817  case RTL_TEXTENCODING_APPLE_CENTEURO :
818  aLanguages[0] = LANGUAGE_POLISH;
819  aLanguages[1] = LANGUAGE_CZECH;
820  aLanguages[2] = LANGUAGE_HUNGARIAN;
821  aLanguages[3] = LANGUAGE_SLOVAK;
822  break;
823 
824  case RTL_TEXTENCODING_ISO_8859_4 :
825  case RTL_TEXTENCODING_IBM_775 :
826  case RTL_TEXTENCODING_MS_1257 :
827  aLanguages[0] = LANGUAGE_LATVIAN ;
828  aLanguages[1] = LANGUAGE_LITHUANIAN;
829  aLanguages[2] = LANGUAGE_ESTONIAN ;
830  break;
831 
832  case RTL_TEXTENCODING_IBM_863 : aLanguages[0] = LANGUAGE_FRENCH_CANADIAN; break;
833  case RTL_TEXTENCODING_APPLE_FARSI : aLanguages[0] = LANGUAGE_FARSI; break;
834  case RTL_TEXTENCODING_APPLE_ROMANIAN:aLanguages[0] = LANGUAGE_ROMANIAN; break;
835 
836  case RTL_TEXTENCODING_IBM_861 :
837  case RTL_TEXTENCODING_APPLE_ICELAND :
838  aLanguages[0] = LANGUAGE_ICELANDIC;
839  break;
840 
841  case RTL_TEXTENCODING_APPLE_CROATIAN:aLanguages[0] = LANGUAGE_CROATIAN; break;
842 
843  case RTL_TEXTENCODING_IBM_437 :
844  case RTL_TEXTENCODING_ASCII_US : aLanguages[0] = LANGUAGE_ENGLISH; break;
845 
846  case RTL_TEXTENCODING_IBM_862 :
847  case RTL_TEXTENCODING_MS_1255 :
848  case RTL_TEXTENCODING_APPLE_HEBREW :
849  case RTL_TEXTENCODING_ISO_8859_8 :
850  aLanguages[0] = LANGUAGE_HEBREW;
851  break;
852 
853  case RTL_TEXTENCODING_IBM_857 :
854  case RTL_TEXTENCODING_MS_1254 :
855  case RTL_TEXTENCODING_APPLE_TURKISH:
856  case RTL_TEXTENCODING_ISO_8859_9 :
857  aLanguages[0] = LANGUAGE_TURKISH;
858  break;
859 
860  case RTL_TEXTENCODING_IBM_860 :
861  aLanguages[0] = LANGUAGE_PORTUGUESE;
862  break;
863 
864  case RTL_TEXTENCODING_IBM_869 :
865  case RTL_TEXTENCODING_MS_1253 :
866  case RTL_TEXTENCODING_APPLE_GREEK :
867  case RTL_TEXTENCODING_ISO_8859_7 :
868  case RTL_TEXTENCODING_IBM_737 :
869  aLanguages[0] = LANGUAGE_GREEK;
870  break;
871 
872  case RTL_TEXTENCODING_KOI8_R :
873  case RTL_TEXTENCODING_ISO_8859_5 :
874  case RTL_TEXTENCODING_IBM_855 :
875  case RTL_TEXTENCODING_MS_1251 :
876  case RTL_TEXTENCODING_IBM_866 :
877  case RTL_TEXTENCODING_APPLE_CYRILLIC :
878  aLanguages[0] = LANGUAGE_RUSSIAN;
879  break;
880 
881  case RTL_TEXTENCODING_APPLE_UKRAINIAN:
882  case RTL_TEXTENCODING_KOI8_U:
883  aLanguages[0] = LANGUAGE_UKRAINIAN;
884  break;
885 
886  case RTL_TEXTENCODING_IBM_864 :
887  case RTL_TEXTENCODING_MS_1256 :
888  case RTL_TEXTENCODING_ISO_8859_6 :
889  case RTL_TEXTENCODING_APPLE_ARABIC :
890  aLanguages[0] = LANGUAGE_ARABIC_SAUDI_ARABIA;
891  break;
892 
893  case RTL_TEXTENCODING_APPLE_CHINTRAD :
894  case RTL_TEXTENCODING_MS_950 :
895  case RTL_TEXTENCODING_GBT_12345 :
896  case RTL_TEXTENCODING_BIG5 :
897  case RTL_TEXTENCODING_EUC_TW :
898  case RTL_TEXTENCODING_BIG5_HKSCS :
899  aLanguages[0] = LANGUAGE_CHINESE_TRADITIONAL;
900  break;
901 
902  case RTL_TEXTENCODING_EUC_JP :
903  case RTL_TEXTENCODING_ISO_2022_JP :
904  case RTL_TEXTENCODING_JIS_X_0201 :
905  case RTL_TEXTENCODING_JIS_X_0208 :
906  case RTL_TEXTENCODING_JIS_X_0212 :
907  case RTL_TEXTENCODING_APPLE_JAPANESE :
908  case RTL_TEXTENCODING_MS_932 :
909  case RTL_TEXTENCODING_SHIFT_JIS :
910  aLanguages[0] = LANGUAGE_JAPANESE;
911  break;
912 
913  case RTL_TEXTENCODING_GB_2312 :
914  case RTL_TEXTENCODING_MS_936 :
915  case RTL_TEXTENCODING_GBK :
916  case RTL_TEXTENCODING_GB_18030 :
917  case RTL_TEXTENCODING_APPLE_CHINSIMP :
918  case RTL_TEXTENCODING_EUC_CN :
919  case RTL_TEXTENCODING_ISO_2022_CN :
920  aLanguages[0] = LANGUAGE_CHINESE_SIMPLIFIED;
921  break;
922 
923  case RTL_TEXTENCODING_APPLE_KOREAN :
924  case RTL_TEXTENCODING_MS_949 :
925  case RTL_TEXTENCODING_EUC_KR :
926  case RTL_TEXTENCODING_ISO_2022_KR :
927  case RTL_TEXTENCODING_MS_1361 :
928  aLanguages[0] = LANGUAGE_KOREAN;
929  break;
930 
931  case RTL_TEXTENCODING_APPLE_THAI :
932  case RTL_TEXTENCODING_MS_874 :
933  case RTL_TEXTENCODING_TIS_620 :
934  aLanguages[0] = LANGUAGE_THAI;
935  break;
936  default: aLanguages[0] = Application::GetSettings().GetUILanguageTag().getLanguageType();
937  }
938  return aLanguages[0] != LANGUAGE_SYSTEM;
939 }
941 {
942  OUString sFontName(
944  value_or(OUString()));
945  if(sFontName.isEmpty())
946  {
947  LanguageType aLanguages[5] =
948  {
949  LANGUAGE_SYSTEM, LANGUAGE_SYSTEM, LANGUAGE_SYSTEM, LANGUAGE_SYSTEM, LANGUAGE_SYSTEM
950  };
951  vcl::Font aFont;
953  {
954  //TODO: check for multiple languages
955  aFont = OutputDevice::GetDefaultFont(DefaultFontType::FIXED, aLanguages[0], GetDefaultFontFlags::NONE, GetOutDev());
956  }
957  else
958  aFont = OutputDevice::GetDefaultFont(DefaultFontType::SANS_UNICODE,
959  Application::GetSettings().GetLanguageTag().getLanguageType(), GetDefaultFontFlags::NONE, GetOutDev());
960  sFontName = aFont.GetFamilyName();
961  }
962  const SvxFontListItem* pFontListItem =
963  static_cast<const SvxFontListItem* >(m_pSrcView->GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ));
964  const FontList* pList = pFontListItem->GetFontList();
965  FontMetric aFontMetric = pList->Get(sFontName,WEIGHT_NORMAL, ITALIC_NONE);
966 
967  const vcl::Font& rFont = GetTextEngine()->GetFont();
968  vcl::Font aFont(aFontMetric);
969  Size aSize(rFont.GetFontSize());
970  //font height is stored in point and set in twip
971  aSize.setHeight(
973  aFont.SetFontSize(m_pOutWin->LogicToPixel(aSize, MapMode(MapUnit::MapTwip)));
974  GetTextEngine()->SetFont( aFont );
975  m_pOutWin->SetFont(aFont);
976 }
977 
978 void SwSrcEditWindow::SetTextEncoding(rtl_TextEncoding eEncoding)
979 {
980  m_eSourceEncoding = eEncoding;
981  SetFont();
982 }
983 
984 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
SfxViewFrame * GetViewFrame() const
tools::Long GetTextHeight() const
virtual void EnableRTL(bool bEnable=true) override
#define LANGUAGE_GERMAN
void SetBackground()
void SetFillColor(const Color &)
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
TextEngine * GetTextEngine()
Definition: srcedtw.hxx:119
const vcl::Font & GetFont() const
std::vector< TextPortion > TextPortions
Definition: srcedtw.cxx:68
virtual void SetModified(bool=true) override
Definition: docsh2.cxx:1419
void SetFontSize(const Size &)
SwSrcEditWindow & m_Editor
Definition: srcedtw.cxx:223
virtual void Command(const CommandEvent &rCEvt) override
Definition: srcedtw.cxx:751
const OUString & GetFamilyName() const
#define LANGUAGE_DANISH
#define LANGUAGE_ARABIC_SAUDI_ARABIA
void InitScrollBars()
Definition: srcedtw.cxx:542
void MouseButtonUp(const MouseEvent &rMouseEvent)
void SetFont(const vcl::Font &rFont)
#define LANGUAGE_ICELANDIC
#define LANGUAGE_GREEK
friend class ChangesListener
Definition: srcedtw.hxx:62
void MouseMove(const MouseEvent &rMouseEvent)
const LanguageTag & GetUILanguageTag() const
virtual void KeyInput(const KeyEvent &rKeyEvt) override
Definition: srcedtw.cxx:439
InvalidateFlags
void HandleWheelCommand(const CommandEvent &rCEvt)
Definition: srcedtw.cxx:769
#define MAX_HIGHLIGHTTIME
Definition: srcedtw.cxx:66
LanguageType getLanguageType(bool bResolveSystem=true) const
sal_Int32 GetValue() const
virtual void MouseMove(const MouseEvent &rMEvt) override
Definition: srcedtw.cxx:383
long Long
#define LANGUAGE_LITHUANIAN
const StyleSettings & GetStyleSettings() const
SwSrcView * GetSrcView()
Definition: srcedtw.hxx:121
static const AllSettings & GetSettings()
#define LANGUAGE_RUSSIAN
#define LANGUAGE_KOREAN
sal_Int64 n
Any GetTime(const OUString &val)
VclPtr< ScrollBar > m_pVScrollbar
Definition: srcedtw.hxx:68
sal_uInt16 GetGroup() const
#define LANGUAGE_SPANISH
sal_uInt16 GetCode() const
#define LANGUAGE_UKRAINIAN
sal_uInt16 m_nStartLine
Definition: srcedtw.hxx:79
DataChangedEventType GetType() const
WinBits const WB_VSCROLL
void SetHelpId(const OString &)
const CommandWheelData * GetWheelData() const
rtl::Reference< ChangesListener > m_xListener
Definition: srcedtw.hxx:73
void Invalidate(sal_uInt16 nId)
SwSrcView * m_pSrcView
Definition: srcedtw.hxx:71
virtual void dispose() override
virtual void DataChanged(const DataChangedEvent &) override
Definition: srcedtw.cxx:291
#define LANGUAGE_FRENCH_CANADIAN
static bool lcl_GetLanguagesForEncoding(rtl_TextEncoding eEnc, LanguageType aLanguages[])
Definition: srcedtw.cxx:781
bool HandleScrollCommand(const CommandEvent &rCmd, ScrollBar *pHScrl, ScrollBar *pVScrl)
void ExecutePopup(const OUString &rResName, vcl::Window *pWin=nullptr, const Point *pPos=nullptr)
VclPtr< ScrollBar > m_pHScrollbar
Definition: srcedtw.hxx:68
static void lcl_Highlight(const OUString &rSource, TextPortions &aPortionList)
Definition: srcedtw.cxx:70
#define LANGUAGE_HUNGARIAN
constexpr tools::Long Width() const
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Definition: srcedtw.cxx:405
#define LANGUAGE_PORTUGUESE
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
Definition: srcedtw.cxx:389
sal_uInt16 sal_Unicode
virtual void SAL_CALL propertiesChange(css::uno::Sequence< css::beans::PropertyChangeEvent > const &) override
Definition: srcedtw.cxx:216
void SetPageSize(tools::Long nNewSize)
std::unique_ptr< ExtTextEngine > m_pTextEngine
Definition: srcedtw.hxx:65
#define LANGUAGE_SWEDISH
static bool DoesKeyChangeText(const KeyEvent &rKeyEvent)
VclPtr< TextViewOutWin > m_pOutWin
Definition: srcedtw.hxx:67
WinBits const WB_HSCROLL
#define LANGUAGE_ITALIAN
int nCount
AllSettingsFlags GetFlags() const
static SfxViewShell * Current()
void SetTextEncoding(rtl_TextEncoding eEncoding)
Definition: srcedtw.cxx:978
FontMetric Get(const OUString &rName, const OUString &rStyleName) const
void DoSyntaxHighlight(sal_uInt16 nPara)
Definition: srcedtw.cxx:632
virtual void SetOutputSizePixel(const Size &rNewSize)
constexpr sal_uInt16 KEYGROUP_CURSOR
bool m_bHighlighting
Definition: srcedtw.hxx:82
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE) override
Definition: srcedtw.cxx:745
bool IsModified() const
Definition: srcedtw.hxx:129
void SetFont()
Definition: srcedtw.cxx:940
void SetThumbPos(tools::Long nThumbPos)
void SetLineSize(tools::Long nNewSize)
#define LANGUAGE_ROMANIAN
constexpr OStringLiteral HID_SOURCE_EDITWIN
Definition: helpids.h:28
#define LANGUAGE_NORWEGIAN
#define LANGUAGE_CROATIAN
DocumentType eType
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: srcedtw.cxx:713
void ShowCursor(bool bGotoCursor=true, bool bForceVisCursor=true)
TextEngine * GetTextEngine() const
#define LANGUAGE_CZECH
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
virtual void Resize() override
Definition: srcedtw.cxx:309
bool KeyInput(const KeyEvent &rKeyEvent)
#define LANGUAGE_HEBREW
void ImpDoHighlight(const OUString &rSource, sal_uInt16 nLineOff)
Definition: srcedtw.cxx:657
sal_Int32 GetScrollBarSize() const
void SetAutoScroll(bool bAutoScroll)
bool IsModified() const
#define LANGUAGE_LATVIAN
#define SW_MOD()
Definition: swmodule.hxx:255
Point LogicToPixel(const Point &rLogicPt) const
virtual void SAL_CALL disposing(css::lang::EventObject const &) override
Definition: srcedtw.cxx:210
int i
Idle m_aSyntaxIdle
Definition: srcedtw.hxx:84
#define LANGUAGE_SYSTEM
void SetVisibleSize(tools::Long nNewSize)
SfxBindings & GetBindings()
CommandWheelMode GetMode() const
void SetRange(const Range &rRange)
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
const AllSettings & GetSettings() const
WEIGHT_NORMAL
CommandEventId GetCommand() const
#define LANGUAGE_ESTONIAN
virtual void DataChanged(const DataChangedEvent &) override
Definition: srcedtw.cxx:362
virtual void Command(const CommandEvent &rCEvt) override
Definition: srcedtw.cxx:412
const TextPaM & GetStart() const
const Size & GetFontSize() const
#define LANGUAGE_CHINESE_SIMPLIFIED
#define LANGUAGE_FARSI
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
ITALIC_NONE
void GrabFocus()
vcl::Window * GetParent() const
IMPL_LINK(SwSrcEditWindow, ScrollHdl, ScrollBar *, pScroll, void)
Definition: srcedtw.cxx:558
void MouseButtonDown(const MouseEvent &rMouseEvent)
#define LANGUAGE_THAI
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
void SetScrollBarRanges()
Definition: srcedtw.cxx:534
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &) override
Definition: srcedtw.cxx:477
css::uno::Reference< css::beans::XMultiPropertySet > m_xNotifier
Definition: srcedtw.hxx:76
void SetPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
HtmlTokenId
void Update(sal_uInt16 nId)
WinBits const WB_3DLOOK
rtl_TextEncoding m_eSourceEncoding
Definition: srcedtw.hxx:80
void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
void SetPointer(PointerStyle)
DefTokenId nToken
void CreateTextEngine()
Definition: srcedtw.cxx:482
const vcl::KeyCode & GetKeyCode() const
#define LANGUAGE_FRENCH
#define LANGUAGE_ENGLISH
void Stop()
void SetTextView(TextView *pView)
Definition: srcedtw.hxx:55
#define SAL_WARN_IF(condition, area, stream)
#define LANGUAGE_POLISH
TextView * m_pTextView
Definition: srcedtw.hxx:41
constexpr tools::Long Height() const
WinBits const WB_BORDER
std::set< sal_uInt16 > m_aSyntaxLineTable
Definition: srcedtw.hxx:85
void SetTransparent(bool bTransparent)
virtual ~SwSrcEditWindow() override
Definition: srcedtw.cxx:258
#define MAX_SYNTAX_HIGHLIGHT
Definition: srcedtw.cxx:65
::OutputDevice const * GetOutDev() const
tools::Long AdjustWidth(tools::Long n)
void SetScrollHdl(const Link< ScrollBar *, void > &rLink)
#define LANGUAGE_SLOVAK
std::unique_ptr< TextView > m_pTextView
Definition: srcedtw.hxx:64
static VclPtr< reference_type > Create(Arg &&...arg)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
virtual void GetFocus() override
Definition: srcedtw.cxx:775
sal_Int64 GetTime() const
#define LANGUAGE_TURKISH
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual ~ChangesListener() override
Definition: srcedtw.cxx:208
const Color & GetWindowColor() const
const vcl::Font & GetFont() const
tools::Long AdjustHeight(tools::Long n)
void EnableDrag()
ChangesListener(SwSrcEditWindow &editor)
Definition: srcedtw.cxx:205
Size GetOutputSizePixel() const
void setHeight(tools::Long nHeight)
virtual void Start(bool bStartTimer=true) override
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
#define SAL_WARN(area, stream)
#define LANGUAGE_CHINESE_TRADITIONAL
#define LANGUAGE_FINNISH
void SetFont(const vcl::Font &rNewFont)
tools::Long m_nCurTextWidth
Definition: srcedtw.hxx:78
SwSrcEditWindow(vcl::Window *pParent, SwSrcView *pParentView)
Definition: srcedtw.cxx:226
std::mutex mutex_
Definition: srcedtw.hxx:74
const FontList * GetFontList() const
constexpr sal_uInt16 KEY_INSERT
bool IsReadonly() const
Definition: srcedtw.hxx:133
#define LANGUAGE_JAPANESE
virtual void dispose() override
Definition: srcedtw.cxx:263
WinBits const WB_CLIPCHILDREN
void Command(const CommandEvent &rCEvt)
sal_uInt32 GetPara() const
void ClearModifyFlag()
Definition: srcedtw.hxx:127
bool m_bDetectedRangeSegmentation false
WinBits const WB_DRAG
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
SwDocShell * GetDocShell()
Definition: srcview.cxx:244