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