Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
d5c2846b
Kaydet (Commit)
d5c2846b
authored
Nis 17, 2012
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
None of the edit undo classes access ImpEditEngine directly.
üst
68fc6266
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
54 deletions
+89
-54
editeng.hxx
editeng/inc/editeng/editeng.hxx
+8
-2
editeng.cxx
editeng/source/editeng/editeng.cxx
+30
-0
editundo.cxx
editeng/source/editeng/editundo.cxx
+51
-52
No files found.
editeng/inc/editeng/editeng.hxx
Dosyayı görüntüle @
d5c2846b
...
...
@@ -171,8 +171,6 @@ private:
EDITENG_DLLPRIVATE
Range
GetLineXPosStartEnd
(
const
ParaPortion
*
pParaPortion
,
const
EditLine
*
pLine
)
const
;
EDITENG_DLLPRIVATE
bool
IsFormatted
()
const
;
EDITENG_DLLPRIVATE
sal_uInt16
GetOnePixelInRef
()
const
;
EDITENG_DLLPRIVATE
InternalEditStatus
&
GetInternalEditStatus
();
...
...
@@ -233,6 +231,7 @@ public:
LanguageType
GetLanguage
(
sal_uInt16
nPara
,
sal_uInt16
nPos
)
const
;
void
TransliterateText
(
const
ESelection
&
rSelection
,
sal_Int32
nTransliterationMode
);
EditSelection
TransliterateText
(
const
EditSelection
&
rSelection
,
sal_Int32
nTransliterationMode
);
void
SetAsianCompressionMode
(
sal_uInt16
nCompression
);
...
...
@@ -514,6 +513,7 @@ public:
EditDoc
&
GetEditDoc
();
const
EditDoc
&
GetEditDoc
()
const
;
bool
IsFormatted
()
const
;
bool
IsImportHandlerSet
()
const
;
bool
IsImportRTFStyleSheetsSet
()
const
;
...
...
@@ -527,6 +527,7 @@ public:
EditPaM
InsertField
(
const
EditSelection
&
rEditSelection
,
const
SvxFieldItem
&
rFld
);
EditPaM
InsertText
(
const
EditSelection
&
aCurEditSelection
,
const
String
&
rStr
);
EditSelection
InsertText
(
const
EditTextObject
&
rTextObject
,
const
EditSelection
&
rSel
);
EditPaM
InsertParaBreak
(
const
EditSelection
&
rEditSelection
,
bool
bKeepEndingAttribs
=
true
);
EditPaM
InsertLineBreak
(
const
EditSelection
&
rEditSelection
);
...
...
@@ -542,12 +543,14 @@ public:
EditPaM
DeleteSelection
(
const
EditSelection
&
rSel
);
ESelection
CreateESelection
(
const
EditSelection
&
rSel
);
EditSelection
CreateSelection
(
const
ESelection
&
rSel
);
const
SfxItemSet
&
GetBaseParaAttribs
(
sal_uInt16
nPara
)
const
;
void
SetParaAttribsOnly
(
sal_uInt16
nPara
,
const
SfxItemSet
&
rSet
);
void
SetAttribs
(
const
EditSelection
&
rSel
,
const
SfxItemSet
&
rSet
,
sal_uInt8
nSpecial
=
0
);
String
GetSelected
(
const
EditSelection
&
rSel
,
const
LineEnd
eParaSep
=
LINEEND_LF
)
const
;
EditPaM
DeleteSelected
(
const
EditSelection
&
rSel
);
sal_uInt16
GetScriptType
(
const
EditSelection
&
rSel
)
const
;
...
...
@@ -566,6 +569,9 @@ public:
EditPaM
InsertFeature
(
const
EditSelection
&
rEditSelection
,
const
SfxPoolItem
&
rItem
);
EditSelection
MoveParagraphs
(
const
Range
&
rParagraphs
,
sal_uInt16
nNewPos
,
EditView
*
pCurView
);
void
RemoveCharAttribs
(
sal_uInt16
nPara
,
sal_uInt16
nWhich
=
0
,
bool
bRemoveFeatures
=
false
);
void
RemoveCharAttribs
(
const
EditSelection
&
rSel
,
bool
bRemoveParaAttribs
,
sal_uInt16
nWhich
=
0
);
};
#endif // _MyEDITENG_HXX
...
...
editeng/source/editeng/editeng.cxx
Dosyayı görüntüle @
d5c2846b
...
...
@@ -534,6 +534,11 @@ void EditEngine::TransliterateText( const ESelection& rSelection, sal_Int32 nTra
pImpEditEngine
->
TransliterateText
(
pImpEditEngine
->
CreateSel
(
rSelection
),
nTransliterationMode
);
}
EditSelection
EditEngine
::
TransliterateText
(
const
EditSelection
&
rSelection
,
sal_Int32
nTransliterationMode
)
{
return
pImpEditEngine
->
TransliterateText
(
rSelection
,
nTransliterationMode
);
}
void
EditEngine
::
SetAsianCompressionMode
(
sal_uInt16
n
)
{
DBG_CHKTHIS
(
EditView
,
0
);
...
...
@@ -792,6 +797,16 @@ EditSelection EditEngine::MoveParagraphs(const Range& rParagraphs, sal_uInt16 nN
return
pImpEditEngine
->
MoveParagraphs
(
rParagraphs
,
nNewPos
,
pCurView
);
}
void
EditEngine
::
RemoveCharAttribs
(
sal_uInt16
nPara
,
sal_uInt16
nWhich
,
bool
bRemoveFeatures
)
{
pImpEditEngine
->
RemoveCharAttribs
(
nPara
,
nWhich
,
bRemoveFeatures
);
}
void
EditEngine
::
RemoveCharAttribs
(
const
EditSelection
&
rSel
,
bool
bRemoveParaAttribs
,
sal_uInt16
nWhich
)
{
pImpEditEngine
->
RemoveCharAttribs
(
rSel
,
bRemoveParaAttribs
,
nWhich
);
}
uno
::
Reference
<
datatransfer
::
XTransferable
>
EditEngine
::
CreateTransferable
(
const
EditSelection
&
rSelection
)
{
return
pImpEditEngine
->
CreateTransferable
(
rSelection
);
...
...
@@ -823,6 +838,11 @@ EditPaM EditEngine::InsertText(const EditSelection& aCurEditSelection, const Str
return
pImpEditEngine
->
InsertText
(
aCurEditSelection
,
rStr
);
}
EditSelection
EditEngine
::
InsertText
(
const
EditTextObject
&
rTextObject
,
const
EditSelection
&
rSel
)
{
return
pImpEditEngine
->
InsertText
(
rTextObject
,
rSel
);
}
EditSelection
EditEngine
::
InsertText
(
uno
::
Reference
<
datatransfer
::
XTransferable
>&
rxDataObj
,
const
String
&
rBaseURL
,
const
EditPaM
&
rPaM
,
bool
bUseSpecial
)
...
...
@@ -909,6 +929,11 @@ ESelection EditEngine::CreateESelection(const EditSelection& rSel)
return
pImpEditEngine
->
CreateESel
(
rSel
);
}
EditSelection
EditEngine
::
CreateSelection
(
const
ESelection
&
rSel
)
{
return
pImpEditEngine
->
CreateSel
(
rSel
);
}
const
SfxItemSet
&
EditEngine
::
GetBaseParaAttribs
(
sal_uInt16
nPara
)
const
{
return
pImpEditEngine
->
GetParaAttribs
(
nPara
);
...
...
@@ -929,6 +954,11 @@ String EditEngine::GetSelected(const EditSelection& rSel, const LineEnd eParaSep
return
pImpEditEngine
->
GetSelected
(
rSel
,
eParaSep
);
}
EditPaM
EditEngine
::
DeleteSelected
(
const
EditSelection
&
rSel
)
{
return
pImpEditEngine
->
DeleteSelected
(
rSel
);
}
void
EditEngine
::
HandleBeginPasteOrDrop
(
PasteOrDropInfos
&
rInfos
)
{
pImpEditEngine
->
aBeginPasteOrDropHdl
.
Call
(
&
rInfos
);
...
...
editeng/source/editeng/editundo.cxx
Dosyayı görüntüle @
d5c2846b
...
...
@@ -494,17 +494,17 @@ EditUndoSetStyleSheet::~EditUndoSetStyleSheet()
void
EditUndoSetStyleSheet
::
Undo
()
{
DBG_ASSERT
(
Get
Imp
EditEngine
()
->
GetActiveView
(),
"Undo/Redo: No Active View!"
);
Get
ImpEditEngine
()
->
SetStyleSheet
(
nPara
,
(
SfxStyleSheet
*
)
GetImp
EditEngine
()
->
GetStyleSheetPool
()
->
Find
(
aPrevName
,
ePrevFamily
)
);
Get
ImpEditEngine
()
->
SetParaAttribs
(
nPara
,
aPrevParaAttribs
);
lcl_DoSetSelection
(
Get
Imp
EditEngine
()
->
GetActiveView
(),
nPara
);
DBG_ASSERT
(
GetEditEngine
()
->
GetActiveView
(),
"Undo/Redo: No Active View!"
);
Get
EditEngine
()
->
SetStyleSheet
(
nPara
,
(
SfxStyleSheet
*
)
Get
EditEngine
()
->
GetStyleSheetPool
()
->
Find
(
aPrevName
,
ePrevFamily
)
);
Get
EditEngine
()
->
SetParaAttribsOnly
(
nPara
,
aPrevParaAttribs
);
lcl_DoSetSelection
(
GetEditEngine
()
->
GetActiveView
(),
nPara
);
}
void
EditUndoSetStyleSheet
::
Redo
()
{
DBG_ASSERT
(
Get
Imp
EditEngine
()
->
GetActiveView
(),
"Undo/Redo: No Active View!"
);
Get
ImpEditEngine
()
->
SetStyleSheet
(
nPara
,
(
SfxStyleSheet
*
)
GetImp
EditEngine
()
->
GetStyleSheetPool
()
->
Find
(
aNewName
,
eNewFamily
)
);
lcl_DoSetSelection
(
Get
Imp
EditEngine
()
->
GetActiveView
(),
nPara
);
DBG_ASSERT
(
GetEditEngine
()
->
GetActiveView
(),
"Undo/Redo: No Active View!"
);
Get
EditEngine
()
->
SetStyleSheet
(
nPara
,
(
SfxStyleSheet
*
)
Get
EditEngine
()
->
GetStyleSheetPool
()
->
Find
(
aNewName
,
eNewFamily
)
);
lcl_DoSetSelection
(
GetEditEngine
()
->
GetActiveView
(),
nPara
);
}
EditUndoSetParaAttribs
::
EditUndoSetParaAttribs
(
ImpEditEngine
*
_pImpEE
,
sal_uInt16
nP
,
const
SfxItemSet
&
rPrevItems
,
const
SfxItemSet
&
rNewItems
)
...
...
@@ -521,16 +521,16 @@ EditUndoSetParaAttribs::~EditUndoSetParaAttribs()
void
EditUndoSetParaAttribs
::
Undo
()
{
DBG_ASSERT
(
Get
Imp
EditEngine
()
->
GetActiveView
(),
"Undo/Redo: No Active View!"
);
Get
ImpEditEngine
()
->
SetParaAttribs
(
nPara
,
aPrevItems
);
lcl_DoSetSelection
(
Get
Imp
EditEngine
()
->
GetActiveView
(),
nPara
);
DBG_ASSERT
(
GetEditEngine
()
->
GetActiveView
(),
"Undo/Redo: No Active View!"
);
Get
EditEngine
()
->
SetParaAttribsOnly
(
nPara
,
aPrevItems
);
lcl_DoSetSelection
(
GetEditEngine
()
->
GetActiveView
(),
nPara
);
}
void
EditUndoSetParaAttribs
::
Redo
()
{
DBG_ASSERT
(
Get
Imp
EditEngine
()
->
GetActiveView
(),
"Undo/Redo: No Active View!"
);
Get
ImpEditEngine
()
->
SetParaAttribs
(
nPara
,
aNewItems
);
lcl_DoSetSelection
(
Get
Imp
EditEngine
()
->
GetActiveView
(),
nPara
);
DBG_ASSERT
(
GetEditEngine
()
->
GetActiveView
(),
"Undo/Redo: No Active View!"
);
Get
EditEngine
()
->
SetParaAttribsOnly
(
nPara
,
aNewItems
);
lcl_DoSetSelection
(
GetEditEngine
()
->
GetActiveView
(),
nPara
);
}
EditUndoSetAttribs
::
EditUndoSetAttribs
(
ImpEditEngine
*
_pImpEE
,
const
ESelection
&
rESel
,
const
SfxItemSet
&
rNewItems
)
...
...
@@ -571,47 +571,47 @@ EditUndoSetAttribs::~EditUndoSetAttribs()
void
EditUndoSetAttribs
::
Undo
()
{
DBG_ASSERT
(
Get
Imp
EditEngine
()
->
GetActiveView
(),
"Undo/Redo: No Active View!"
);
ImpEditEngine
*
_pImpEE
=
GetImp
EditEngine
();
DBG_ASSERT
(
GetEditEngine
()
->
GetActiveView
(),
"Undo/Redo: No Active View!"
);
EditEngine
*
pEE
=
Get
EditEngine
();
bool
bFields
=
false
;
for
(
sal_uInt16
nPara
=
aESel
.
nStartPara
;
nPara
<=
aESel
.
nEndPara
;
nPara
++
)
{
const
ContentAttribsInfo
&
rInf
=
aPrevAttribs
[
nPara
-
aESel
.
nStartPara
];
// first the paragraph attributes ...
_pImpEE
->
SetParaAttribs
(
nPara
,
rInf
.
GetPrevParaAttribs
());
pEE
->
SetParaAttribsOnly
(
nPara
,
rInf
.
GetPrevParaAttribs
());
// Then the character attributes ...
// Remove all attributes including features, are later re-established.
_pIm
pEE
->
RemoveCharAttribs
(
nPara
,
0
,
true
);
DBG_ASSERT
(
_pIm
pEE
->
GetEditDoc
().
GetObject
(
nPara
),
"Undo (SetAttribs): pNode = NULL!"
);
ContentNode
*
pNode
=
_pIm
pEE
->
GetEditDoc
().
GetObject
(
nPara
);
pEE
->
RemoveCharAttribs
(
nPara
,
0
,
true
);
DBG_ASSERT
(
pEE
->
GetEditDoc
().
GetObject
(
nPara
),
"Undo (SetAttribs): pNode = NULL!"
);
ContentNode
*
pNode
=
pEE
->
GetEditDoc
().
GetObject
(
nPara
);
for
(
size_t
nAttr
=
0
;
nAttr
<
rInf
.
GetPrevCharAttribs
().
size
();
++
nAttr
)
{
const
EditCharAttrib
&
rX
=
rInf
.
GetPrevCharAttribs
()[
nAttr
];
// is automatically "poolsized"
_pIm
pEE
->
GetEditDoc
().
InsertAttrib
(
pNode
,
rX
.
GetStart
(),
rX
.
GetEnd
(),
*
rX
.
GetItem
());
pEE
->
GetEditDoc
().
InsertAttrib
(
pNode
,
rX
.
GetStart
(),
rX
.
GetEnd
(),
*
rX
.
GetItem
());
if
(
rX
.
Which
()
==
EE_FEATURE_FIELD
)
bFields
=
true
;
}
}
if
(
bFields
)
_pImpEE
->
UpdateFields
();
ImpSetSelection
(
GetImpEditEngine
()
->
GetActiveView
()
);
pEE
->
UpdateFieldsOnly
();
ImpSetSelection
(
pEE
->
GetActiveView
()
);
}
void
EditUndoSetAttribs
::
Redo
()
{
DBG_ASSERT
(
Get
Imp
EditEngine
()
->
GetActiveView
(),
"Undo/Redo: No Active View!"
);
ImpEditEngine
*
_pImpEE
=
GetImp
EditEngine
();
DBG_ASSERT
(
GetEditEngine
()
->
GetActiveView
(),
"Undo/Redo: No Active View!"
);
EditEngine
*
pEE
=
Get
EditEngine
();
EditSelection
aSel
(
_pImpEE
->
CreateSel
(
aESel
)
);
EditSelection
aSel
=
pEE
->
CreateSelection
(
aESel
);
if
(
!
bSetIsRemove
)
_pIm
pEE
->
SetAttribs
(
aSel
,
aNewAttribs
,
nSpecial
);
pEE
->
SetAttribs
(
aSel
,
aNewAttribs
,
nSpecial
);
else
_pIm
pEE
->
RemoveCharAttribs
(
aSel
,
bRemoveParaAttribs
,
nRemoveWhich
);
pEE
->
RemoveCharAttribs
(
aSel
,
bRemoveParaAttribs
,
nRemoveWhich
);
ImpSetSelection
(
Get
Imp
EditEngine
()
->
GetActiveView
()
);
ImpSetSelection
(
GetEditEngine
()
->
GetActiveView
()
);
}
void
EditUndoSetAttribs
::
AppendContentInfo
(
ContentAttribsInfo
*
pNew
)
...
...
@@ -621,9 +621,9 @@ void EditUndoSetAttribs::AppendContentInfo(ContentAttribsInfo* pNew)
void
EditUndoSetAttribs
::
ImpSetSelection
(
EditView
*
/*pView*/
)
{
ImpEditEngine
*
_pImpEE
=
GetImp
EditEngine
();
EditSelection
aSel
(
_pImpEE
->
CreateSel
(
aESel
)
);
GetImpEditEngine
()
->
GetActiveView
()
->
GetImpEditView
()
->
SetEditSelection
(
aSel
);
EditEngine
*
pEE
=
Get
EditEngine
();
EditSelection
aSel
=
pEE
->
CreateSelection
(
aESel
);
pEE
->
GetActiveView
()
->
GetImpEditView
()
->
SetEditSelection
(
aSel
);
}
EditUndoTransliteration
::
EditUndoTransliteration
(
ImpEditEngine
*
_pImpEE
,
const
ESelection
&
rESel
,
sal_Int32
nM
)
...
...
@@ -640,26 +640,26 @@ EditUndoTransliteration::~EditUndoTransliteration()
void
EditUndoTransliteration
::
Undo
()
{
DBG_ASSERT
(
Get
Imp
EditEngine
()
->
GetActiveView
(),
"Undo/Redo: No Active View!"
);
DBG_ASSERT
(
GetEditEngine
()
->
GetActiveView
(),
"Undo/Redo: No Active View!"
);
ImpEditEngine
*
_pImpEE
=
GetImp
EditEngine
();
EditEngine
*
pEE
=
Get
EditEngine
();
EditSelection
aSel
(
_pImpEE
->
CreateSel
(
aNewESel
)
);
EditSelection
aSel
=
pEE
->
CreateSelection
(
aNewESel
);
// Insert text, but don't expand Atribs at the current position:
aSel
=
_pIm
pEE
->
DeleteSelected
(
aSel
);
aSel
=
pEE
->
DeleteSelected
(
aSel
);
EditSelection
aDelSel
(
aSel
);
aSel
=
_pIm
pEE
->
InsertParaBreak
(
aSel
);
aSel
=
pEE
->
InsertParaBreak
(
aSel
);
aDelSel
.
Max
()
=
aSel
.
Min
();
aDelSel
.
Max
().
GetNode
()
->
GetCharAttribs
().
DeleteEmptyAttribs
(
_pIm
pEE
->
GetEditDoc
().
GetItemPool
()
);
aDelSel
.
Max
().
GetNode
()
->
GetCharAttribs
().
DeleteEmptyAttribs
(
pEE
->
GetEditDoc
().
GetItemPool
()
);
EditSelection
aNewSel
;
if
(
pTxtObj
)
{
aNewSel
=
_pIm
pEE
->
InsertText
(
*
pTxtObj
,
aSel
);
aNewSel
=
pEE
->
InsertText
(
*
pTxtObj
,
aSel
);
}
else
{
aNewSel
=
_pIm
pEE
->
InsertText
(
aSel
,
aText
);
aNewSel
=
pEE
->
InsertText
(
aSel
,
aText
);
}
if
(
aNewSel
.
Min
().
GetNode
()
==
aDelSel
.
Max
().
GetNode
()
)
{
...
...
@@ -673,19 +673,18 @@ void EditUndoTransliteration::Undo()
aNewSel
.
Max
().
GetIndex
()
=
aNewSel
.
Max
().
GetIndex
()
+
aDelSel
.
Min
().
GetIndex
();
}
_pImpEE
->
DeleteSelected
(
aDelSel
);
GetImpEditEngine
()
->
GetActiveView
()
->
GetImpEditView
()
->
SetEditSelection
(
aNewSel
);
pEE
->
DeleteSelected
(
aDelSel
);
pEE
->
GetActiveView
()
->
GetImpEditView
()
->
SetEditSelection
(
aNewSel
);
}
void
EditUndoTransliteration
::
Redo
()
{
DBG_ASSERT
(
Get
Imp
EditEngine
()
->
GetActiveView
(),
"Undo/Redo: No Active View!"
);
ImpEditEngine
*
_pImpEE
=
GetImp
EditEngine
();
DBG_ASSERT
(
GetEditEngine
()
->
GetActiveView
(),
"Undo/Redo: No Active View!"
);
EditEngine
*
pEE
=
Get
EditEngine
();
EditSelection
aSel
(
_pImpEE
->
CreateSel
(
aOldESel
)
);
EditSelection
aNewSel
=
_pIm
pEE
->
TransliterateText
(
aSel
,
nMode
);
GetImpEditEngine
()
->
GetActiveView
()
->
GetImpEditView
()
->
SetEditSelection
(
aNewSel
);
EditSelection
aSel
=
pEE
->
CreateSelection
(
aOldESel
);
EditSelection
aNewSel
=
pEE
->
TransliterateText
(
aSel
,
nMode
);
pEE
->
GetActiveView
()
->
GetImpEditView
()
->
SetEditSelection
(
aNewSel
);
}
EditUndoMarkSelection
::
EditUndoMarkSelection
(
ImpEditEngine
*
_pImpEE
,
const
ESelection
&
rSel
)
...
...
@@ -699,13 +698,13 @@ EditUndoMarkSelection::~EditUndoMarkSelection()
void
EditUndoMarkSelection
::
Undo
()
{
DBG_ASSERT
(
Get
Imp
EditEngine
()
->
GetActiveView
(),
"Undo/Redo: No Active View!"
);
if
(
Get
Imp
EditEngine
()
->
GetActiveView
()
)
DBG_ASSERT
(
GetEditEngine
()
->
GetActiveView
(),
"Undo/Redo: No Active View!"
);
if
(
GetEditEngine
()
->
GetActiveView
()
)
{
if
(
Get
Imp
EditEngine
()
->
IsFormatted
()
)
Get
Imp
EditEngine
()
->
GetActiveView
()
->
SetSelection
(
aSelection
);
if
(
GetEditEngine
()
->
IsFormatted
()
)
GetEditEngine
()
->
GetActiveView
()
->
SetSelection
(
aSelection
);
else
Get
ImpEditEngine
()
->
GetActiveView
()
->
GetImpEditView
()
->
SetEditSelection
(
GetImpEditEngine
()
->
CreateSel
(
aSelection
)
);
Get
EditEngine
()
->
GetActiveView
()
->
GetImpEditView
()
->
SetEditSelection
(
GetEditEngine
()
->
CreateSelection
(
aSelection
)
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment