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