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