fix: crash when set breakpoints in an empty C/C++ file
This commit is contained in:
parent
5be546e97f
commit
4e2053fb56
1
NEWS.md
1
NEWS.md
|
@ -57,6 +57,7 @@ Red Panda C++ Version 2.27
|
|||
- change: When debugging, don't auto set focus to the editor.
|
||||
- enhancement: Folding button scales with editor font.
|
||||
- fix: Should show header completion popup in #include line comments.
|
||||
- fix: Custom compile options not correctly parsed.
|
||||
|
||||
Red Panda C++ Version 2.26
|
||||
- enhancement: Code suggestion for embedded std::vectors.
|
||||
|
|
|
@ -555,7 +555,7 @@
|
|||
<translation>[Nota] </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+547"/>
|
||||
<location line="+548"/>
|
||||
<source>The compiler process for '%1' failed to start.</source>
|
||||
<translation>Falha ao iniciar a compilação para '%1'.</translation>
|
||||
</message>
|
||||
|
@ -590,7 +590,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-632"/>
|
||||
<location line="-633"/>
|
||||
<source> - Command: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -1382,7 +1382,7 @@
|
|||
<location filename="../editor.cpp" line="+372"/>
|
||||
<location line="+70"/>
|
||||
<location line="+29"/>
|
||||
<location line="+1086"/>
|
||||
<location line="+1092"/>
|
||||
<location line="+5"/>
|
||||
<location line="+21"/>
|
||||
<location line="+5"/>
|
||||
|
@ -1390,7 +1390,7 @@
|
|||
<translation>Erro</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-1180"/>
|
||||
<location line="-1186"/>
|
||||
<source>Save As</source>
|
||||
<translation>Salvar como</translation>
|
||||
</message>
|
||||
|
@ -1400,7 +1400,7 @@
|
|||
<translation>Arquivo %1 já aberto!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+1115"/>
|
||||
<location line="+1121"/>
|
||||
<source>The text to be copied exceeds count limit!</source>
|
||||
<translation>O texto a ser copiado excede o limite do contador!</translation>
|
||||
</message>
|
||||
|
@ -1425,7 +1425,7 @@
|
|||
<translation>Imprimir documento</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+778"/>
|
||||
<location line="+788"/>
|
||||
<location line="+25"/>
|
||||
<location line="+47"/>
|
||||
<source>Ctrl+click for more info</source>
|
||||
|
@ -1457,13 +1457,13 @@
|
|||
<translation>Apenas leitura</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-5331"/>
|
||||
<location line="-5347"/>
|
||||
<location line="+434"/>
|
||||
<source>Error Load File</source>
|
||||
<translation type="unfinished">Erro ao carregar arquivo</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+1576"/>
|
||||
<location line="+1582"/>
|
||||
<source>hex: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -1870,7 +1870,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+9"/>
|
||||
<location line="+22"/>
|
||||
<source>Show only monospaced fonts</source>
|
||||
<translation>Mostrar apenas fontes com espaçamento único</translation>
|
||||
</message>
|
||||
|
|
|
@ -692,7 +692,7 @@ p, li { white-space: pre-wrap; }
|
|||
<translation>警告:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+519"/>
|
||||
<location line="+520"/>
|
||||
<source>Can't open file "%1" for write!</source>
|
||||
<translation>无法写入文件“%1”。</translation>
|
||||
</message>
|
||||
|
@ -1596,7 +1596,7 @@ p, li { white-space: pre-wrap; }
|
|||
<location filename="../editor.cpp" line="+372"/>
|
||||
<location line="+70"/>
|
||||
<location line="+29"/>
|
||||
<location line="+1086"/>
|
||||
<location line="+1092"/>
|
||||
<location line="+5"/>
|
||||
<location line="+21"/>
|
||||
<location line="+5"/>
|
||||
|
@ -1608,7 +1608,7 @@ p, li { white-space: pre-wrap; }
|
|||
<translation type="vanished">无法写入文件"%1"</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-1473"/>
|
||||
<location line="-1479"/>
|
||||
<location line="+434"/>
|
||||
<source>Error Load File</source>
|
||||
<translation>载入文件错误</translation>
|
||||
|
@ -1648,7 +1648,7 @@ p, li { white-space: pre-wrap; }
|
|||
<translation>文件%1已经被打开!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+1115"/>
|
||||
<location line="+1121"/>
|
||||
<source>The text to be copied exceeds count limit!</source>
|
||||
<translation>要复制的内容超过了行数限制!</translation>
|
||||
</message>
|
||||
|
@ -1683,7 +1683,7 @@ p, li { white-space: pre-wrap; }
|
|||
<translation>打印文档</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+778"/>
|
||||
<location line="+788"/>
|
||||
<location line="+25"/>
|
||||
<location line="+47"/>
|
||||
<source>Ctrl+click for more info</source>
|
||||
|
@ -2120,7 +2120,7 @@ p, li { white-space: pre-wrap; }
|
|||
<translation>选择字体</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+9"/>
|
||||
<location line="+22"/>
|
||||
<source>Show only monospaced fonts</source>
|
||||
<translation>只显示等宽字体</translation>
|
||||
</message>
|
||||
|
@ -6598,7 +6598,7 @@ p, li { white-space: pre-wrap; }
|
|||
<message>
|
||||
<location line="+265"/>
|
||||
<source>Line: %1/%2 Col: %3 Sel: %4</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>行: %1/%2 列: %3 选中: %4</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+6"/>
|
||||
|
@ -6608,7 +6608,7 @@ p, li { white-space: pre-wrap; }
|
|||
<message>
|
||||
<location line="+7"/>
|
||||
<source>Line: %1/%2 Char: %3/%4 Sel: %5</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>行: %1/%2 字符: %3/%4 选中: %5</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+1326"/>
|
||||
|
|
|
@ -456,7 +456,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+547"/>
|
||||
<location line="+548"/>
|
||||
<source>The compiler process for '%1' failed to start.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -491,7 +491,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-632"/>
|
||||
<location line="-633"/>
|
||||
<source> - Command: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -1227,7 +1227,7 @@
|
|||
<location filename="../editor.cpp" line="+372"/>
|
||||
<location line="+70"/>
|
||||
<location line="+29"/>
|
||||
<location line="+1086"/>
|
||||
<location line="+1092"/>
|
||||
<location line="+5"/>
|
||||
<location line="+21"/>
|
||||
<location line="+5"/>
|
||||
|
@ -1235,7 +1235,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-1180"/>
|
||||
<location line="-1186"/>
|
||||
<source>Save As</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -1245,7 +1245,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+1115"/>
|
||||
<location line="+1121"/>
|
||||
<source>The text to be copied exceeds count limit!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -1270,7 +1270,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+778"/>
|
||||
<location line="+788"/>
|
||||
<location line="+25"/>
|
||||
<location line="+47"/>
|
||||
<source>Ctrl+click for more info</source>
|
||||
|
@ -1302,13 +1302,13 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="-5331"/>
|
||||
<location line="-5347"/>
|
||||
<location line="+434"/>
|
||||
<source>Error Load File</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+1576"/>
|
||||
<location line="+1582"/>
|
||||
<source>hex: %1</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
@ -1711,7 +1711,7 @@
|
|||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<location line="+9"/>
|
||||
<location line="+22"/>
|
||||
<source>Show only monospaced fonts</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
|
|
|
@ -947,12 +947,16 @@ int Document::glyphLength(int line, int glyphIdx)
|
|||
int Document::glyphStartPostion(int line, int glyphIdx)
|
||||
{
|
||||
QMutexLocker locker(&mMutex);
|
||||
if (line<0 || line>=count())
|
||||
return 0;
|
||||
return mLines[line]->glyphStartPosition(glyphIdx);
|
||||
}
|
||||
|
||||
int Document::glyphWidth(int line, int glyphIdx)
|
||||
{
|
||||
QMutexLocker locker(&mMutex);
|
||||
if (line<0 || line>=count())
|
||||
return 0;
|
||||
return mLines[line]->glyphWidth(glyphIdx);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue