[DEV] change NULL ==> nullptr
This commit is contained in:
@@ -67,7 +67,7 @@ appl::TextViewer::~TextViewer() {
|
||||
}
|
||||
|
||||
std::string appl::TextViewer::getBufferPath() {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return "";
|
||||
}
|
||||
std::string filename = m_buffer->getFileName();
|
||||
@@ -109,7 +109,7 @@ void appl::TextViewer::onRegenerateDisplay() {
|
||||
m_displayDrawing.setColor((*m_paintingProperties)[m_colorBackground].getForeground());
|
||||
m_displayDrawing.rectangleWidth(m_size);
|
||||
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
m_maxSize.setX(256);
|
||||
m_maxSize.setY(256);
|
||||
m_displayText.setTextAlignement(10, m_size.x()-20, ewol::compositing::alignLeft);
|
||||
@@ -204,7 +204,7 @@ void appl::TextViewer::onRegenerateDisplay() {
|
||||
appl::DisplayHLData displayLocalSyntax;
|
||||
m_buffer->hightlightGenerateLines(displayLocalSyntax, startingIt, (m_size.y()/tmpLetterSize.y()) + 5);
|
||||
float maxSizeX = 0;
|
||||
appl::HighlightInfo * HLColor = NULL;
|
||||
appl::HighlightInfo * HLColor = nullptr;
|
||||
bool DisplayCursorAndSelection = isSelectedLast();
|
||||
appl::Buffer::Iterator it;
|
||||
for (it = startingIt;
|
||||
@@ -242,8 +242,8 @@ void appl::TextViewer::onRegenerateDisplay() {
|
||||
}
|
||||
HLColor = m_buffer->getElementColorAtPosition(displayLocalSyntax, (int64_t)it);
|
||||
bool haveBackground = false;
|
||||
if ( HLColor != NULL
|
||||
&& HLColor->patern != NULL) {
|
||||
if ( HLColor != nullptr
|
||||
&& HLColor->patern != nullptr) {
|
||||
m_displayText.setColor(HLColor->patern->getColorGlyph().getForeground());
|
||||
m_displayText.setColorBg(HLColor->patern->getColorGlyph().getBackground());
|
||||
haveBackground = HLColor->patern->getColorGlyph().haveBackground();
|
||||
@@ -313,7 +313,7 @@ void appl::TextViewer::onRegenerateDisplay() {
|
||||
}
|
||||
|
||||
bool appl::TextViewer::onEventEntry(const ewol::event::Entry& _event) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return false;
|
||||
}
|
||||
// First call plugin
|
||||
@@ -429,7 +429,7 @@ bool appl::TextViewer::onEventInput(const ewol::event::Input& _event) {
|
||||
keepFocus();
|
||||
}
|
||||
//tic();
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return false;
|
||||
}
|
||||
// First call the scrolling widget :
|
||||
@@ -613,7 +613,7 @@ appl::Buffer::Iterator appl::TextViewer::getMousePosition(const vec2& _relativeP
|
||||
}
|
||||
|
||||
void appl::TextViewer::onEventClipboard(enum ewol::context::clipBoard::clipboardListe _clipboardID) {
|
||||
if (m_buffer != NULL) {
|
||||
if (m_buffer != nullptr) {
|
||||
std::string data = ewol::context::clipBoard::get(_clipboardID);
|
||||
write(data);
|
||||
}
|
||||
@@ -642,7 +642,7 @@ void appl::TextViewer::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
return;
|
||||
}
|
||||
if (_msg.getMessage() == appl::MsgSelectGotoLineSelect) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return;
|
||||
}
|
||||
appl::Buffer::Iterator it = m_buffer->countForwardNLines(m_buffer->begin(), std::stoi(_msg.getData()));
|
||||
@@ -651,7 +651,7 @@ void appl::TextViewer::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
return;
|
||||
}
|
||||
if (_msg.getMessage() == appl::MsgSelectGotoLine) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return;
|
||||
}
|
||||
appl::Buffer::Iterator it = m_buffer->countForwardNLines(m_buffer->begin(), std::stoi(_msg.getData()));
|
||||
@@ -661,7 +661,7 @@ void appl::TextViewer::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
}
|
||||
if (_msg.getMessage() == appl::MsgSelectNewFile) {
|
||||
// reset scroll:
|
||||
if (m_buffer != NULL) {
|
||||
if (m_buffer != nullptr) {
|
||||
m_buffer->unRegisterOnEvent(this);
|
||||
bool needAdd = true;
|
||||
for (size_t iii=0; iii<m_drawingRemenber.size(); ++iii) {
|
||||
@@ -678,10 +678,10 @@ void appl::TextViewer::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
}
|
||||
}
|
||||
m_originScrooled = vec2(0,0);
|
||||
if (m_bufferManager != NULL) {
|
||||
if (m_bufferManager != nullptr) {
|
||||
m_buffer = m_bufferManager->get(_msg.getData());
|
||||
m_bufferManager->setBufferSelected(m_buffer);
|
||||
if (m_buffer != NULL) {
|
||||
if (m_buffer != nullptr) {
|
||||
m_buffer->registerOnEvent(this, appl::Buffer::eventIsModify);
|
||||
m_buffer->registerOnEvent(this, appl::Buffer::eventSelectChange);
|
||||
for (auto element : m_drawingRemenber) {
|
||||
@@ -702,7 +702,7 @@ void appl::TextViewer::onReceiveMessage(const ewol::object::Message& _msg) {
|
||||
void appl::TextViewer::onObjectRemove(const ewol::object::Shared<ewol::Object>& _removeObject) {
|
||||
ewol::widget::WidgetScrolled::onObjectRemove(_removeObject);
|
||||
if (m_buffer == _removeObject) {
|
||||
m_buffer = NULL;
|
||||
m_buffer = nullptr;
|
||||
markToRedraw();
|
||||
}
|
||||
}
|
||||
@@ -731,7 +731,7 @@ void appl::TextViewer::setFontName(const std::string& _fontName) {
|
||||
|
||||
// TODO : Update process time ==> a little expensive (2->4ms) in end of file
|
||||
void appl::TextViewer::updateScrolling() {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return;
|
||||
}
|
||||
vec2 realCursorPosition(0,0);
|
||||
@@ -760,7 +760,7 @@ void appl::TextViewer::updateScrolling() {
|
||||
}
|
||||
|
||||
bool appl::TextViewer::moveCursor(const appl::Buffer::Iterator& _pos) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return false;
|
||||
}
|
||||
markToRedraw();
|
||||
@@ -774,7 +774,7 @@ bool appl::TextViewer::moveCursor(const appl::Buffer::Iterator& _pos) {
|
||||
}
|
||||
|
||||
bool appl::TextViewer::write(const std::string& _data) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return false;
|
||||
}
|
||||
if (m_buffer->hasTextSelected() == true) {
|
||||
@@ -784,7 +784,7 @@ bool appl::TextViewer::write(const std::string& _data) {
|
||||
}
|
||||
|
||||
bool appl::TextViewer::write(const std::string& _data, const appl::Buffer::Iterator& _pos) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return false;
|
||||
}
|
||||
markToRedraw();
|
||||
@@ -800,7 +800,7 @@ bool appl::TextViewer::write(const std::string& _data, const appl::Buffer::Itera
|
||||
}
|
||||
|
||||
bool appl::TextViewer::replace(const std::string& _data, const appl::Buffer::Iterator& _pos, const appl::Buffer::Iterator& _posEnd) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return false;
|
||||
}
|
||||
markToRedraw();
|
||||
@@ -816,7 +816,7 @@ bool appl::TextViewer::replace(const std::string& _data, const appl::Buffer::Ite
|
||||
}
|
||||
|
||||
bool appl::TextViewer::replace(const std::string& _data) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return false;
|
||||
}
|
||||
if (m_buffer->hasTextSelected() == false) {
|
||||
@@ -826,7 +826,7 @@ bool appl::TextViewer::replace(const std::string& _data) {
|
||||
}
|
||||
|
||||
void appl::TextViewer::remove() {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return;
|
||||
}
|
||||
if (m_buffer->hasTextSelected() == false) {
|
||||
@@ -844,7 +844,7 @@ void appl::TextViewer::remove() {
|
||||
|
||||
|
||||
void appl::TextViewer::moveCursorRight(appl::TextViewer::moveMode _mode) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return;
|
||||
}
|
||||
markToRedraw();
|
||||
@@ -867,7 +867,7 @@ void appl::TextViewer::moveCursorRight(appl::TextViewer::moveMode _mode) {
|
||||
}
|
||||
|
||||
void appl::TextViewer::moveCursorLeft(appl::TextViewer::moveMode _mode) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return;
|
||||
}
|
||||
markToRedraw();
|
||||
@@ -890,7 +890,7 @@ void appl::TextViewer::moveCursorLeft(appl::TextViewer::moveMode _mode) {
|
||||
}
|
||||
|
||||
void appl::TextViewer::moveCursorUp(uint32_t _nbLine) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return;
|
||||
}
|
||||
markToRedraw();
|
||||
@@ -916,7 +916,7 @@ void appl::TextViewer::moveCursorUp(uint32_t _nbLine) {
|
||||
}
|
||||
|
||||
void appl::TextViewer::moveCursorDown(uint32_t _nbLine) {
|
||||
if (m_buffer == NULL) {
|
||||
if (m_buffer == nullptr) {
|
||||
return;
|
||||
}
|
||||
markToRedraw();
|
||||
@@ -996,13 +996,13 @@ float appl::TextViewer::getScreenSize(const appl::Buffer::Iterator& _startLinePo
|
||||
}
|
||||
|
||||
void appl::TextViewer::setCurrentSelect() {
|
||||
if (m_viewerManager != NULL) {
|
||||
if (m_viewerManager != nullptr) {
|
||||
m_viewerManager->setViewerSelected(this, m_buffer);
|
||||
}
|
||||
}
|
||||
|
||||
bool appl::TextViewer::isSelectedLast() {
|
||||
if (m_viewerManager != NULL) {
|
||||
if (m_viewerManager != nullptr) {
|
||||
return m_viewerManager->isLastSelected(this);
|
||||
}
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user